Live market data unavailable
GuideJuly 19, 2026 · 6 min read

How to Backtest a Discretionary Trading Strategy with AI

A practical workflow for describing a discretionary strategy, filtering historical candles, checking AI workload, and reviewing replay results responsibly.

AV

AlgoVistra Team

Market Analysis & AI Research

Share

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.

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 conditionScore
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.

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.

Ready to Trade Smarter?

Get 10 free AI-powered market analyses per day. No credit card required.

Start Free