"Max bars in chart" quietly cuts the history your EA can read

30 November 2026, 19:02
Ciprian Ghebanoaei
0
4

My export of index M5 data stopped at about 1.5 years. My notes say the history for these indices goes back to 2018 or earlier. The export simply got fewer bars than I expected.

Why it happens

On a live chart the terminal keeps at most "Max bars in chart" bars per timeframe. You find the setting in Tools > Options > Charts. Mine was 100000.

When the history is longer than that, Bars() and CopyTime() return the newest bars up to the limit and nothing older. Indicators and EAs on a live chart read the same series, so they get the same cut.

A fixed number of bars covers very different time spans. Small timeframes run out first.

What the numbers look like

I checked three symbols on an Admirals demo server on 25.11.2026, with Max bars at 100000. These are the results for EURUSD:

  • M1: 100000 bars, back to 20 August 2026. That is about 0.3 years.
  • M15: 100000 bars, back to November 2022. About 4 years.
  • M30: 100000 bars, back to November 2018. About 8 years.
  • H1 and D1: back to January 2011. About 15.9 years.

History Depth Check output on EURUSD, GERMANY40 and GOLD

So M30 stops in 2018 while H1 and D1 reach 2011 on the same symbol. An indicator that needs M30 data from before November 2018 gets none.

GERMANY40 shows the same pattern. M5 there has 100000 bars and reads back about 1.6 years. That is close to the cut I saw in my export.

One more case from the table: EURUSD M5 has fewer than 100000 bars (74515), so the limit is not the reason. The terminal simply holds less M5 data for that series.

The script

I wrote a small script to see this directly and published it for free in CodeBase: History Depth Check.

For each symbol you list, it prints the number of bars on M1, M5, M15, M30, H1, H4 and D1 and the date of the oldest bar a program can read. It marks "CUT by Max bars" when a timeframe stops at the limit while older data exists elsewhere. It also gives a rough estimate of the bar count needed to reach that data.

It does not trade or change any setting. It only reads data. It adds the listed symbols to Market Watch and may make the terminal download their history.

What to do

Two options:

  1. Raise "Max bars in chart" and restart the terminal.
  2. Read the older history in smaller date windows.

For my own export I raised MaxBars temporarily in the terminal config and then set it back to 100000. According to my notes this worked for exporting history. I did not test either option with this script, so I cannot say more than that.

Limits

  • The numbers above are from one demo server on one day. Other servers and other settings will differ.
  • The script shows what is readable now. It does not fix anything.
  • The estimate of needed bars is a rough calculation from the current bar density.

If an EA or indicator gives odd results on a long lookback, check this first.

Free script: https://www.mql5.com/en/code/80064