Volatlas

Fills, costs and margin

How every backtest prices fills, charges commission and holds margin against an account.

Set the account

Every strategy carries the account it is measured against. Open Strategies and find the Account block.

FieldDefaultWhat it does
Starting capital100,000The balance CAGR, drawdown and margin percentages are measured against
Commission per contract0.65Dollars charged for each contract traded, on open and on close
Margin modelindex 15%The rule that charges a short nothing else covers. The other choices are equity 20% and cash secured

The account is saved with the strategy, so a saved strategy reruns on the same numbers. A strategy saved before the account existed loads on the defaults above. Both a backtest and a sweep use the account of the strategy that is loaded.

Fills

Each leg fills halfway between the mid and the side of the book it crosses. A buy fills at the mid plus half of the half-spread, a sell at the mid minus the same amount. A sell never fills below zero. Opening a short leg is a sell and closing it is a buy, and the reverse holds for a long leg.

With a bid of 1.00 and an ask of 1.20, the mid is 1.10 and the half-spread is 0.10. A buy fills at 1.15 and a sell at 1.05. The fill share is fixed at half and is not a field in the app.

A position opens only when every leg has a quote at the entry bar. If one leg has no quote, the entry is not taken and nothing is counted. An entry that would already sit at or inside its At DTE exit is refused the same way, since it would close on its next bar.

Commission

Commission is Commission per contract times every contract traded. A four-leg iron condor of one contract each pays four commissions to open and four to close. A leg that settles at expiry is not traded, so it pays no closing commission. Commissions are subtracted from each trade's P&L and from the equity curve while the position is open.

Margin

Each position is charged what a broker would hold against it, computed at entry from the legs, their fill prices and the underlying at that bar. The amount is held until the position closes and shows in the Margin column of the trade log. The highest total held at once is the Peak margin statistic, with its share of the account beneath it.

Covered positions

When every short is covered by a long of the same type, the position is charged the worst it can settle for. The engine checks the payoff at each of the position's strikes and at a worthless underlying. The results follow from that.

  • A credit spread holds its width less the credit taken.
  • A debit spread or a long option holds the debit paid.
  • An iron condor holds the worse of its two wings less the total credit, not the sum of both wings, because the underlying cannot finish beyond both.

All legs are valued together at their strikes, so the long of a calendar or diagonal is valued without the time it has left. The number is conservative for those structures.

Uncovered shorts

Longs cover the safest shorts first, leaving the deepest short call and the highest short put bare. Each bare contract is charged by the margin model.

ModelPer share, per bare short
index 15%Premium + max(15% of underlying minus out-of-the-money amount, floor)
equity 20%Premium + max(20% of underlying minus out-of-the-money amount, floor)
cash securedPut strike minus premium, or underlying minus premium for a call

The floor is 10% of the underlying for a call and 10% of the strike for a put. A short 4800 put taken for 18.00 with the underlying at 5000 holds 18 + (750 minus 200) = 568 per share under index 15%, or 56,800 per contract, rather than the 480,000 of a cash-secured put.

When both sides have a bare short, as in a strangle, only one side can lose at expiry. The position holds the dearer side's requirement plus the premium taken on the other side. A position with a bare short never holds less than its worst settlement at its own strikes.

Skipped entries

An entry is refused when its margin is more than the free capital, which is realized equity minus the margin already held by open positions. Unrealized gains do not count toward free capital.

With % of capital sizing, the entry takes that share of realized equity, capped at the free capital, and divides it by the margin of one unit of the position. If that buys less than one unit, the entry is refused.

Refusals are counted, and an entry refused on several bars in a row counts once. When the count is above zero, a note under the trade log reports how many entries were skipped because the account could not carry the position. Raise Starting capital, lower the size or lower Max open to bring them back.

Stops and targets inside a bar

Profit target % and Stop loss % are percentages of the credit received or debit paid. A stop of 200 on a short premium trade closes when the loss reaches twice the credit. When both are hit on the same bar, the stop wins.

A bar that has moved past a level crossed it somewhere in between. The engine draws a straight line from the previous bar's value of the position to this one, walks it a second at a time, and fills at the first second past the level. The fill is the level itself, not the far end of the bar.

Two cases fill at the bar instead.

  • The previous value is from an earlier session. A gap between sessions is a move the market made, so the fill is where trading resumed.
  • The position has no previous value, which is a level hit on the first bar after entry.

The straight line cannot see a spike that went through a level and came back inside the same bar. Finer bars narrow that gap.

Expiry and settlement

When any leg of a position reaches expiry, the whole position closes with the reason expiry. Expired legs settle at intrinsic value against the underlying, and any leg still trading is closed at its fill price.

  • Weeklies and equities trade to 16:00 ET on the expiry date and settle there, or at the last bar of that date if the data ends earlier.
  • The monthly SPX, NDX and RUT roots stop trading the night before and settle against the first bar of the expiry morning.
  • A leg seen only after its expiry date settles against the previous session's close.

The convention comes from the root the chain was loaded for and is not a setting. A position whose live leg has no quote on a bar stays open until a later bar has one. Positions still open when the data runs out close at the last bar with the reason end of data.

Early assignment and early exercise are not modelled. A short leg stays open until an exit rule, expiry or the end of the data closes it.

Margin and fills need a real chain to mean anything. See Connect Databento or Connect ThetaData, check what a window costs on the data cost page, and read the trade log in Results and export. For the method behind the numbers, see how to backtest options strategies.