Margin Requirement at EOD

Hi there,

I am already using Alpaca API for a while, but recently started looking at Margin Trading.

Following the instructions on https://docs.alpaca.markets/us/docs/margin-and-short-selling, I am a bit confused regarding the End-of-Day Margin Requirement.

I understand that the initial margin requirement is 50%, meaning I can buy a stock at max. 2x leverage.

Furthermore, I understand that if I am flagged as a PDT, I can use an intraday leverage of x4.

What I am confused about: The maintenance margin table lists a 30% maintenance margin requirement for most long stocks. Furthermore, the maintenance margin table specifially defines the requirement as “% of EOD market value”.

So at the EOD, if I hold a stock overnight: Do I have to fulfilll the initial margin requirement of 50%, or only the maintenance margin requirement of 30%?

Let’s say my fictional account holds 100.000 USD, and I buy 300.000 USD of stock A (using an intraday leverage of x3).

At the EOD (assuming the stock value did not change at all), do I have to reduce the position to 200.000 USD (in order to fulfill the Reg T initial margin requirement of 50%), or can I keep it at 300.000 USD (given that the maintenance margin of 30% is fulfilled)?

I already delved deep into the docs (and asked AI quite a lot of dumb questions ;)), however it seems to me that:

  • If I indeed have to fulfill the 50% margin requirement at the EOD, then why do we even have the 30% maintenance margin which is also only checked at EOD?
  • And on the other hand, if only the 30% margin requirement is relevant at the EOD, then why do the docs say “however, to avoid receiving a margin call the next morning, the securities held would need to be reduced to $100,000 or less depending on the maintenance margin requirement by the end of the day”?

I am grateful for any advice you can give me on this!

Many thanks in advance!!

@R333 There are really two separate margin requirements, as you noted. The “initial” margin requirement and the “maintenance” margin requirement.

The “initial” margin is the maximum you can borrow to enter into any initial positions. This applies to new purchases where you open a new position or add to an existing one. The requirement is that the purchase price cannot be more than 50% of the equity in the account. Note that the 50% is a maximum one can borrow and that some equities, such as leverage ETFs, require more equity and sometimes up to 100%, meaning they cannot be leveraged at all. The purchase price is what you actually paid, while the equity is as of the end of day. So, at the end of the day, you need to cover any positions you have added or increased that day. Essentially sum_int_margin > sum_of_entry_order_prices. If this isn’t met, there will be a RegT call, or sometimes called a “fed call”, issued.

The “maintenance” margin is the minimum that must be maintained in an account to act as collateral for any funds borrowed on margin. This applies to all holdings at the end of each day. The requirement is that the end-of-day equity must be greater than the minimum maintenance margins summed for all positions. Essentially eod_equity > sum_maint_margin. If this isn’t met, there will be a maintenance margin call, or sometimes called a “house call”.

While technically one could calculate the initial and maintenance margin requirements for each individual position, in practice that can be challenging. I would recommend letting Alpaca do the calculations and simply do two checks: 1) check that you haven’t exceeded your initial margin. account.equity > account.initial_margin If you have, then close some of the positions you opened on the current day. 2) Check that you haven’t exceeded your maintenance margin account.equity > account.maintenance_margin. If you have then close any positions. You could do this periodically, right before each opening order, or simply just before the end of day.

Note that “end of day” is 20:00 ET which therefore includes any trades made during extended hours. Trades which occur between 20:00 - 24:00 during the overnight session are technically considered part of the following trading day.

@Dan_Whitnable_Alpaca Thank you very much for your detailed reply, this already helps me a lot!

Thank you very much for your detailed reply, this already helps me a lot!

To summarize and check my understanding:

This means the initial margin is relevant only on day 1 (Alpaca checks that I fulfill the initial margin requirement at EOD 1. The Reg T margin requirement only needs to be fulfilled on day 1).

For all following days that I hold a given position, only the maintenance margin is relevant.

In my example, this would mean:

Day 1 (Opening the Position):

My account equity is $100,000.

Intraday, I buy $300,000 of Stock A (using my intraday buying power).

At EOD Day 1: To avoid a Reg T call, I must reduce my position to $200,000. I cannot hold the full $300,000 overnight because the 50% initial margin rule requires my $100,000 equity to cover at least half of the position value.

Day 2 (Holding the Position):

I start the day holding the $200,000 position with a $100,000 margin loan.

The stock price drops, and my position value falls to $160,000.

My equity drops to $60,000 ($160,000 current value - $100,000 loan).

At EOD Day 2: The initial margin rule no longer applies to this established position. Only the 30% maintenance margin is checked.

Since my remaining equity ($60,000) is still greater than $48,000 (30% of $160,000), I receive no margin call and can safely hold the position for another night.

Is my understanding correct here? Once again, thank you very much for the help!