Feeding Real MT5 Data to ChatGPT and Claude: A Prompt Template That Actually Works

Feeding Real MT5 Data to ChatGPT and Claude: A Prompt Template That Actually Works

22 July 2026, 09:40
Cao Tai Le
0
27

A lot of traders now open ChatGPT, Claude or Gemini and ask something like "EURUSD is around 1.09, what do you think?". The answer usually looks confident and reads well. The problem is that the model has almost nothing to work with: no spread, no timeframe, no indicator values, no idea where the recent highs and lows sit. It fills the gaps from its training data, and training data is not your chart.

This post is about the boring part that fixes most of it: giving the model a proper snapshot of your chart before you ask anything.

Why the model needs structure, not adjectives

An LLM has no market feed. Everything it "knows" about the current session comes from what you typed. If you write "the trend looks bullish", the model has to take your word for it and will happily build a whole analysis on top of your opinion. If instead you give it the last 30 candles, the ATR, the RSI, and the three nearest levels above and below price, it can reason about the same facts you are looking at, and you can check its reasoning against numbers you recognise.

Two practical consequences:

  1. Feed numbers, not conclusions. "H4 RSI 58.2" is useful. "H4 momentum is strong" is your bias leaking into the prompt.
  2. Feed more than one timeframe. Most discretionary traders read the higher timeframe first and then drop down for entries. If the prompt only contains M15, the model cannot do that, and it will not tell you it is missing.

A prompt template you can copy

The structure below works well in my testing. Keep the section headers; they help the model keep the context separated instead of blending everything into one paragraph.

=== MARKET SNAPSHOT ===
Symbol: EURUSD | Timeframe: H1
Server time: 2026-07-22 14:05
Bid: 1.09214 | Ask: 1.09227 | Spread: 1.3 pips

--- RECENT PRICE ACTION (last 30 candles, oldest first) ---
time, open, high, low, close
...

--- INDICATORS (current timeframe) ---
ATR(14): 0.00118
RSI(14): 58.2
MA(20): 1.09104 | MA(50): 1.08977
MACD: 0.00041 / signal 0.00028

--- KEY LEVELS ---
R2 1.09640 (3 touches, 43 pips above price)
R1 1.09380 (5 touches, 17 pips above price)
S1 1.08950 (4 touches, 26 pips below price)
S2 1.08710 (2 touches, 50 pips below price)

--- HIGHER TIMEFRAME CONTEXT ---
H4: trend up, RSI 61.0, ATR 0.00290, nearest levels 1.09380 / 1.08950
D1: trend up, RSI 55.4, ATR 0.00710, nearest levels 1.09640 / 1.08710

=== QUESTION ===
Based only on the data above, describe the current structure,
where the timeframes agree and where they conflict, and which
levels matter for the next session. State your uncertainty.
Do not give me a trade signal.

Three details that make a real difference

Touch counts on levels. A level price rejected five times is not the same as a line drawn through one wick. Including how many times price reacted at a zone lets the model rank them instead of treating every number as equal.

Distance from price. Giving the distance in pips saves the model from doing arithmetic on floats, which is exactly where small models slip. It also makes its answer easier to sanity-check.

Ending with "state your uncertainty" and "do not give me a signal". Both matter. The first one pushes back against the confident tone LLMs default to. The second keeps you in the analysis seat, which is where you should stay anyway.

Building the snapshot without typing it

Typing all of that by hand takes several minutes and one wrong digit quietly poisons the whole answer. The obvious fix is to have the terminal write it for you: read the symbol data, the indicator handles, the pivots, and the higher timeframes, then dump the whole thing to a text file you can select and paste.

If you want to build it yourself, the pieces are all standard MQL5: CopyRates for the candles, iATR / iRSI / iMA / iMACD for the indicators, a swing-high/swing-low scan clustered by ATR for the levels, and a second pass with PERIOD_H4 / PERIOD_D1 for the higher-timeframe block. FileWrite into MQL5\Files and you are done.

I ended up packaging my own version as a chart utility, since I use it every session: AI Market Snapshot Exporter. It is display-only, it does not trade, and it just writes the prompt file described above.

Either way, self-built or not, the point stands: the quality of an AI answer about your chart is mostly decided before you press Enter.

Note: none of the above is financial advice. An LLM does not know the future, and a well-formatted prompt does not change that. Treat its output as a second opinion to argue with, not as a decision.