I am using MqlTick array and adding TimeGMT() to time array but it always print time on chart which is TimeTradeServer()
When i print Array, It shows correct as you can see on screenshot but on chart window it always print wrong time.
I am wondering what could be wrong? it was all working fine on last builds of MT5
It appears you are not adjusting the time_msc (if i'm not mistaken)
Is the data feed from Binance ?Yes
I am only using time, if i use time along with time_msc it gives Error 5310
If i use
then the same error 5310
Yeah it's because it likes ticks to be ordered
How are you converting the time in datetime too ?
You are using one GMT deviation value for all the data ?
For example , i wanted to create a test package with ticks in GMT time , i found a broker in Cyprus ,pulled its ticks .
Then i logged all dst shifts in Cyprus over the years and how the GMT shifted , then adjusted all ticks to be in GMT.
You have an additional issue in Crypto , when the DST shift occurs (anywhere if the country of the provider shifts) the market is live.
Yeah it's because it likes ticks to be ordered
How are you converting the time in datetime too ?
You are using one GMT deviation value for all the data ?
MqlTick tick[1]; ZeroMemory(tick); tick[0].time= m_jv["E"].ToInt()/1000; tick[0].bid = m_jv["c"].ToDbl(); tick[0].ask = m_jv["c"].ToDbl(); tick[0].volume =0; if(CustomTicksAdd(_Symbol,tick)==-1) { Print ("Error ",GetLastError()); }
I am using Jason.mqh Library to get data deserialized
When I am using
ArrayPrint(tick);
the output of time is correct, but only in chart its wrong.
Here is output of correct tick[0].time
and here is output of epoch time
tick[0].time= m_jv["E"].ToInt();
So the data is in gmt already .
do
tick[0].time=(datetime)(m_jv["E"].ToInt()/1000); tick[0].time_msc=m_jv["E"].ToInt();The "E" is in milliseconds
The error is telling you it does not like the order of the ticks i think (in time)
How long is the data ?I sorted out the error. Error 5310 was always coming if you do not delete all symbols and recreate them or you do not delete data from chart. As soon as i deleted and recreated custom symbols, Error was gone and all is fine. Thanks
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
I am using MqlTick array and adding TimeGMT() to time array but it always print time on chart which is TimeTradeServer()
When i print Array, It shows correct as you can see on screenshot but on chart window it always print wrong time.
I am wondering what could be wrong? it was all working fine on last builds of MT5