MetaTrader 5 Build 6230 — ChartNext returns -1 with GetLastError 4103 on the only chart

Hello MetaQuotes Technical Team,

We are investigating chart enumeration behavior in MetaTrader 5 build 6230.

In a connected Demo terminal with one XAUUSD/M1 chart, our read-only MQL5 diagnostic consistently observes:

  • ChartFirst() returns the valid current Chart ID, with GetLastError() == 0.

  • After a separate ResetLastError(), ChartNext(valid_chart_id) returns -1.

  • An immediate GetLastError() returns 4103 (ERR_CHART_NOT_FOUND).

  • Two consecutive diagnostic readings reproduce this behavior.

  • Separate object enumeration reports zero OBJ_CHART objects, with no API errors.

  • The terminal's Window list displays only one chart.

The documentation states that ChartNext() returns -1 at the end of the chart list, while 4103 is documented as Chart Not Found.

Could you please clarify:

  1. Is ChartNext(valid_last_chart_id) == -1 together with GetLastError() == 4103 an expected end-of-list result in build 6230?

  2. Can this combination indicate an invalid/stale chart ID, or an enumeration inconsistency?

  3. Does ChartNext enumeration include embedded OBJ_CHART objects as well as chart windows?

  4. What is the recommended reliable way to distinguish a normal end-of-list result from a failed enumeration?

  5. Is there a documented or version-specific behavior that we should account for?

We are looking for an authoritative, build-specific interpretation rather than a workaround that ignores runtime errors.

Thank you.

If you want a clarification about MQL5. Post your code.