Nifty Edge Backtester

v1.0.0

Strategy Config

Consecutive daily closes below EMA to trigger exit

Ready to Backtest

Configure parameters and run the simulation

Data & Process

Source: The system downloads daily NSE Bhavcopy files (ZIP format) containing snapshot data for all NIFTY Options.

Storage (SQLite): We parse these files and store strictly the NIFTY 50 Options data into a local SQLite database. This allows for fast querying of historical option prices for backtesting without needing to re-download massive files.

Logic Flow:
  1. Scanning: The bot checks Daily/Weekly/Monthly indicators for NIFTY 50 Spot.
  2. Signal: If RSI, ADX, and EMA conditions match a trend, a signal is generated.
  3. Selection: It queries the SQLite DB to find option strikes with the specific Delta you configured.
  4. Execution: It simulates buying/selling those options and tracks PnL until exit conditions are met.

Key Definitions

RSI (Relative Strength Index)

Measures the speed and magnitude of recent price changes to evaluate overbought or oversold conditions. (Range: 0-100).

ADX (Avg Directional Index)

Quantifies trend strength regardless of direction. High ADX (>25) indicates a strong trend; low ADX indicates range-bound markets.

EMA (Exponential Moving Avg)

A weighted average that gives more importance to recent price data. Used here to determine the primary trend direction.

Delta (Δ)

How much an option's price changes for a 1 point move in NIFTY.
0.50 Delta = Option moves 0.50 for every 1.00 NIFTY move.

CE (Call) / PE (Put)

CE (Call Option): Profit if NIFTY goes UP.
PE (Put Option): Profit if NIFTY goes DOWN.