How to Backtest a Discretionary Trading Strategy with AI
Preview the coming-soon workflow for describing a discretionary strategy, filtering historical candles, checking AI workload, and reviewing replay results responsibly.

AlgoVistra product screenshot with sample workspace data; it is not verified trading performance.
A discretionary strategy can be testable without becoming completely mechanical. The key is to separate what a computer can filter cheaply from what still requires contextual judgment.
This guide shows how to prepare an AI-assisted historical replay without hiding ambiguity, overwhelming the model, or treating a gross simulated return as a promise.
Coming soon: The AlgoVistra workflow described below is not available yet. AI Strategy Replay will let traders describe a discretionary strategy in plain language, replay it through past candles, and inspect which setups the AI would accept or skip.
1. Write the Strategy as a Decision Process
Avoid a vague instruction such as “trade good SMC setups.” Write what the trader should observe, what must be true, what invalidates the idea, and when the setup should be skipped.
A useful description might say:
Look for long entries after price sweeps a recent low and closes back above a valid demand area. The selected higher timeframe must remain bullish. Skip the trade if the stop cannot sit below clear structural invalidation or if the available target is less than 2R.
This still allows judgment, but it gives that judgment boundaries.
Include:
- Intended direction: long, short, or both
- Setup and confirmation
- Market context that matters
- Invalidation logic
- Minimum reward-to-risk expectation
- Conditions that force a skip
2. Choose a Focused Historical Window
Select an exact start and end date instead of relying on labels such as “last month.” Exact dates make two periods directly comparable and keep the research reproducible.
The practical limit should depend on candle count, not calendar length. One month of five-minute candles is far more work than one month of four-hour candles. Start with a narrow sample, learn from it, then test a different period.
Also choose the execution timeframe explicitly. A strategy evaluated on 5m candles should not silently become a 15m strategy because the platform was designed around one existing pipeline.
3. Separate Mandatory Rules from Confluence
Use required filters for conditions that must never be violated. If the strategy is long only, direction is required. If it only operates near a zone, proximity is required.
Use score filters for evidence that strengthens a setup without being individually essential. For example:
| Supporting condition | Score |
|---|---|
| Trend bias agrees | +1 |
| EMA alignment agrees | +1 |
| Session is preferred | +1 |
| Momentum confirms | +1 |
A threshold of three means any three of the four can qualify. Equal weights keep the first version understandable and prevent a complex scoring model from hiding weak assumptions.
If a filter uses higher-timeframe alignment, select the exact timeframe for that filter. “HTF” should not automatically mean every timeframe above execution must agree.
4. Control the Context Sent to AI
More context is not always better context.
The execution-timeframe detail should always be present because that is where the decision occurs. A broad market overview provides orientation. Add detailed snapshots and evidence from extra timeframes only when the strategy genuinely uses them.
For example, a 5m execution strategy might include 1h structure evidence. It does not automatically need 15m, 4h, and daily detail as well.
This context selection is separate from filter configuration. A 1h alignment filter answers whether a candle qualifies. Including the 1h snapshot gives AI evidence for its final judgment.
5. Run Verify Path
Before the full AI Strategy Replay, scan the candle range without AI calls.
Review:
- Candidate candles versus total candles
- Which required filter rejects the most candidates
- Which score conditions match most often
- How scores are distributed
- Estimated number of AI decisions
- Estimated capacity and runtime
If thousands of five-minute candles still reach AI, the path is probably too broad. If no candle qualifies, inspect whether two filters express the same rule or whether the score threshold is unrealistic.
Verification does not prove the strategy works. It proves that the requested replay is computationally and logically reasonable enough to run.
6. Keep Trade Simulation Simple
A useful first version needs fewer moving pieces, not more.
Use one open simulated trade at a time. Fix entry at the decision candle close. Require a stop loss. Let take profit be an exact price or a reward-to-risk value such as 2R. After entry, deterministic candle logic can decide whether stop or target is reached.
The AI should not use external tools, hidden memory, or later candles while making the decision. The saved decision log should explain what the model saw and returned, while the trade record remains a separate, queryable result.
7. Review More Than Profit
Gross return is only one outcome. Ask:
- How often did the AI enter versus skip?
- Which filter removed the most noise?
- Did trades cluster in one session or market regime?
- Were stop placements consistent with the stated invalidation?
- Did the same wording produce coherent decisions across time?
- Which losses reveal a missing rule?
Compare different historical windows rather than tuning the strategy repeatedly on one period. If you change the strategy, filters, prompt version, context timeframes, or model tier, treat it as a new experiment.
8. Read Gross Results Honestly
An early replay may show realized pips or points and gross price-return percentage. Spread, slippage, commission, fees, and swap can materially change real outcomes, especially on lower timeframes or frequently traded strategies.
Do not mentally convert gross replay profit into expected account profit. The result is a research signal about the strategy definition and decision process—not a live performance forecast.
The Practical Standard
A good AI-assisted backtest should be:
- Chronological, with no future information in the decision
- Selective enough to avoid an AI call on every candle
- Explicit about model and prompt versions
- Clear about assumptions and omitted costs
- Repeatable enough to compare periods
- Simple enough that a trader can audit why a trade exists
That standard makes AI useful where human-like context matters while preserving the discipline that historical testing requires.
Read What Is AI Strategy Replay? for the product concept, then compare paid plans and available AI tiers.
Minimum evidence for a replay result
Publish no headline metric without the market and venue, timeframe, date range, sample count, versioned rule text, inclusion and exclusion logic, spread and fee assumptions, slippage model, treatment of overlapping trades, ambiguous-case count, and an untouched validation period. Save the input data hash or immutable file reference so the run can be reproduced.
The CFA Institute backtesting overview covers look-ahead bias, survivorship bias, rolling tests, and structural breaks. Its guide to trading costs and electronic markets explains spread- and execution-based cost measurement. The SEC's hypothetical-performance discussion reinforces that criteria, assumptions, risks, and limitations must accompany a backtest. The NFA's interpretive notice on hypothetical performance likewise warns that hypothetical results do not represent actual trading and are designed with hindsight, which may under- or over-compensate for lack of liquidity and price slippage.
This article explains that protocol. It does not claim that AlgoVistra has completed or independently verified a profitable strategy test.
Disclaimer: Historical and AI-generated results are for educational and research purposes only. They are not financial advice, do not include every real trading cost, and do not guarantee future performance.
AI Strategy Replay
Coming soonAI Strategy Replay is coming soon. It will let you describe a discretionary strategy in plain language, filter historical candles by your rules, and use AI to simulate decisions on the setups that qualify. Plus will include Low, Medium, High; Pro will also include Max.
What Is AI Strategy Replay? Backtesting for Discretionary Traders
A clear preview of how AI Strategy Replay will filter historical candles, verify the path, and review discretionary trade decisions.
July 20, 2026GuideRisk Management for AI-Assisted Traders
Risk management principles for traders who use AI assistants: position sizing, stop placement, and how to keep human judgment in the loop.
June 7, 2026GuideFrom Demo to Live: Using AI Analysis to Practice Without Risking Capital
A practical workflow for using an AI trading assistant to practice analysis, build a process, and transition from demo to live trading.
June 10, 2026