India QuantLab
Try an idea. See what the data says.
Build a strategy, test it on historical prices, and inspect what actually happened.
First run: a synthetic demo series is loaded automatically. Fetch a ticker or upload CSV for your own research, choose a built-in strategy, then run the test. Nothing here places live trades.
Build a backtest
Advanced execution & risk controls Position sizing, trailing stops, borrow costs and annualisation
Backtest execution
Ready to process historical bars.
Market structure
Equity curve
Drawdown profile
Return characteristics
Trade history
| SYMBOL | ENTRY DATE | EXIT DATE | SIDE | LEGS | ENTRY | EXIT | RETURN | P&L | EXIT REASON |
|---|---|---|---|---|---|---|---|---|---|
| Run a backtest to populate the execution ledger. | |||||||||
Market data
Indian equity data only. Browse the Nifty 100 universe, fetch historical OHLCV bars, or upload an NSE dataset.
Provider connectivity
Yahoo Finance historical chart data for NSE-listed companies (.NS symbols) · browser CORS relay.
If a provider blocks browser requests, use the Python data service locally or upload a CSV. No source guarantees every ticker or date range.
CSV schema
Required columns: Date, Open, High, Low and Close. Volume and Adjusted Close are optional. You can add any number of numeric feature columns such as Sentiment, PE, RevenueGrowth or NiftyReturn. Reference them in formulas with an x_ prefix.
Date,Open,High,Low,Close,Volume,Sentiment,PE 2024-01-01,100,105,99,103,120000,0.72,24.5 2024-01-02,103,108,102,107,150000,0.81,24.1
Column names are case-insensitive. Date rows are sorted; duplicates and impossible OHLC prices are rejected.
Loaded observations
Build and test strategies
Use the visual builder for quick ideas, or write formulas for more involved rules. Change the logic, rerun it, and compare the results.
Build a strategy your way
Start with visual rules. Switch to formulas when you need more control. Your tests run on the same historical engine.
Entry conditions
What needs to happen before you enter?
Exit conditions
What tells you to close the position?
Short entry conditions
Separate rules for opening a short position.
Cover conditions
What tells you to buy back the short?
Your own calculationsDefine up to ten reusable indicators and reference them as v1–v10 in any formula.10 slots
Each calculation can use price, volume, built-in indicators, strategy parameters, time-series helpers and extra CSV columns. You can reference another v-slot; circular references are detected before running.
v1 = EMA(20) - EMA(50), then write v1 > 0 && RSI(14) > 50 in your entry formula.Formula reference Fields, indicators, position data, candle patterns and time-series functions
close > SMA(p1) && RSI(p2) > p3 && ADX(14) > 20Test combinations of p1–p10 on the loaded data. A maximum of 120 combinations is allowed per run. Keep fixed values for parameters you do not want to sweep.
Entry: Close crosses above SMA(20). Exit: Close crosses below SMA(20).
See what your strategy would trigger
Preview entry and exit signals against the loaded historical bars before running the full simulation.
Try the same strategy on other symbols
Run separate historical tests across multiple tickers. This checks whether your idea depends on one stock; it does not combine them into a portfolio.
Test the strategy across a basket
Run the same strategy independently on each symbol, then combine their equity curves into one portfolio. Leave weights blank for equal allocation.
Out-of-sample discipline
Split observations chronologically. Fit or select parameters only on the training window; report the untouched test window separately. Walk-forward evaluation reruns the strategy on rolling windows. Historical optimisation can overfit noise and does not establish future profitability.
Backtest results
Results are calculated from the latest completed simulation in this browser session.
Metric definitions
CAGR — annualised geometric growth from start to end equity.
Sharpe — mean periodic excess return divided by periodic standard deviation, annualised by √252 (daily), √52 (weekly) or √12 (monthly).
Sortino — mean periodic return divided by downside deviation, annualised using the same frequency factor.
Maximum drawdown — minimum of equity / prior running peak − 1.
Profit factor — gross positive trade P&L divided by absolute gross negative trade P&L.
Execution convention — signals use completed bar data; orders execute at the next bar open. Stops/targets are checked on subsequent bars, with conservative stop-first handling when both are touched.
Research notes
Plain-language notes based on the metrics and trades from your latest simulation. Built-in analysis works without an API key.
Optional LLM integration
For generative explanations, configure Gemini or another provider in the Python backend. Never expose an API key in this static website — browser code is public to every visitor.