Build a strategy
Legs, strike selection, entry rules, exits and sizing.
Strategies live under Strategies. The panel has five blocks, Library, Account, Legs, Entry and Exit. Backtests and sweeps both run whatever strategy is loaded here, against whatever chain is loaded under Data. The date window and the option root belong to the chain, not to the strategy, so you pick them when you load history (see Connect Databento or Connect ThetaData). With no chain loaded, runs use a generated demo chain.
The starting strategy
The app opens on a 0DTE iron condor. It sells a put and a call at 0.16 delta, buys a put 2% below spot and a call 2% above, enters daily at 09:35 ET with one position open at a time, and exits at a 50% profit target, a 200% stop loss or 15:45 ET. It trades one contract against $100,000 of starting capital at $0.65 commission per contract. New resets the panel to this strategy.
Library
- Type a name in
Name. - Click
Save strategy. Saving under a name that already exists replaces that strategy rather than adding a second one. - Pick a saved strategy from the dropdown to load it, or click
Deleteto remove the one loaded. Delete asks first, then loads the first strategy left in the library, or a new default strategy when the library is empty.
The strip at the top shows how many strategies are saved and whether the loaded one has unsaved changes. Loading another strategy or clicking New with unsaved changes asks before discarding them. Names are trimmed of surrounding spaces, and a blank name is refused with "a strategy needs a name to be saved under". The library is one file, strategies.json, in the app data directory, listed in name order. If that file is not readable as strategies, the app reports it rather than replacing it with an empty library.
Underlying and sizing
Underlying names the chain the strategy trades. It is upper-cased as you type and heads the strategy summary on Backtests. A backtest or sweep on loaded history runs only when it matches the loaded chain, by its underlying (SPX) or its option root (SPXW), ignoring case and surrounding spaces. Any other value, a blank one included, is refused with a message naming both the strategy's underlying and the loaded chain, so an SPX strategy never runs on QQQ contracts. A run with no chain loaded uses the generated chain and ignores the field.
The strategy the app opens with is set to SYNTH, the generated chain, and takes the underlying of a chain as soon as one is loaded. New starts from the underlying of the chain loaded at that moment, or SYNTH when none is. A saved strategy keeps the underlying it was saved with.
Size by takes one of two modes.
fixed contractsmultiplies every leg's quantity byContracts, a whole number of at least 1.% of capitalsizes each entry to as many contracts asPercentof current equity will carry as margin, capped by the capital not already held against open positions. Switching to it sets the value to 5. An entry that cannot afford one contract is skipped, and the run reports the skipped count.
Account
Starting capital, Commission per contract and Margin model (index 15%, equity 20% or cash secured) are saved with the strategy. CAGR, drawdown and margin percentages are measured against the starting capital. How fills, commission and margin are computed is covered in Fills, costs and margin.
Legs
Click Add leg to append a row. A new leg is one short put at 0.16 delta. Remove deletes a row and is disabled on the last one, since a strategy needs at least one leg.
| Column | Values |
|---|---|
| Type | put or call |
| Side | short or long |
| Qty | whole number, at least 1 |
| Strike by | delta, % from spot, strike price |
| Value | the number the chosen mode reads |
| DTE | blank uses the entry DTE, a number overrides it for this leg |
Strike selection
Strikes are chosen at entry from the quotes listed for that leg's expiry and type.
deltatakes the strike whose absolute delta is closest to the value, so 0.16 and -0.16 pick the same put. Delta is computed from each quote's own mid price through its implied volatility. Default 0.16.% from spottakes the listed strike nearest spot moved by that percentage. Negative is below spot. Default -2.strike pricetakes the listed strike nearest the number. Default is the underlying at the last bar of the loaded chain, rounded to the nearest 5 (the nearest 1 below 200), or 4700 when no chain is loaded.
Switching the mode resets the value to that mode's default.
Expiry selection
Each leg targets an expiry that many days out, either its own DTE or the entry DTE. The engine takes the listed expiry nearest the target, as long as it lies within a quarter of the target or 3 days, whichever is larger. If no expiry is that close, or a leg finds no strike, the position does not open on that bar. A leg with its own DTE turns the position into a calendar or diagonal.
Entry
DTEis the target days to expiration, a whole number. 0 trades same-day expiries.Time ETis the earliest bar an entry is tried, written HH:MM in Eastern time. Anything else fails the run with "expected HH:MM time".Frequencyisdaily(at most one entry per date),every N days(calendar days since the last entry, set inDays between, default 7), orwhen the last one closes(only with nothing open).Max opencaps how many positions run at once, at least 1.
An entry that cannot fill at the entry time is retried on later bars. No entry opens at or after the exit Time ET, and when the last one closes does not re-enter on the bar where a time, DTE or days-held exit fired. A position that would already sit at or inside the At DTE exit is not opened.
Exit
Every exit rule is optional. A blank field is off, and a position with every rule off runs to expiry. The first rule that fires closes the whole position, checked in this order.
Stop loss %closes once the loss reaches that percentage of the credit taken in or the debit paid.Profit target %closes once the gain reaches that percentage of the same amount. A 50% target on a $1.00 credit closes at $0.50.At DTEcloses once the nearest leg expiry is that many days away or fewer.Max days heldcloses once that many calendar days have passed since entry, at least 1.Time ETcloses at the first bar at or after that time of day.
A leg reaching expiry settles the position before any of these rules. Within a session, a stop or target crossed between two bars fills at the level, not at the far bar. Positions still open when the data ends close at the last bar. The exit reasons appear in the trade log, described in Results and export.
A run refuses a strategy with no legs, a size of zero, or a malformed time. Every rule above can become a sweep axis, see Run a sweep. For the method behind picking rules, read how to backtest options strategies.