Could your account have taken those trades? Margin in options backtesting
Xavi ·
An options backtest can show attractive returns while asking an account to carry positions it could not afford.
Selling options makes this easy to overlook. Premium arrives as cash, but the position also creates an obligation. That cash alone does not tell you whether the account can support another trade.
StratVerra’s margin feature adds a capital constraint to the simulation. Before accepting an order, the backtesting engine assesses the resulting options positions using its Reg-T margin model. If the order would increase the modeled requirement beyond account equity, the engine rejects it, provided it has the data needed to make that assessment.
That changes how you read the result. Alongside profit and loss, you can examine how much margin the simulated positions required and whether the strategy tried to trade beyond its means.
Margin changes which trades happen
Starting capital should affect more than the percentage return shown at the end of a backtest.
Consider an illustrative account with $12,000 in equity. It already holds positions, and a new order would increase its total modeled margin requirement to $18,500. With a complete assessment, StratVerra refuses that order before it enters the simulated book.
The order receives a Rejected status. The log explains the projected requirement, the account’s equity, and the group of positions contributing the largest requirement.
Only the first twenty refusals are written out in full. After that the run keeps counting them but stops logging each one, so a large rejection count will not have a matching number of log lines.
This matters when you compare runs. A smaller account may take fewer trades than a larger one using the same strategy rules. Its results describe the trades that were accepted, not every trade the strategy attempted.
A profitable result with margin rejections therefore needs a closer look. You may be evaluating a different set of trades than you intended.
The margin check also leaves room to reduce exposure: it does not refuse an order that reduces the modeled requirement, even when the account is already above its limit. Passing that check is not a promise of a fill; the other execution rules still apply.
How StratVerra evaluates the positions
The model groups option positions by underlying root and expiration date. For each group, it compares:
- The uncovered-option requirement for the short legs.
- The group’s worst expiration-payoff loss, before entry premiums.
It uses the lower amount, then adds the group requirements together.
The calculation works from the actual legs rather than relying on a strategy label. A protective long option can bound a spread’s expiration loss. An uncovered short call has no finite maximum loss, so the uncovered-option calculation applies instead.
Premiums are accounted for separately through the portfolio. The reported margin requirement is not simply a spread’s familiar net maximum loss after credit, and it is not a quote for the deposit your broker would demand.
Why intraday peak margin matters
A strategy can use substantial margin during the session and finish the day with no positions. Measuring only at the close would miss the capital it needed while it was trading.
StratVerra records the highest assessed requirement for each day. From that history, it reports:
- Peak margin: the highest recorded daily requirement across the run.
- Average margin: the average of those daily highs, not a time-weighted average of the session.
That distinction is useful for 0DTE strategies that close before the bell. An empty account at the close does not mean the strategy needed no capital during the day.
Read these figures alongside rejected orders. Peak margin describes the positions the simulation actually carried. It does not include the full requirement of positions that were refused.
What the model does not promise
The margin feature makes capital assumptions more visible. It does not reproduce every broker’s buying-power calculation.
Several boundaries matter when interpreting a run:
- It models Reg-T, not portfolio margin. Brokers can also apply their own requirements. The simulated figure may differ in either direction from your account’s figure.
- Different expirations do not offset each other. The model does not recognize a long option in one expiry as protection for a short in another. Calendars and diagonals can therefore receive more conservative treatment.
- Grouping can overstate requirements. An unbounded short-call position can cause other shorts at the same root and expiry to receive uncovered treatment, even when some have protective longs.
- Resting orders do not reserve margin. The check assesses current positions plus the order being submitted. Multiple pending orders can pass individually and collectively exceed the requirement after filling.
- Shares are outside this options model. It does not calculate share margin or use shares to recognize covered calls.
Missing prices also matter. If the requirement cannot be calculated reliably, or portfolio equity depends on valuing a position at cost, the margin check allows the order through rather than rejecting it on an unreliable estimate.
A day when held positions could never be fully assessed is omitted from margin history and counted as skipped, rather than reported as zero. A partially assessed day can remain in the history, but its observed high may miss the true high. The skipped-day count does not tell you how many orders passed without margin enforcement.
Backtesting enforces; live trading advises
StratVerra computes the same modeled requirement during live trading, but there it is advisory. A projected breach produces a warning rather than a margin-model rejection. The broker remains responsible for deciding what the live account can carry.
Passing a backtest margin check does not guarantee that a broker will accept the order.
Test the account size as well as the strategy
Take an existing strategy and rerun it with the starting capital you want to evaluate. Keep the date range, trading rules, slippage, and commissions unchanged.
Review the margin rejections and their logs before comparing returns. Then check peak margin, average margin, and any skipped days. If you change contract size, rerun the test rather than assuming the original results scale proportionally.
The useful question is whether the strategy’s trading rules and capital assumptions hold together in the simulation. Finding a mismatch here gives you something concrete to investigate before risking money.
Start a free StratVerra trial and test one of your existing options strategies with margin included.