Test an idea in plain English
Describe a setup or ask a data question. The assistant turns it into exact rules, writes the backtest, runs it on every NIFTY 50 stock and reports what happened after costs, with the code it ran.
- Universe
- NIFTY 50 constituents
- Period
- Jan 2016 – Aug 2026
- Resolution
- 1-minute bars
- Costs
- Brokerage, taxes, slippage
Example prompts
How it works
- 01Exact rules
Your idea is turned into precise entry, exit and sizing rules, with every assumption stated.
- 02Code written
The assistant writes a backtest against the open dpx_bt engine.
- 03Run in a sandbox
It runs on the full minute history, with variants and a random-pick benchmark.
- 04Report after costs
A plain verdict, the numbers by period, warnings and the code it ran.
What you get back
A real run, start to finish. Ask returns a plain-English verdict, a full report, insights, every trade and the code.
Does trading the 15-minute opening range breakout on NIFTY 50 stocks with a 1% stop and a 2% target make money?
Verdict: no. Over 120,643 trades from January 2016 to August 2026 this setup lost ₹2.49 crore after costs at ₹5 lakh per trade, and it lost money in all three periods (2016–20, 2021–23 and 2024–26).
- Before costs the average trade made only +2.4 bps; a round trip costs about 6.5 bps.
- Win rate 43.6%, profit factor 0.91. 11,833 trades hit the 2% target, 38,681 hit the 1% stop and 70,129 were closed at 15:15.
- With 3 extra bps of slippage per fill the loss grows to ₹6.10 crore.
- Random benchmark: random NIFTY 50 stocks traded at the same minutes in the same direction averaged 2.84 bps before costs; this strategy beat 3.5% of 200 random runs.
- The least bad entry hour was 12:00 (-0.9 bps per trade after costs), still negative.
Assumptions: 5-minute bars; range = 09:15–09:30; entry at the next bar's open after the first 5-minute close beyond the range; one trade per stock per day; entries 09:30–14:30; everything closed at 15:15; stop and target measured from the fill price. Variants run: 1.
- Edge smaller than costs: 2.37 bps gross vs ~6.5 bps of costs per trade.
| Period | Trades | Gross / trade | Win % | Net | +3 bps | Max drawdown |
|---|---|---|---|---|---|---|
| 2016-20 | 56,508 | 3.2 bps | 43.0% | −₹93.9 L | −₹2.63 Cr | −₹1.02 Cr |
| 2021-23 | 33,811 | 1.9 bps | 44.2% | −₹78.0 L | −₹1.79 Cr | −₹79.3 L |
| 2024-26 | 30,324 | 1.4 bps | 44.1% | −₹76.6 L | −₹1.67 Cr | −₹80.2 L |
Capital needed ~₹3.04 Cr (20% intraday margin on the busiest day's positions plus the worst drawdown): −7.7% a year, −18.8% with +3 bps.
38,681 trades (32%) hit the 1% stop, losing −₹20.66 Cr in total. Only 11,833 reached the 2% target. Trades still open at 15:15 actually averaged 19.2 bps after costs.
Entries at 12:00 did best (−0.9 bps per trade) and 09:00 worst (−5.7 bps). No hour is profitable after costs.
Longs averaged −7.2 bps and shorts −1.4 bps per trade after costs. Shorts lose less, but neither is profitable, so dropping one side doesn't rescue it.
Random NIFTY 50 stocks at the same minutes made 2.8 bps before costs, more than the strategy's 2.4 bps: it beat only 3.5% of 200 random runs.
| Worst stocks | Trades | Net | Per trade |
|---|---|---|---|
| CIPLA | 2,439 | −₹12.4 L | −10.2 bps |
| HCLTECH | 2,380 | −₹12.4 L | −10.4 bps |
| GRASIM | 2,315 | −₹11.1 L | −9.6 bps |
| ASIANPAINT | 2,419 | −₹11.0 L | −9.1 bps |
| BAJAJ-AUTO | 2,413 | −₹10.9 L | −9.1 bps |
| Best stocks | Trades | Net | Per trade |
|---|---|---|---|
| TMPV | 2,448 | ₹3.1 L | 2.6 bps |
| MARUTI | 2,451 | ₹3.1 L | 2.6 bps |
| YESBANK | 974 | ₹2.9 L | 6.0 bps |
| IDEA | 280 | ₹2.8 L | 20.3 bps |
| AUROPHARMA | 460 | ₹2.3 L | 10.2 bps |
Best and worst stocks are shown for context only. Picking them after the fact is exactly the kind of hindsight a backtest should not reward.
| Date | Stock | Side | In → out | Exit | Net |
|---|---|---|---|---|---|
| 2026-08-31 | NTPC | Short | 14:10→15:05 | Stop | −₹5,325 |
| 2026-08-31 | JIOFIN | Long | 13:25→15:10 | Closed at 15:15 | −₹1,792 |
| 2026-08-31 | MAXHEALTH | Long | 13:05→15:10 | Closed at 15:15 | −₹1,406 |
| 2026-08-31 | ADANIPORTS | Short | 13:00→15:10 | Closed at 15:15 | ₹6,238 |
| 2026-08-31 | BEL | Long | 12:40→15:10 | Closed at 15:15 | ₹1,131 |
| 2026-08-31 | M&M | Long | 12:05→15:10 | Closed at 15:15 | ₹1,822 |
| 2026-08-31 | HDFCBANK | Short | 12:00→14:20 | Target | ₹9,664 |
| 2026-08-31 | AXISBANK | Long | 11:50→15:10 | Closed at 15:15 | ₹269 |
| 2026-08-31 | TRENT | Short | 11:45→12:15 | Stop | −₹5,315 |
| 2026-08-31 | GRASIM | Long | 11:40→15:10 | Closed at 15:15 | ₹4,115 |
| 2026-08-31 | SUNPHARMA | Short | 11:30→12:40 | Stop | −₹5,321 |
| 2026-08-31 | RELIANCE | Long | 11:25→15:10 | Closed at 15:15 | ₹6,147 |
| 2026-08-31 | TECHM | Short | 11:05→15:10 | Closed at 15:15 | −₹3,600 |
| 2026-08-31 | ONGC | Short | 11:00→15:10 | Closed at 15:15 | −₹324 |
| 2026-08-31 | LT | Short | 10:55→15:10 | Closed at 15:15 | −₹4,700 |
| 2026-08-31 | ULTRACEMCO | Short | 10:40→15:10 | Closed at 15:15 | −₹2,470 |
| 2026-08-31 | CIPLA | Long | 10:35→15:10 | Closed at 15:15 | −₹2,500 |
| 2026-08-31 | NESTLEIND | Long | 10:30→15:10 | Closed at 15:15 | ₹2,194 |
| 2026-08-31 | MARUTI | Short | 10:25→12:50 | Stop | −₹5,248 |
| 2026-08-31 | BAJFINANCE | Short | 10:15→15:10 | Closed at 15:15 | −₹3,299 |
| 2026-08-31 | SBIN | Short | 10:15→14:45 | Stop | −₹5,319 |
| 2026-08-31 | APOLLOHOSP | Long | 10:10→15:10 | Closed at 15:15 | −₹1,498 |
| 2026-08-31 | ITC | Short | 10:05→15:10 | Closed at 15:15 | ₹2,698 |
| 2026-08-31 | BAJAJFINSV | Short | 09:50→14:45 | Stop | −₹5,316 |
| 2026-08-31 | ICICIBANK | Short | 09:50→12:50 | Stop | −₹5,317 |
| 2026-08-31 | BHARTIARTL | Long | 09:50→15:00 | Stop | −₹5,309 |
| 2026-08-31 | HINDUNILVR | Short | 09:45→15:10 | Closed at 15:15 | −₹4,517 |
| 2026-08-31 | TATACONSUM | Short | 09:45→13:10 | Stop | −₹5,324 |
| 2026-08-31 | TMPV | Short | 09:45→12:30 | Stop | −₹5,323 |
| 2026-08-31 | ADANIENT | Short | 09:45→12:55 | Target | ₹9,669 |
| 2026-08-31 | EICHERMOT | Short | 09:45→15:10 | Closed at 15:15 | −₹42 |
| 2026-08-31 | TATASTEEL | Short | 09:40→15:10 | Closed at 15:15 | ₹88 |
| 2026-08-31 | ETERNAL | Short | 09:40→11:50 | Stop | −₹5,322 |
| 2026-08-31 | INFY | Short | 09:35→14:40 | Stop | −₹5,314 |
| 2026-08-31 | SHRIRAMFIN | Short | 09:35→11:55 | Stop | −₹5,315 |
| 2026-08-31 | TCS | Short | 09:35→15:10 | Closed at 15:15 | −₹3,695 |
| 2026-08-31 | TITAN | Short | 09:35→15:10 | Closed at 15:15 | −₹4,451 |
| 2026-08-31 | COALINDIA | Long | 09:35→12:20 | Stop | −₹5,322 |
| 2026-08-31 | WIPRO | Short | 09:35→15:00 | Stop | −₹5,324 |
| 2026-08-28 | SUNPHARMA | Long | 13:25→15:10 | Closed at 15:15 | −₹479 |
| 2026-08-28 | DRREDDY | Long | 13:15→14:00 | Stop | −₹5,313 |
| 2026-08-28 | INDIGO | Short | 12:05→15:10 | Closed at 15:15 | −₹3,622 |
| 2026-08-28 | ADANIPORTS | Short | 12:00→15:10 | Closed at 15:15 | −₹529 |
| 2026-08-28 | TITAN | Short | 11:55→15:10 | Closed at 15:15 | −₹780 |
| 2026-08-28 | MARUTI | Short | 11:45→15:10 | Closed at 15:15 | ₹418 |
| 2026-08-28 | TATACONSUM | Short | 11:35→15:10 | Closed at 15:15 | −₹1,144 |
| 2026-08-28 | ITC | Short | 11:35→15:10 | Closed at 15:15 | ₹3,512 |
| 2026-08-28 | SBILIFE | Short | 11:35→15:10 | Closed at 15:15 | ₹1,267 |
| 2026-08-28 | ICICIBANK | Short | 11:30→15:10 | Closed at 15:15 | ₹901 |
| 2026-08-28 | RELIANCE | Short | 11:30→15:10 | Closed at 15:15 | ₹998 |
| 2026-08-28 | EICHERMOT | Short | 11:30→15:10 | Closed at 15:15 | ₹1,040 |
| 2026-08-28 | SHRIRAMFIN | Short | 11:30→15:10 | Closed at 15:15 | ₹1,966 |
| 2026-08-28 | TMPV | Short | 11:25→13:45 | Stop | −₹5,323 |
| 2026-08-28 | HDFCLIFE | Long | 11:15→12:50 | Stop | −₹5,320 |
| 2026-08-28 | BHARTIARTL | Short | 11:10→15:10 | Closed at 15:15 | −₹643 |
| 2026-08-28 | HINDALCO | Long | 11:10→15:10 | Closed at 15:15 | −₹591 |
| 2026-08-28 | TECHM | Long | 11:05→11:45 | Stop | −₹5,311 |
| 2026-08-28 | JIOFIN | Long | 10:55→15:10 | Closed at 15:15 | −₹2,102 |
| 2026-08-28 | LT | Short | 10:55→15:10 | Closed at 15:15 | ₹489 |
| 2026-08-28 | HDFCBANK | Long | 10:50→15:10 | Closed at 15:15 | ₹2,013 |
| 2026-08-28 | NESTLEIND | Short | 10:50→15:10 | Closed at 15:15 | −₹186 |
| 2026-08-28 | APOLLOHOSP | Long | 10:50→15:10 | Closed at 15:15 | ₹69 |
| 2026-08-28 | TATASTEEL | Short | 10:35→15:10 | Closed at 15:15 | ₹2,189 |
| 2026-08-28 | ASIANPAINT | Short | 10:20→15:10 | Closed at 15:15 | ₹5,187 |
| 2026-08-28 | NTPC | Long | 10:15→15:10 | Closed at 15:15 | −₹173 |
| 2026-08-28 | SBIN | Long | 10:15→15:10 | Closed at 15:15 | −₹990 |
| 2026-08-28 | CIPLA | Short | 10:05→15:10 | Closed at 15:15 | −₹2,937 |
| 2026-08-28 | AXISBANK | Long | 10:05→15:10 | Closed at 15:15 | ₹1,898 |
| 2026-08-28 | JSWSTEEL | Short | 09:50→15:10 | Closed at 15:15 | ₹1,405 |
| 2026-08-28 | TRENT | Long | 09:50→15:10 | Closed at 15:15 | ₹1,052 |
| 2026-08-28 | MAXHEALTH | Short | 09:50→10:50 | Stop | −₹5,321 |
| 2026-08-28 | M&M | Long | 09:45→11:35 | Stop | −₹5,309 |
| 2026-08-28 | BAJAJ-AUTO | Long | 09:45→15:10 | Closed at 15:15 | ₹767 |
| 2026-08-28 | BAJFINANCE | Long | 09:40→15:10 | Closed at 15:15 | −₹2,222 |
| 2026-08-28 | COALINDIA | Short | 09:40→10:10 | Stop | −₹5,322 |
| 2026-08-28 | ULTRACEMCO | Short | 09:40→15:10 | Closed at 15:15 | −₹323 |
| 2026-08-28 | WIPRO | Long | 09:35→15:10 | Closed at 15:15 | ₹3,226 |
| 2026-08-28 | INFY | Long | 09:35→15:10 | Closed at 15:15 | −₹1,591 |
| 2026-08-28 | ONGC | Short | 09:35→15:10 | Closed at 15:15 | −₹346 |
| 2026-08-28 | GRASIM | Short | 09:35→13:15 | Stop | −₹5,292 |
| 2026-08-28 | TCS | Long | 09:35→15:10 | Closed at 15:15 | ₹2,051 |
| 2026-08-28 | HCLTECH | Long | 09:35→14:20 | Stop | −₹5,321 |
| 2026-08-27 | JSWSTEEL | Short | 14:20→15:10 | Closed at 15:15 | −₹773 |
| 2026-08-27 | EICHERMOT | Long | 14:05→15:10 | Closed at 15:15 | ₹1,722 |
| 2026-08-27 | BAJAJFINSV | Short | 14:00→15:10 | Closed at 15:15 | −₹2,142 |
| 2026-08-27 | ICICIBANK | Long | 12:55→15:10 | Closed at 15:15 | ₹262 |
| 2026-08-27 | ADANIENT | Long | 12:50→15:10 | Closed at 15:15 | ₹71 |
| 2026-08-27 | GRASIM | Short | 12:25→15:10 | Closed at 15:15 | ₹908 |
| 2026-08-27 | ADANIPORTS | Long | 12:15→15:10 | Closed at 15:15 | −₹62 |
| 2026-08-27 | HDFCBANK | Short | 11:25→15:10 | Closed at 15:15 | ₹1,035 |
| 2026-08-27 | HDFCLIFE | Short | 10:55→15:10 | Closed at 15:15 | −₹1,276 |
| 2026-08-27 | BAJFINANCE | Short | 10:40→15:10 | Closed at 15:15 | ₹1,783 |
| 2026-08-27 | MAXHEALTH | Short | 10:35→15:10 | Closed at 15:15 | −₹2,018 |
| 2026-08-27 | INFY | Short | 10:30→15:10 | Closed at 15:15 | ₹1,831 |
| 2026-08-27 | AXISBANK | Long | 10:30→15:10 | Closed at 15:15 | −₹2,224 |
| 2026-08-27 | ITC | Short | 10:25→15:10 | Closed at 15:15 | ₹1,809 |
| 2026-08-27 | ONGC | Short | 10:20→15:10 | Closed at 15:15 | −₹88 |
| 2026-08-27 | M&M | Short | 10:10→15:10 | Closed at 15:15 | ₹5,123 |
| 2026-08-27 | TATACONSUM | Short | 10:05→15:10 | Closed at 15:15 | −₹758 |
| 2026-08-27 | ULTRACEMCO | Long | 10:05→12:20 | Stop | −₹5,275 |
| 2026-08-27 | SUNPHARMA | Short | 10:05→15:10 | Closed at 15:15 | −₹3,233 |
| 2026-08-27 | HINDALCO | Short | 09:55→13:40 | Target | ₹9,670 |
| 2026-08-27 | TITAN | Short | 09:55→11:40 | Stop | −₹5,303 |
| 2026-08-27 | TCS | Short | 09:55→15:10 | Closed at 15:15 | −₹876 |
| 2026-08-27 | POWERGRID | Short | 09:55→14:50 | Stop | −₹5,324 |
| 2026-08-27 | DRREDDY | Short | 09:50→15:10 | Closed at 15:15 | ₹142 |
| 2026-08-27 | ETERNAL | Short | 09:50→14:50 | Stop | −₹5,324 |
| 2026-08-27 | ASIANPAINT | Short | 09:50→15:10 | Closed at 15:15 | −₹1,495 |
| 2026-08-27 | APOLLOHOSP | Short | 09:45→15:10 | Closed at 15:15 | −₹2,700 |
| 2026-08-27 | HINDUNILVR | Short | 09:45→15:10 | Closed at 15:15 | ₹911 |
| 2026-08-27 | NESTLEIND | Short | 09:45→15:10 | Closed at 15:15 | −₹117 |
| 2026-08-27 | KOTAKBANK | Long | 09:45→15:10 | Closed at 15:15 | −₹1,030 |
| 2026-08-27 | CIPLA | Short | 09:40→14:45 | Stop | −₹5,324 |
| 2026-08-27 | BAJAJ-AUTO | Short | 09:40→15:10 | Closed at 15:15 | −₹2,797 |
| 2026-08-27 | JIOFIN | Short | 09:40→15:10 | Closed at 15:15 | ₹4,235 |
| 2026-08-27 | TRENT | Short | 09:40→15:10 | Closed at 15:15 | ₹4,141 |
| 2026-08-27 | TMPV | Short | 09:40→11:40 | Stop | −₹5,324 |
| 2026-08-27 | COALINDIA | Short | 09:40→15:10 | Closed at 15:15 | ₹3,154 |
| 2026-08-27 | SBIN | Short | 09:40→15:10 | Closed at 15:15 | −₹277 |
| 2026-08-27 | WIPRO | Short | 09:40→15:10 | Closed at 15:15 | −₹1,509 |
| 2026-08-27 | INDIGO | Short | 09:40→15:10 | Closed at 15:15 | ₹2,291 |
| 2026-08-27 | MARUTI | Short | 09:40→15:10 | Closed at 15:15 | −₹545 |
| 2026-08-27 | TATASTEEL | Long | 09:35→10:40 | Stop | −₹5,321 |
| 2026-08-27 | RELIANCE | Short | 09:35→15:10 | Closed at 15:15 | ₹4,630 |
| 2026-08-27 | HCLTECH | Short | 09:35→15:10 | Closed at 15:15 | ₹142 |
| 2026-08-27 | SHRIRAMFIN | Short | 09:35→15:10 | Closed at 15:15 | −₹596 |
| 2026-08-27 | BHARTIARTL | Short | 09:35→15:10 | Closed at 15:15 | ₹1,649 |
| 2026-08-27 | SBILIFE | Long | 09:35→15:10 | Closed at 15:15 | −₹156 |
| 2026-08-27 | BEL | Long | 09:35→15:10 | Closed at 15:15 | −₹3,111 |
| 2026-08-27 | NTPC | Short | 09:35→15:10 | Closed at 15:15 | ₹5,230 |
| 2026-08-26 | JSWSTEEL | Long | 14:25→15:10 | Closed at 15:15 | ₹2,262 |
| 2026-08-26 | COALINDIA | Long | 13:55→15:10 | Closed at 15:15 | −₹2,358 |
| 2026-08-26 | CIPLA | Short | 13:40→14:10 | Stop | −₹5,316 |
| 2026-08-26 | M&M | Short | 11:55→15:10 | Closed at 15:15 | ₹1,345 |
| 2026-08-26 | JIOFIN | Short | 11:20→15:10 | Closed at 15:15 | ₹2,245 |
| 2026-08-26 | AXISBANK | Long | 11:15→15:10 | Closed at 15:15 | ₹992 |
| 2026-08-26 | EICHERMOT | Long | 11:00→15:10 | Closed at 15:15 | −₹2,181 |
| 2026-08-26 | MAXHEALTH | Long | 10:45→15:10 | Closed at 15:15 | −₹1,696 |
| 2026-08-26 | WIPRO | Short | 10:45→15:10 | Closed at 15:15 | ₹5,938 |
| 2026-08-26 | HCLTECH | Short | 10:35→15:10 | Closed at 15:15 | ₹3,944 |
| 2026-08-26 | POWERGRID | Short | 10:30→15:10 | Closed at 15:15 | ₹4,600 |
| 2026-08-26 | INDIGO | Short | 10:25→15:10 | Closed at 15:15 | −₹2,461 |
| 2026-08-26 | TATACONSUM | Short | 10:20→15:10 | Closed at 15:15 | ₹1,671 |
| 2026-08-26 | MARUTI | Short | 10:20→15:10 | Closed at 15:15 | ₹3,749 |
| 2026-08-26 | HDFCBANK | Short | 10:15→15:10 | Closed at 15:15 | −₹1,769 |
| 2026-08-26 | BAJAJ-AUTO | Long | 10:15→11:50 | Stop | −₹5,205 |
| 2026-08-26 | TCS | Short | 10:10→15:10 | Closed at 15:15 | ₹4,254 |
| 2026-08-26 | NESTLEIND | Short | 10:05→15:10 | Closed at 15:15 | ₹3,120 |
| 2026-08-26 | ADANIPORTS | Short | 10:05→15:10 | Closed at 15:15 | ₹1,639 |
| 2026-08-26 | BAJAJFINSV | Long | 10:05→15:10 | Closed at 15:15 | −₹2,003 |
The latest 150 trades (to August 2026) of 1,20,643. Intraday charts are included for the latest 60.
The exact code Ask wrote and ran for this question, against dpx_bt:
import dpx_bt as bt
def strategy(p):
orh, orl = p.opening_range(15) # 09:15-09:30 high / low
long, short = p.close > orh, p.close < orl # a 5-minute close beyond the range
first = p.once_per_day(long | short) # one trade per stock per day
return bt.Signals(long=long & first, short=short & first, stop=0.01, target=0.02)Answers are generated by an AI model from backtests on historical data. They can contain mistakes: check the assumptions and the code shown with each run. Research and education only, not investment advice. Disclaimer.