Commit graph Warrior_EA/Scripts/CalendarHistoryExport.mq5
Author SHA1 Message Date
AnimateDread
dc6daa2ff9 fix(news): probe the calendar call instead of declaring the feed absent
The operator checked the Toolbox: the Calendar tab is FULL. Calendar data comes
from MetaQuotes' servers; the News tab is the broker's own feed and is separately
empty. So my conclusion this morning - "this broker delivers no calendar" - was
wrong, and it was built on proxies: an empty news.dat, which is the unrelated
news-headline subsystem, and the absence of any file named *calendar* on disk,
which only means the store is not named what I guessed. One glance at the tab
settled what three filesystem checks could not.

The real fact is narrower and stranger: CalendarValueHistory over 2010..now with
NULL country and NULL currency returns zero rows and error 0 - success, no data -
while the terminal plainly holds the data. So the script now probes before it
exports, reporting CalendarCountries() and then trying the call four ways with n
and error printed for each: (NULL,NULL), ("",""), a narrow recent range, and a
per-country loop over CalendarCountries(). It exports the first variant that
returns rows, preferring the widest, and if all four are empty it says so rather
than offering a cause.

Compile-verified in _claude_stage: 0 errors, 0 warnings. Deployed to the fleet
terminal's MQL5\Scripts so it can be dragged onto a chart.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-06 16:31:06 -04:00
AnimateDread
15a1e18a5c feat(news): standalone calendar dump, for a terminal that actually has one
Measured on a live attach today: the fleet terminal returns ZERO calendar
values with error 0, news.dat is a 428-byte empty header, and no calendar base
exists on disk. NewsEnable=1, so it is the broker and not a local setting -
Five Percent Online does not deliver the calendar. NewsExport.mqh is correct
and has nothing to export there, which no amount of EA work changes.

FILE_COMMON resolves to the same Common\Files folder for every standard MT5
install of one Windows user, so a terminal that DOES carry a calendar can write
the file the research reads without anything about the fleet terminal changing.
A script rather than the EA because that terminal is a borrowed one: it should
not have to host a trading system, its symbols and its models to hand over a
CSV. Column-for-column identical to NewsExport.mqh, since newsdata.py reads
whichever of the two wrote the file.

Does not replace Scripts/CalendarRecorder.mq5 and says so in its header. That
one exists because actual_value is post-revision, so a surprise from history is
leaky; this dumps history, which is honest for the columns that are never
restated - the release TIME and importance - and those are what the T-5/T+15
blackout and the two news setups need.

Compile-verified in _claude_stage: 0 errors, 0 warnings.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-06 16:22:11 -04:00