How to Backtest Your ICT Strategy Using AI Without Coding

How to backtest your ICT/Smart Money strategy using Claude or ChatGPT without any coding. A step-by-step workflow covering setup definition, data preparation, prompt templates, and confluence scoring.

Backtesting an ICT strategy manually is painful. You scroll through thousands of candles looking for Order Block formations, Fair Value Gaps, and liquidity sweeps, mark them up, then try to remember whether price actually reacted or not. It takes hours to cover a single month of data. And when you’re done, you have a spreadsheet that may or may not reflect what actually happened.

AI tools have changed this. You can now describe your ICT setup criteria in plain language, feed in historical price data, and have an AI help you identify, categorise, and analyse hundreds of setups in a fraction of the time. No coding required. This guide shows you exactly how to do it using Claude or ChatGPT as your analytical partner.

What AI Can and Cannot Do for ICT Backtesting

Start with honest expectations. AI language models cannot connect directly to live charts or execute platform-based backtests. What they can do is far more useful for discretionary ICT traders: they can analyse structured data you provide, apply your defined rules, identify patterns, and help you score setups objectively.

The workflow replaces two things that kill most manual backtests: inconsistency in how you identify setups, and the confirmation bias that makes you remember your winners more vividly than your losers. When you describe your rules to an AI and ask it to apply them to data, it applies them the same way every time.

What AI handles well in this workflow:

  • Checking whether a setup meets your stated criteria (given price data you provide)
  • Scoring setup quality on a 1-10 scale against your criteria
  • Identifying which confluence factors were present vs absent
  • Aggregating win rates, average R, and expectancy from your trade log
  • Spotting patterns in when your strategy underperforms

What AI cannot do: read live charts, connect to TradingView directly, or replace the visual pattern recognition you develop through screen time. Think of it as your analytical co-pilot, not your automated system.

Step 1: Define Your ICT Setup in Plain Language

AI backtest workflow diagram showing 5-step process from setup definition to output analysis, plus 7-point ICT confluence scoring model
The 5-step AI backtest workflow for ICT traders, with the 7-point confluence scoring model — target 7+ for A-grade setups only.

This is the most important step and the one most traders skip. Before you can backtest anything, you need a written definition of your setup that is specific enough that someone else could apply it to data and get the same answer you would.

Vague definition (useless for backtesting): “I buy at Order Blocks when price looks good.”

Specific definition (backtestable): “Long entry: price sweeps a prior session low (liquidity grab), retraces into a 15-minute bullish Order Block formed within the last 4 hours, the OB is within the 0.5-0.786 Fibonacci retracement of the prior swing, and the Daily bias is bullish. Entry on first 15M candle close inside the OB. Stop below the OB low. Target at nearest buy-side liquidity.”

Write this definition before you open any AI tool. The quality of your backtest output is entirely dependent on the quality of your setup definition. If you cannot describe your entry criteria in 5-7 specific rules, you do not have a strategy yet. You have a feeling.

Step 2: Build Your Data Set

You need historical OHLC data in a format the AI can read. The simplest approach is a CSV file from TradingView:

On TradingView: open your chart, go to the Pine Script editor, and use a data download script to export OHLC data for your instrument and timeframe. Alternatively, use TradingView’s built-in data export for premium accounts. Export 3-6 months of 15-minute or 1-hour data for the instrument you primarily trade.

For Gold (XAU/USD): 6 months of 1H data gives you roughly 1,100 candles, which is a meaningful sample. For NQ or ES: the same period on the 15M gives around 3,000 candles across regular trading hours.

Your CSV should include at minimum: date, time, open, high, low, close, volume. Keep the file under 500KB for smooth AI processing. If your dataset is larger, split it into monthly segments.

Step 3: The AI Prompt Framework

Here is the exact prompt structure that gets useful backtest output from Claude or ChatGPT. Copy this, fill in your strategy rules, and paste it with your data attached:

BACKTEST PROMPT TEMPLATE:

I am a discretionary ICT/Smart Money trader. I want you to analyse the attached price data and identify all instances where my setup criteria were met. For each instance, record whether price reached my target (1R minimum) or hit my stop loss first.

MY SETUP CRITERIA (all conditions must be met):

1. [Your HTF bias condition — e.g. “Daily candle is bullish — close above prior day’s midpoint”]

2. [Your structure condition — e.g. “Price has swept a prior session low on the 1H chart”]

3. [Your entry trigger — e.g. “Price retraces into a 15M bullish Order Block within 4 hours of the sweep”]

4. [Your confluence condition — e.g. “Entry zone is within the 0.5-0.786 Fibonacci of the prior swing”]

5. [Any exclusion rule — e.g. “No entry within 30 minutes of a major news event”]

ENTRY: First 15M candle that closes inside the OB zone

STOP: Below the OB low (plus 1 pip buffer)

TARGET: Next buy-side liquidity level (at minimum 1:2 R:R)

For each setup found, provide: date/time, entry price, stop price, target price, R:R ratio, outcome (win/loss), and which criteria were present.

At the end, summarise: total setups, win rate, average R on winners, average loss on losers, expectancy per trade, and best/worst performing time of day.

The output you get will not be perfect. The AI will occasionally misidentify setups or miss nuances that require visual chart reading. But it will be consistent, and consistency is what a backtest needs. Review 10-15 of the identified setups manually to validate the AI is applying your criteria correctly before trusting the aggregate statistics.

Step 4: Scoring Setup Quality

One of the most powerful uses of AI in backtesting is setup quality scoring. Instead of treating all setups as equal, you score each one from 1-10 based on how many confluence factors were present, then analyse whether high-scoring setups outperform low-scoring ones.

A simple scoring model for an ICT long setup:

Confluence Factor Points
Daily bias aligned (bullish above prior day close) 2
Liquidity sweep of prior session low confirmed 2
Entry OB within Golden Pocket (0.618-0.702 Fib) 2
Fair Value Gap present within or below OB 1
London or New York Kill Zone timing 1
Volume Profile POC or VAL aligned at entry zone 1
R:R minimum 1:2 available to target 1

Ask the AI to score every identified setup using this framework. Then filter your results: only look at setups scoring 7+. Most discretionary ICT traders find that their win rate on high-confluence setups is substantially higher than their overall win rate. The difference between a 45% overall win rate and a 65% win rate on 7+ setups is the difference between breakeven and consistent profitability.

Step 5: Analysing Your Output

Once you have a scored backtest log (even 50-100 setups is a meaningful start), ask the AI to help you analyse it. Useful follow-up prompts:

“Based on this trade log, at what setup score does my win rate drop below 50%?” This identifies your minimum viable setup quality threshold.

“Which day of the week shows the lowest win rate?” If Mondays consistently underperform, that’s a session to sit out or size down.

“What is my average Maximum Adverse Excursion before price reverses toward my target on winning trades?” This helps you identify whether your stops are too tight, causing premature exits on setups that ultimately worked.

“Show me the 5 largest losing trades. What confluence factors were missing in each?” Pattern recognition on your worst trades is more valuable than celebrating your best ones.

Building a Forward Testing Log with AI Assistance

Backtesting shows you whether a strategy worked historically. Forward testing shows you whether you can execute it in real time. The AI workflow extends naturally into your live trading journal.

Before every trade, grade your setup using the confluence scoring model above. Log the score alongside the entry. After the trade, ask the AI to compare your forward test scores against your backtest benchmarks. If your live trading win rate on 7+ setups is significantly lower than the backtest, the issue is execution quality, not strategy quality. If your scores are high but results are poor, the strategy needs review.

This closes the feedback loop that most discretionary traders never close. Chapter 65 of The Complete Trader’s Edge covers the full journaling framework that makes this process systematic.

Frequently Asked Questions

Do I need coding skills to backtest an ICT strategy with AI?

No. The workflow described here uses plain-language prompts and CSV data. You describe your setup rules in plain English, provide historical OHLC data in a spreadsheet format, and the AI analyses it for you. No Python, no Pine Script, no programming knowledge required. The only technical step is exporting OHLC data from TradingView, which takes about two minutes once you know where to look.

How many trades do I need for a valid ICT backtest?

A minimum of 50-100 completed setups gives you statistically meaningful win rate data. At fewer than 50 trades, random variance can distort the results significantly. Aim for 100+ setups across at least 3-6 months of data, ideally covering different market conditions: trending, ranging, high volatility, and low volatility periods. This reduces the risk of over-fitting your strategy to one specific market environment.

Can AI identify Order Blocks and Fair Value Gaps automatically?

AI language models cannot read charts visually. They can, however, identify Order Block and FVG criteria from structured OHLC data if you define the criteria precisely. For example: “A bullish Order Block is the last bearish candle before a displacement move upward where the close of the bearish candle is higher than the open of the impulse candle.” Given this definition and OHLC data, the AI can identify qualifying candles. The accuracy depends on how precisely you define the criteria.

How is AI backtesting different from platform-based backtesting?

Platform-based backtesting (TradingView strategy tester, MetaTrader) runs automated rule-based systems on historical data. It works well for mechanical strategies with clear entry/exit rules that can be coded. AI backtesting is better suited to discretionary ICT strategies where the entry criteria involve context (HTF bias, session timing, multi-timeframe confluence) that is harder to code. AI gives you a human-language interface to apply complex, context-dependent rules to historical data without writing code.

What is the best AI tool for backtesting ICT strategies?

Claude (Anthropic) handles large data files and complex analytical tasks particularly well. ChatGPT-4 is a strong alternative. For the workflow described here, either tool works effectively. The key variable is the quality of your setup definition and your prompt structure, not the specific AI tool. Start with whatever you already have access to, and refine your prompt based on the output quality you get.

The Complete Trader’s Edge

Chapters 28-31 cover Order Blocks, FVGs, and liquidity sweeps in full detail, with entry criteria and confluence scoring frameworks you can adapt directly to this AI backtesting workflow.

Get the Book →

LvR
Written by
Louw van Riet
Author · Trader · Coach

Louw is the author of The Complete Trader's Edge — a 70-chapter trading framework covering psychology, technical analysis, ICT concepts, and professional risk management. He has spent years studying institutional price action across forex, indices, and crypto, and built this platform to provide the complete, honest trading education he wished existed when he started.

Free Trading Plan Template

Get Your Complete Trading Plan

Subscribe and get the 8-page Trading Plan Template free — includes pre-session checklist, trade journal, risk rules, and weekly review system. Plus weekly insights on psychology, strategy, and risk management.

No spam. Unsubscribe anytime. Free forever.