FNOTrader · Algo
← Back to Builder

FNOTrader Algo — Help

A no-code builder for F&O algos. Author multi-leg strategies, backtest them against minute-bar history, and ship the exact same recipe to live trading through your broker. This page documents every feature in the builder, the backtest engine, and the live runtime — with worked examples for each.

Welcome

The execution engine is a standalone Go service that runs configurable multi-leg F&O strategies on your behalf. It pairs three pieces:

Trader's mental model

Think of a strategy as a sentence

WHEN some condition is true on these WATCH instruments, FIRE these legs, MONITOR them under these stop/target rules, and EXIT when this other condition is true (or at square-off time).

Builder is laid out the same way: Step 1–2 define your universe, Step 3 defines triggers, Step 4–5 define legs and risk, Step 6 defines how orders go out.

Five-minute quick-start

  1. Open the builder and pick a Template in Step 1 — e.g. Short Straddle. It seeds the legs for you.
  2. Skip straight to Step 6 → press ▶ Run Backtest. You'll get a full report in 10–20 seconds covering the last month.
  3. Tweak the SL/TG in Step 4 → re-run. Compare results in the Backtest History tab.
  4. Press 💾 Save Strategy. The recipe is now reusable in live trading too.
  5. From the home screen, attach the saved strategy to a Broker Account and press ▶ Start.

Colors & conventions

Blue — CE sideCall options, primary actions, primary buttons.
Amber — PE sidePut options, ATM rows in tables.
Green — bullish / fillBUY legs, profitable trades, day-up.
Red — bearish / lossSELL legs, losing trades, kill-switch tripped.
Accent blue — interactiveLinks, active dropdowns, focus rings.
Muted grey — informationalHelper text, inactive controls, captions.

Badges: BACKTEST works in backtest, LIVE works in live trading, BETA accepted but not fully wired, TODO deferred.

Step 1 · Strategy identity

Three fields define what the strategy is and where it trades.

FieldWhat it does
Strategy Name Free-form label — appears in the Strategies tab, save modal, and backtest history. Autofill is disabled so the browser doesn't accidentally fill your login email here.
Symbol The instrument the strategy trades. Searchable dropdown of every F&O index (NIFTY / BANKNIFTY / FINNIFTY / MIDCPNIFTY / SENSEX / BANKEX) plus every F&O stock. The chosen symbol drives ATM-strike resolution, lot-size lookup, and weekly-vs-monthly expiry eligibility.
Template Pre-built recipes you can use as a starting point: short_straddle, iron_condor, BTST, STBT, rolling_straddle, rolling_strangle, or custom (blank slate). Picking one seeds Steps 4–6.
Tip Weekly expiries are only available on NIFTY and SENSEX (SEBI 2024 rule). For BANKNIFTY / FINNIFTY / RELIANCE etc., the Expiry dropdown on legs will only offer monthly options.

Step 2 · Instruments to Watch

The "vocabulary" your conditions can use. Anything you name here is readable in Step 3 conditions via ALIAS.METRIC.

Scope dropdown

ScopeWhat it resolves toExample alias
SpotUnderlying spot index/stockNIFTY.CLOSE
OptionOne specific strike + CE/PEOPT_ATM_CE.LTP, OPT_OTM2_PE.IV
ATM StraddleSum of ATM CE + ATM PE LTPsATM_STRADDLE.LTP
StrangleSum of OTMn CE + OTMn PE LTPsOTM2_STRANGLE.LTP
Custom CombinerArbitrary linear combination of legs (synthetic)MY_SYNTH.LTP

Per-row fields

Worked example

Add Scope = Option, Alias = OPT_ATM_CE, Option Type = CE, Distance = ATM, TF = 5m. Now in Step 3A you can write:

OPT_ATM_CE.CLOSE > OPT_ATM_CE.EMA(10)

Entry only when ATM CE breaks above its own 10-bar (5m) EMA.

Step 3A · Entry conditions

Multi-row builder. Each row is one boolean clause; rows combine with AND or OR (your choice). The full expression is evaluated every bar (or throttled — see Check Frequency) and the strategy enters on the first true.

Per-row fields

FieldPurpose
SymbolStep-1 instrument the metric reads from. Defaults to the strategy underlying.
MetricIndicator to evaluate. 40+ choices — see catalog.
Metric argsInline numeric inputs for parameters (e.g. EMA period, MACD fast/slow). All values are user-editable.
OperatorHow LHS is compared (full list below).
RHSEither a literal value or another metric. Toggle with the value/metric pill.

Operator catalog

OperatorFires when…
greater_than / less_thanPlain numeric comparison.
above / belowLHS above/below a price reference (e.g. above_VWAP).
crossingLHS crosses RHS in either direction this bar.
crossing_up / crossing_downLHS crosses RHS from below / above this bar.
moving_up / moving_downLHS strictly increasing / decreasing N bars in a row.
inside_channel / outside_channelLHS is between (or outside) two RHS values.
entering_channel / exiting_channelEntered / left the channel this bar.
new_day_high / new_day_lowLHS prints a fresh intraday extreme.
range_breakout_up / _down / _eitherLHS breaks above/below/either side of the opening-range high/low. Window is user-editable (Start–End times).

Combine mode

Toggle AND (all rows must fire) or OR (any one). Rows cannot mix AND/OR within one block — for that, save two strategies and cascade them via On-Hit actions.

Check Frequency

How often the expression is evaluated:

Lookahead-bias guard In backtest, an indicator-driven entry signal at bar X always fills at bar X+1's OPEN — never at the same bar's close. This matches QuantMan semantics and what's physically possible in live trading. Pure-TIME strategies (no indicator read) fill same-bar since no bar data was consulted.

Step 3B · Exit conditions

Same builder as 3A but evaluated after entry. If any exit row fires (when combine = OR) or all exit rows fire (combine = AND), the engine flattens every open leg at next bar's open.

Exit conditions compose with the per-leg SL/TG (Step 4) and Combined SL/TG (Step 5). Whichever triggers first wins — they're not mutually exclusive.

Step 3C · BTST / STBT mode

Buy-Today-Sell-Tomorrow / Sell-Today-Buy-Tomorrow. Two time pickers: Start Time (today's entry window) and Exit Time (next trading day's square-off). When both are set, the engine flips overnight_hold = true and the strategy is held across the EOD square-off boundary. Entry/Exit conditions 3A/3B remain available but optional.

Step 4 · Strategy Legs

Table of legs the strategy fires. One row per leg.

Main-row columns

ColWhat it does
IdleLeg is deferred — won't fire at entry. Activated only by another leg's execute_other_leg action.
HedgeMarks a protective BUY leg. Excluded from Move-SL-to-Cost and exits last on flatten.
SideBUY / SELL
Fut/OptOPT (default) or FUT. FUT hides Type/Strike-Selection cells.
TypeCE or PE
Strike SelectionHow the strike is picked — see below.
Strike ValueAdapts to the selection mode.
ExpiryRelative (Current Weekly / Next Weekly / Current Monthly / Next Monthly) or Absolute date.
Qty (lots)Multiplied by lot_size at order time.
⚙ SettingsExpands the advanced 4-tab panel.

Strike Selection modes

ModeBehaviourBacktest support
DistanceATM / OTM1–15 / ITM1–15 strike steps from ATM. Most common.ATM±10 — deeper strikes clamp to boundary with a warning.
AbsoluteExact strike number (e.g. 24500).LIVE — backtest clamps to nearest archived strike with a warning.
PremiumEngine picks the strike whose LTP is closest to a target ₹ value.LIVE — backtest clamp warning.
DeltaTarget |delta| (e.g. 0.30 for ~30-delta).LIVE — backtest clamp warning.
Straddle WidthStrike whose premium is N% (or N×) of the ATM straddle premium.LIVE
Underlying PriceSigned % offset from spot — e.g. +0.5% on NIFTY=24000 → strike ≈ 24120.LIVE

Advanced (⚙) — tabbed panel

Tab 1 · Wait & Trade

Delay this leg's entry until its premium crosses a trigger price. Useful for buying weakness or selling strength after the basket has already fired.

Tab 2 · Stoploss (SL1+)

SL TypeMeaning
pct% of entry premium (e.g. 30 = 30%).
pointsFlat ₹ move from entry (e.g. 15 = ₹15 swing).
pnlPer-leg ₹ loss (qty-aware).
underlying_move / _up / _downSL trips when spot moves N points or N% in the chosen direction.
deltaSL trips when the leg's |delta| crosses a threshold.
atrSL = entry ± N × ATR(period). ATR source is a Step-1 watch instrument.

Per-rung fields: SL Qty (% or lots), On-Hit action, Check Frequency. Add SL2 / SL3 rungs for laddered exits.

On-Hit action catalog

ActionEffect
just exitClose the leg, do nothing else (default).
keep_leg_runningDon't close — mark SL fired but continue holding. Useful for ladder rungs that change behaviour without flat-flat.
re_execute_N_timesClose, then re-fire the same leg up to N times. Each re-entry counts.
close_leg_idAlso close another leg by ID (e.g. spread partner).
enter_leg_idFire a leg marked Idle.
move_sl_to_costMove every other leg's SL to its entry price (lock breakeven).
add_qty_pctScale up the leg by N% (martingale-style).
execute_other_legTrigger another leg with optional delay (live engine cascade).
execute_other_strategyLaunch a separate saved strategy.

Tab 3 · Target (TGT1+)

Same structure as SL. Target Types include all SL types plus r_multiple (risk-reward — target distance = N × stop distance).

Tab 4 · Per-leg Trailing

Step 5 · Strategy Risk Settings (Combined)

Same shape as the per-leg advanced panel but at the basket level. Four tabs: Wait & Trade, Stoploss, Target, Trailing.

Combined SL/TG fires when the basket-level MTM (sum of all open-leg PnLs) crosses a ₹ or % threshold. On hit, the action choices include:

Step 6 · Execution Settings

FieldWhat it does
Legs Executionparallel (all at once), sequential (fire next after prev fills), buy_first (BUYs in parallel, then SELLs after delay).
Hold Sell SecDelay between BUY batch and SELL batch in buy_first mode. Used to lock hedges before opening short exposure.
If Leg Failscancel_all / keep_placed / retry_failed (with Max Retries).
Spike Protect %Skip entry if spread > %.
Spread Limit %Reject any leg whose bid/ask spread exceeds %.
Premium Gap %Reject if leg LTP gapped > % from prev close.
Slippage %Cap acceptable slippage at fill.
Run On DaysMon–Sun checkboxes. Strategy is paused on un-checked days.
DTE FilterOnly enter when days-to-expiry matches the chosen set (discrete: pick 0,1,2…) or range (e.g. 3–7). Basis = weekly or monthly cycle.
Max LotsHard cap on total lot count across all legs.
Exposure (₹)Auto-size qty from capital — engine divides this by margin/lot to compute lots.
Order TypeMKT / LMT / LMT-BUF (limit with N% buffer off LTP).
ProductNRML (carry) / MIS (intraday).
Send to TelegramMirror lifecycle events to your bot.

Step 7 · Summary & Save

A single-page English-prose recap of everything you've configured. Refresh it (↻) any time. Then ▶ Start Strategy (live), 💾 Save Strategy (reusable recipe), or Export JSON / Import JSON (share/version).

Expression language

Conditions internally compile to a small expression language. The builder writes it for you, but you can also type it directly into the Preview box (advanced).

Operators & precedence

ClassOperatorsNotes
BooleanAND OR NOTCase-insensitive; standard precedence (NOT > AND > OR).
Comparison> < >= <= == !=Pair LHS metric to RHS value/metric.
Arithmetic+ - * /Standard math precedence. Use parentheses freely.
Grouping( )Override precedence.

Symbol resolution

Three styles, all interchangeable:

Special identifiers

TokenValue
TIMECurrent bar in HHMM (e.g. TIME >= 0930).
PREV_CLOSEYesterday's last bar close — persists across overnight gap.
LAST_TICKTick-level LTP (not candle-level). Useful for sub-second alerts in live.

Multi-instrument (Phase 4.6)

Cross-index gating

You can reference foreign underlyings in the same expression. Common use: trade NIFTY only when the broader market (SENSEX) also agrees.

// NIFTY straddle, only when SENSEX is trending up
TIME >= 0920 AND SENSEX.CLOSE > SENSEX.EMA(10)

Backtest data: only NIFTY and SENSEX have archived spot bars today. BANKNIFTY / FINNIFTY references compile fine but produce a warning + read as 0 (so the gate effectively never fires). Live trading is unaffected — all 6 indices stream.

Arithmetic between metrics

The evaluator supports full arithmetic between metric reads. Strike-wise PCR is the canonical example:

// Strike-wise PCR > 1.5 (puts dominate at ATM = bearish hedging)
ATM_PE.OI / ATM_CE.OI > 1.5

// Straddle premium relative to spot > 1.5%
(ATM_CE.LTP + ATM_PE.LTP) / NIFTY.CLOSE * 100 > 1.5

// Credit-spread net premium > ₹50
LEG1.LTP - LEG2.LTP > 50

Every condition row in Steps 3A/3B has an optional arithmetic combinator between the primary metric and the operator — a small dropdown reading by default. Pick +, , ×, or ÷ and a second [Symbol] + [Metric] + [args] block appears, so you can build composite LHS expressions like ATM_PE.OI ÷ ATM_CE.OI > 1.5 entirely from dropdowns. The Preview textarea is still available for power users who want to type longer compound expressions directly.

Metrics & indicator catalog

Every metric below works on any symbol — spot, option, alias.

Price & structural

MetricReturnsExample
LTPLast traded priceOPT_ATM_CE.LTP > 200
OPEN / HIGH / LOW / CLOSECurrent bar's OHLCNIFTY.CLOSE > NIFTY.OPEN
DAY_HIGH / DAY_LOWIntraday extremeNIFTY.CLOSE >= NIFTY.DAY_HIGH
PREV_CLOSEYesterday's last closeNIFTY.CLOSE > PREV_CLOSE
VWAPVolume-weighted avg price (day-anchored)NIFTY.CLOSE > NIFTY.VWAP
SMA(N)Simple moving avg over N barsNIFTY.CLOSE > NIFTY.SMA(20)
EMA(N)Exponential MANIFTY.CLOSE > NIFTY.EMA(10)
WMA(N)Weighted MANIFTY.WMA(14)
SAR(step, max)Parabolic SAR (defaults 0.02, 0.2)NIFTY.CLOSE > NIFTY.SAR(0.02, 0.2)

Momentum

MetricReturnsExample
RSI(N)Wilder RSI (0–100)NIFTY.RSI(14) < 30
ROC(N)Rate of change (%) over N barsNIFTY.ROC(5) > 0.5
MACD(fast, slow)MACD lineNIFTY.MACD(12, 26) > 0
MACD_SIGNAL(f, s, sig)Signal lineNIFTY.MACD(12,26) > NIFTY.MACD_SIGNAL(12,26,9)
MACD_HIST(...)Histogram (MACD − signal)NIFTY.MACD_HIST(12,26,9) > 0
STOCH_K(N) / STOCH_D(N, d)Stochastic %K / %DNIFTY.STOCH_K(14) > 80
ADX(N)Average Directional IndexNIFTY.ADX(14) > 25
CCI(N)Commodity Channel IndexNIFTY.CCI(20) > 100
WILLR(N)Williams %R (−100..0)NIFTY.WILLR(14) > -20

Volatility & channels

MetricReturnsExample
ATR(N)Avg True RangeNIFTY.ATR(14) > 100
BB_UPPER(N, σ)Bollinger upper bandNIFTY.CLOSE > NIFTY.BB_UPPER(20, 2)
BB_MIDDLE(N)BB middle (SMA(N))NIFTY.BB_MIDDLE(20)
BB_LOWER(N, σ)BB lower bandNIFTY.CLOSE < NIFTY.BB_LOWER(20, 2)
SUPERTREND(N, mult)Supertrend valueNIFTY.CLOSE > NIFTY.SUPERTREND(10, 3)

Volume / OI / CDV

MetricReturnsExample
VOLUMEBar volumeOPT_ATM_CE.VOLUME > 100000
OBVOn-Balance VolumeNIFTY.OBV > 0
OIOpen interest (options only)ATM_PE.OI / ATM_CE.OI > 1.5
CDVCumulative delta volume (signed)NIFTY.CDV > 0
BUILDUPOI buildup tag (long/short addition/unwinding)OPT_ATM_CE.BUILDUP == 1

Option Greeks

Computed via Black-Scholes (Hull 11e) at risk-free rate 6.5%. Returned per option symbol; backtest computes on-the-fly from (spot, strike, IV, DTE).

MetricReturnsExample
IVImplied volatility (%)ATM_CE.IV > 25
DELTAPrice sensitivity to spotOPT_ATM_CE.DELTA > 0.4
GAMMAΔ sensitivity to spotATM_CE.GAMMA > 0.001
THETAPer-day time decay (₹)OPT_ATM_CE.THETA < -50
VEGAPer-1%-IV sensitivity (₹)ATM_CE.VEGA > 20

Pivots, CPR, Camarilla

MetricReturns
PIVOT_P, PIVOT_R1..R3, PIVOT_S1..S3Standard floor pivots
CPR_PIVOT, CPR_TC, CPR_BC, CPR_WIDTHCentral Pivot Range bands
FIB_P, FIB_R1..R3, FIB_S1..S3Fibonacci pivots
CAM_H1..H4, CAM_L1..L4Camarilla bands

TIME & PREV_CLOSE

// Window-only entry
TIME >= 0925 AND TIME < 1100

// Gap-up open
NIFTY.OPEN > PREV_CLOSE * 1.005

Backtest engine

Replays your saved strategy against minute-bar history from dhan_backtest.db (29.4M option rows, spot bars per index, ATM±10 strike coverage with full OHLC + IV + OI). Hit ▶ Run Backtest on any saved strategy; reports are persisted to Backtest History.

What's loaded

On-the-fly Greeks

The archive carries OHLC + IV + OI but not Δ Γ Θ Vega. The engine computes them per-minute from (spot, strike, IV, DTE) via Black-Scholes. Theta ticks down throughout the day as DTE shrinks. Verified by 7 unit tests including ATM sanity, deep ITM/OTM bounds, Γ-peak-at-ATM, vega-peak-at-ATM, garbage-input guards, and put-call parity at 1e-9 precision.

Multi-instrument

Expression tokens like SENSEX.RSI(14) in a NIFTY backtest transparently load SENSEX spot bars in lock-step. Unsupported foreign underlyings (BANKNIFTY, FINNIFTY, MIDCPNIFTY, BANKEX) surface a clear Warnings entry instead of silently zeroing — see multi-instrument.

No-lookahead-bias

Honest backtesting

Common backtester bug: signal fires at bar X's close and "fills" at bar X's open. That's physically impossible — the open already happened 60s before the close existed — and inflates results.

This engine enforces a 1-bar defer: indicator signal at bar X → fill at bar X+1's OPEN. The rule applies to entry, exit_condition, per-leg SL/TG, AND combined SL/TG.

Pure-TIME strategies (no bar data read) still fill same-bar — no lookahead since no bar was consulted to decide.

Friction model

Two knobs in the Run-Backtest dialog:

The report has 3 tabs: Plain, Costs only, +Slippage — so you can see the friction sensitivity instantly.

Check Frequency throttle

Honored independently per surface: entry expression, exit expression, per-leg SL1/SL2/TGT1/TGT2/Trail, and combined SL/TG/Trail. shouldCheckThisMinute() handles three modes:

Use this to model "evaluate SL only on 5-min close" or "Combined SL every minute, per-leg SL every 5 minutes" mixtures.

Strike clamp at ATM±10

The archive only has ATM±10 strike data. Out-of-range legs are clamped to the boundary (with a warning) — never silently skipped. Live trading uses the exact strike you specified.

You'll also see a clamp notification toast in the Builder when:

Report & History

Every backtest produces:

Every run is persisted to Backtest History — sort by PnL, win rate, sharpe.

Live trading · broker adapters

AdapterStatusUse case
stubREADYNo real orders. Lifecycle / smoke tests.
paperREADYFills at current LTP from quote feed. Realistic dry-run with live data.
kiteWIREDZerodha — adapter scaffold in place.
dhanWIREDDhan — adapter scaffold in place.

Strategy lifecycle

  1. Start — registry spawns a supervised goroutine for the strategy.
  2. Wait for entry — evaluates entry condition every tick (or per check_freq) until firing.
  3. Resolve strikes — uses the per-leg strike-selection mode (Distance / Premium / Delta / OI-based / etc.).
  4. Fire legs — atomically, per execution-mode (parallel / sequential / buy-first).
  5. Monitor — quote feed per leg → per-leg SL/TG → combined SL/TG → trail SL — all gated by their own check_freq.
  6. Exit — on SL/TG hit, exit-condition fire, sqoff time, or kill-switch.
  7. Settle — records realised P&L, updates daily-loss counters, marks strategy complete.

Leg execution modes

Fail policies when any leg fails to fill:

On-Hit actions

Fire on SL or TGT events at the leg level (Step 4 → SL/TGT tabs) or the basket level (Step 5 → Combined SL/TGT). See the Step 4 action catalog for per-leg; basket-level actions are listed in Step 5. All actions can chain and most carry a delay parameter for staged behaviour.

Hedges & Move-SL-to-Cost

Risk gate

SettingEffect
Max Daily LossKill switch — once realised P&L for the day drops below this, no new entries fire (across all strategies). Resets at IST midnight.
Max Daily TradesCap on entry count per day.

Webhook entry (OnSignal)

Get a private token from the Webhook page. POST to /api/webhook/signal/{token} with no body — the token is the auth. The configured saved-strategy fires immediately. Useful for TradingView / Python alerts / external scanners.

curl -X POST https://your-engine/api/webhook/signal/AbC123xyz

Telegram notifications

Tick Send to Telegram in Step 6 to mirror every lifecycle event to your bot — entry fills, SL/TG hits, leg closes, re-entries, auto-hedge applied. Configure bot_token + chat_id in config.yml. Buffered, non-blocking, Markdown-formatted.

Strategy recipes

Twelve worked examples covering the breadth of features. Each is a complete spec you can paste into the builder.

R1 · Short Straddle Beginner

UnderlyingNIFTY · Current Weekly
EntryTIME >= 0920
Legs SELL PE · ATM · 1 lot · SL 30% · TG 50%
SELL CE · ATM · 1 lot · SL 30% · TG 50%
Sqoff15:25
WhyThe Hello-World of premium selling. Sell both ATM legs at the bell, exit on either side hitting SL or by EOD.

R2 · Iron Condor with hedges Beginner

EntryTIME >= 0920
Legs SELL PE ATM · SL 30% · TG 50%
SELL CE ATM · SL 30% · TG 50%
BUY PE OTM3 · Hedge ✓
BUY CE OTM3 · Hedge ✓
CombinedMove SL to Cost when basket MTM > +₹1500
WhyDefined-risk short strangle. Hedges cap max loss and qualify for margin benefit. Move-SL-to-Cost locks breakeven once the trade pays you something.

R3 · EMA-crossover long CE Beginner

WatchOPT_ATM_CE · 5m TF
EntryTIME >= 0925 AND OPT_ATM_CE.CLOSE > OPT_ATM_CE.EMA(10)
LegsBUY CE · ATM · SL 25% · TG 50%
WhyPure directional. Enter long CE only after the option price closes above its own 10-period EMA on 5m — confirms intra-bar momentum before paying premium.

R4 · Range Breakout strangle Intermediate

EntryNIFTY.CLOSE range_breakout_either (window 09:15–10:00)
LegsSELL OTM2 CE + SELL OTM2 PE
SL30% per leg · Combined TG ₹2000
WhyFade the post-breakout drift. Wait for the 09:15–10:00 range to be defined, then sell wings once direction reveals itself.

R5 · PCR-gated straddle Intermediate

WatchATM_CE · ATM_PE
Entry Row 1: TIME ≥ 0930
Row 2: ATM_PE · OI · ÷ · ATM_CE · OI · > · 1.5 (use the arithmetic ÷ between the two metrics)
Compiled: TIME >= 0930 AND (ATM_PE.OI / ATM_CE.OI) > 1.5
LegsStandard short straddle
WhyOnly sell premium when there's evidence puts are being aggressively positioned (PCR > 1.5 at ATM) — i.e. crowd is hedging hard, vol-of-vol likely topped.

R6 · IV-filtered iron fly Intermediate

EntryTIME >= 0920 AND ATM_CE.IV > 18
LegsIron Condor (R2 setup) — only fires on elevated-IV days.
WhyPremium selling pays only when IV is rich. Add a single IV gate to skip low-vol "death by theta" days.

R7 · BTST overnight strangle Intermediate

ModeStep 3C · BTST · Start 15:15 · Exit 09:30
LegsSell OTM2 CE + OTM2 PE
Combined SL₹1500
WhyCapture overnight theta on a defined window. Position late, square next morning before any post-open drift bites.

R8 · Cross-index gate Advanced

UnderlyingNIFTY
EntryTIME >= 0920 AND SENSEX.CLOSE > SENSEX.EMA(10)
WhyTrade NIFTY only when the broader market (SENSEX) agrees. Diversification of signal source — reduces false starts on NIFTY-internal noise.

R9 · Delta-gated CE seller Advanced

WatchATM_CE
EntryTIME >= 0920 AND ATM_CE.DELTA > 0.4 AND ATM_CE.DELTA < 0.6
LegsSELL CE · ATM · Combined TG ₹2000
WhySell only at-the-money calls. Filter for "true ATM" via Δ in (0.4, 0.6) — protects against early-DTE drift where the nominal ATM strike has already moved deep ITM/OTM.

R10 · Multi-level SL ladder Advanced

LegSELL CE ATM · 1 lot
SL115% · Qty 50% · action just exit · check freq tick
SL230% · Qty 100% · action move_sl_to_cost on remaining · check freq 5m close
WhyScale-out on first stop, kill on second. Different check frequencies let SL1 trigger on a wick while SL2 only fires on a 5m close — fewer false flushes.

R11 · Combined SL kill-switch + re-enter Advanced

Combined SL₹2000 · action close_and_re_enter_strategy · delay 300s · NTimes 2
WhyIf the basket goes ₹2000 against you, flatten and re-enter at fresh levels after 5 minutes. Cap at 2 re-entries per day so you don't martingale forever.

R12 · 5m TF indicator + 1m execution Advanced

WatchOPT_ATM_CE · TF = 5m
EntryOPT_ATM_CE.CLOSE > OPT_ATM_CE.EMA(10)
Check freqtick (= 1m)
WhyEMA(10) computes on 5-min candles. The condition is re-checked every minute but only flips state on the 5-min close. Lets you react quickly (1m) while still using a noise-resistant trend filter (5m).

Known limits

Glossary

TermMeaning
ATMAt-the-money. Strike closest to current spot.
ATM±NN strike steps away from ATM (typically 50pt for NIFTY, 100pt for BANKNIFTY).
OTMOut-of-the-money. CE strike > spot, or PE strike < spot.
ITMIn-the-money. Opposite of OTM.
DTEDays to expiry.
MTMMark-to-market — current unrealised P&L.
NRMLCarry-forward (overnight) product.
MISIntraday product — must square off by 15:25 IST.
PCRPut-Call Ratio. OI(PE) / OI(CE) — at a strike or aggregated.
IVImplied Volatility (%).
VWAPVolume-Weighted Average Price (day-anchored).
Lookahead biasBacktester bug where a signal fills at a price that didn't yet exist when the signal computed.
Combined SL/TGBasket-level stop/target on the sum of all open-leg PnLs.
Move-SL-to-CostAction that moves every other leg's stop to its entry price (lock breakeven).
BTST / STBTBuy-Today-Sell-Tomorrow / Sell-Today-Buy-Tomorrow — overnight hold.
Hedge legA BUY leg flagged to cap basket loss; excluded from Move-SL-to-Cost; exits last.
Idle legLeg that doesn't fire at entry — activated only by another leg's execute_other_leg action.

FAQ

Why are my backtest trades different from yesterday's run?

Most likely you tweaked something in the Builder, or the engine received a lookahead-bias fix / Greeks fix / TF-fix in a recent release. If the recipe is unchanged and pre-dates a fix, results should diverge — the older results were quietly wrong.

My strategy never enters in backtest. Why?

Check the Warnings panel of the report. Common reasons:

Why is my entry timing one bar later than my signal?

That's the lookahead-bias guard working as intended — see No-lookahead-bias. Pure-TIME entries don't defer; only indicator-driven entries do.

How do I compute strike-wise PCR?

Pick the primary metric (e.g. ATM_PE · OI), then choose ÷ from the arithmetic-combinator dropdown in the same row, then pick the second metric (ATM_CE · OI). Set the operator to greater than and the RHS value to 1.5. The Preview compiles to (ATM_PE.OI / ATM_CE.OI) > 1.5 and the backtest/live engine evaluates it natively — no special PCR metric needed because the same UI supports any ratio / sum / difference / product of two metrics.

What's the difference between "tick" and "xm_close" check freq?

tick evaluates every minute bar. xm_close only evaluates on bars whose minute-of-day mod X is zero — so 5m_close fires at 09:20, 09:25, 09:30, … and ignores the bars between. Use xm_close to model "candle-close confirmation" entry/exit logic.