From CustomTickAdd() documentation :
CustomTicksAddThe MqlTick structure has two fields with the time value: time (the tick time in seconds) and time_msc (the tick time in milliseconds), which are counted from January 1, 1970. These fields in the added ticks are processed in the following order:
- If ticks[k].time_msc!=0, we use it to fill the ticks[k].time field, i.e. ticks[k].time=ticks[k].time_msc/1000 (integer division) is set for the tick
- If ticks[k].time_msc==0 and ticks[k].time!=0, time in milliseconds is obtained by multiplying by 1000, i.e. ticks[k].time_msc=ticks[k].time*1000
- If ticks[k].time_msc==0 and ticks[k].time==0, the current trade server time up to a millisecond as of the moment of CustomTicksAdd call is written to these fields.
From Language Basic, about variables initialization :
If a variable is not initialized explicitly, the value stored in this variable can be any. Implicit initialization is not used.

You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Hi,
I'm using websocket in mt5 to read ticks and inserting the same into a custom symbol using CustomTicksAdd function. Although I'm supplying correct datetime but looking at the tick history for all ticks the date being added is 1970.01.01 00:00:00.008. Due to this the chart candle is not getting updated. Looking at the code please suggest if I'm doing anything wrong or anything additional needs to be done.
where time is the epoch.
Thanks,
Anubhav