Hello, I posted this question on mql4 forum, but nobody replied so I figured it didn't catch attention of any of the MT4 developers.
It is very important for me to get an answer to this, so please, try to provide some..
I am having this necessity to occasionally modify history files from
my code (scripts or native windows app) and have been doing so
successfully. MT4 seems to have no problems using these modified files
with demo and live accounts and it displays the modified information on
charts without problems.
However, I encountered the following problem: The changes applied to
the most recent bars are being overwritten by MT4 itself when it's
launched and automatically re-fetches N most recent bars from the
server (you can even see it visually on the chart when MT4 is launched
as it first shows the bars with modifications and then it shows the
re-fetched data as it overwrites my modifications). My problem is that
there is no documentation whatsoever on how many most recent bars does
MT4 re-fetch from the server each time it's launched and how to limit
this behavior to just a couple of last bars (as I don't want it to
overwrite my changes).
I tried analyzing timesign and last_sync attributes of the history
file header structure upon applying changes manually in the history
center and realized that MT4 is using at least one of these two to
time-flag the recent changes so they don't get overridden on the next
launch. It is however unclear what are the exact values (and by which
time reference - server time or local time?) that either or both of
this attributes should be set to in order to prevent MT4 from
re-fetching N (how many exactly??) bars from the server and overwriting
them in the history file.
Could the person that developed this part of MT4 behavior please provide some clarification on the subject?
Thank you in advance,