How index credit spreads and this backtester work

An index credit spread is a defined-risk options position that collects a premium in exchange for accepting a limited obligation. In a bull put spread you sell a put below the index and buy a cheaper put further below it; the credit received is your maximum profit and the distance between the strikes minus the credit is your maximum loss. A bear call spread is the mirror image above the market, and an iron condor combines the two so the position profits if the index stays inside a range. Because SPX and DJX options are cash-settled and European-style, no shares change hands and assignment risk before expiry does not exist — which is why they are popular vehicles for systematic premium selling.

OctoQuant Analytics evaluates such a position the way a rules engine would, one trading day at a time, in a fixed order. First comes the volatility gateway: if the VIX reading sits outside the band you configured — 14 to 26 by default — the day is skipped entirely, because cheap premium is not worth selling and panic-level premium is not worth being short. Second comes trend alignment, measured as the distance between the index close and its 50-day EMA: comfortably above the average favours a bull put spread, comfortably below favours a bear call spread, and a market hugging the average favours an iron condor.

Third comes strike selection. The short strike is placed at a target delta — around 0.14 by default, roughly a one-in-seven chance of finishing in the money at expiry — solved from a Black-Scholes model using the day's implied volatility, then rounded to the instrument's strike increment. The protective long strike sits one spread width further out, so risk per contract is defined before the trade exists. A credit-to-width gate then rejects any spread paying less than one third of the width, which filters out days where the premium is too thin to justify the tail risk.

Fourth comes sizing and management. Position size is capped as a percentage of account equity rather than as a fixed contract count, so risk scales with the account. Once open, the simulated position is checked through the holding window and closed early when it reaches the profit target — 50% of the credit received, by default — or when the loss reaches a multiple of the credit, which is the stop-loss. Anything still open is settled at expiry.

Every run produces the same reporting set: an equity curve, headline performance metrics, monthly returns, and a trade log where each entry records the structure, the VIX reading at entry, the credit collected and the exit reason. Runs can be saved and compared, which is the practical way to isolate the effect of one rule change. The market history driving these tests is a simulated, reproducible series — so the output describes how a rule set behaves in a controlled environment, not what markets will do next.