Skip to content

Strategies

The AI is an authoring assistant. A saved strategy is YAML with a strict, versioned vocabulary; no model call is needed to evaluate it later.

Completed user/assistant turns are atomically persisted under ~/.jorli/conversations and the latest session resumes after restart; /new starts a new session. Likely API keys, broker tokens, passwords, PINs, and TOTP values are rejected before model or disk.

Terminal window
jorli # describe the rules conversationally
jorli strategy import strategy.yaml
jorli strategy list
jorli strategy show infy-ema-crossover
jorli strategy accept infy-ema-crossover

Acceptance confirms that the rendered rules match your intent. Backtesting is blocked until acceptance. Approval is blocked until a backtest has completed.

schemaVersion: 1
name: infy-ema-crossover
universe:
instruments: [NSE:INFY]
timeframe: 15m
entry:
side: long
when:
crossover:
left: { ema: { source: close, period: 20 } }
right: { ema: { source: close, period: 50 } }
exit:
stopLoss: { atr: { period: 14, multiplier: 1.5 } }
rewardRiskRatio: 2
squareOffAt: "15:15"
risk:
riskPerTradePercent: 0.5
maximumDailyLossPercent: 1.5
maximumOpenPositions: 1
execution:
orderType: LIMIT
productType: INTRADAY
backtest:
slippageBps: 5
brokeragePerOrder: 20
startingCapital: 100000
tickSize: 0.05
allowSyntheticData: false

Only EMA close-price crossovers and ATR stops are currently accepted. Malformed or unknown condition trees fail validation; the engine never falls back to hidden 20/50 defaults.

Index and stock futures use explicit NFO/BFO contract metadata. The runtime selects the current or next contract using the configured exchange-holiday calendar and rollover window; an order for any other contract fails before broker access.

schemaVersion: 2
name: nifty-futures-ema
universe:
assetClass: futures
instruments: [NFO:NIFTY26JULFUT]
futures:
underlying: NIFTY
kind: index # index or stock
selection: current # current or next
rolloverTradingDays: 2
holidays: ["2026-08-26"]
contracts:
- instrument: NFO:NIFTY26JULFUT
expiry: "2026-07-30"
lotSize: 65
tickSize: 0.05
freezeQuantity: 1800
marginRatePercent: 12.5
- instrument: NFO:NIFTY26AUGFUT
expiry: "2026-08-27"
lotSize: 65
tickSize: 0.05
freezeQuantity: 1800
marginRatePercent: 12.5
# timeframe, entry, exit, risk, and backtest follow the V1 shape
execution:
orderType: LIMIT
productType: CARRYFORWARD

Contract specifications are time-sensitive exchange data. Update expiry, lot, tick, freeze, holiday, and margin inputs from the broker/exchange before accepting a version; Jorli deliberately does not guess them.

allowSyntheticData is for demos and regression fixtures. Leave it false for any report used to make a trading decision.

Any edit creates a new version and the new version has no inherited approval. Strategy IDs include the version, for example infy-ema-crossover-v3.