Research library / Free AI prompt
Check a stock backtest with AI
Could your backtest see the future? Use this free prompt to check for look-ahead bias in a trading strategy. Try the example first or replace it with your own rule.
Run the starter backtest or browse the O2 signal idea board → · Try the fill-timing challenge
Copy the backtesting prompt
Paste it into the AI assistant you already use.
Review this stock backtest for look-ahead bias. Strategy rule (replace this example with yours): Buy at today’s closing price if today’s final close crosses above the 50-day moving average. Pick one decision and list each input, when it would actually have been available, and the earliest plausible time to place the order. Check the stock list, revised data, and whether the rule uses any outcome that was still in the future. If I give you code and historical data, freeze the rules and rerun through a cutoff using only inputs available by then. Compare earlier inputs, signals and position sizes with the full run. Show the first difference, or list exactly what matched. If you only have the rule, explain the likely timing problems and give me a test I can run. Label assumptions, identify missing evidence, and report only results from tests you actually ran.Open the plain-text prompt
What a good answer should catch
The example needs the final closing price to trigger a buy. If you learn the signal only once that price is set, the test can’t assume you had time to use it and get filled at the same close. Check the next eligible trading session and state your fill and cost assumptions.
Rerun the timing check when the data, eligible stock list or strategy rules change. For the method we use in Mount Inflection research, start with the paper’s sections on market data and validation. Read the research method