[2026-07-21 01:04:32] Delta Trading Strategy script execution started.
[2026-07-21 01:04:32] Fetching instruments data from Kite API...
[2026-07-21 01:04:32] Kite API Response HTTP Code: 200
[2026-07-21 01:04:33] ✅ Loaded 10106 NSE equity/ETF/futures and MCX INDICES/MCX-FUT symbols from 122355 total instruments via Kite API

Delta Trading Strategy Backtest Engine

This strategy uses EMA trend filters, RSI-based delta scaling, and ATR-based risk management.

Strategy Logic:

Modes:

Indicators: EMA(Short, Long), RSI(Period), ATR(Period) - All customizable via form parameters

Supported Markets: NSE Equity Stocks, ETFs, and Futures; MCX INDICES and MCX-FUT (via Zerodha Kite API)

This is your starting equity for the backtest. The strategy allocates amounts per signal from this equity and scales up to current equity when RSI > 60.
Max Amount is set dynamically to your current equity during backtest. The strategy scales from Base Amount up to available equity when RSI > 60.
Leverage multiplier for position sizing. 1x = no leverage (cash), 2x = 2x leverage, etc. Higher leverage increases position size and risk. Use with caution!
Scale position from base amount up to max equity % based on RSI momentum.
When EMA trend is still valid, keep base position during RSI 35–45 pullbacks instead of exiting. Reduces whipsaw on stocks like HDFCBANK.
Trail stop loss as price moves in your favor using ATR multiplier below.
Stop distance = ATR × multiplier. Try 2.5–3 for daily stocks to avoid premature stops.
Cap max scaled position size. 80% leaves room for costs and drawdowns.
Only enter when ADX ≥ threshold (skips sideways/choppy markets).
Force exit when RSI drops below this even if trend is intact (default: 35).
Execution impact in basis points (1 bps = 0.01%). Applied on fill price to simulate market order slippage.
Brokerage + statutory charges in basis points per trade. Deducted on both entry and exit.

📊 Technical Indicator Parameters

Short-term EMA for trend detection (default: 50). Avoid 5/50 on daily — causes excessive whipsaw.
Long-term EMA trend filter (default: 200 for daily stocks).
RSI calculation period for momentum scaling (default: 14)
ATR calculation period for stop loss calculation (default: 14)
[2026-07-21 01:04:33] Results display completed successfully. [2026-07-21 01:04:33] Delta Trading Strategy script execution finished.