Gaps when downloading prices in [Trade] mode

Posted By: Zheka

Gaps when downloading prices in [Trade] mode - 03/19/18 17:58

Hi, All,

when [Trade] is turned on, Zorro is downloading price history from the broker, needed to cover the LookBack period.

However, say, in 50% of the time, it would not download the most recent/front 1-10 bars.

I get this when LookBack=5600 5-min Bars (and more than 3/4 of these exist in the database and pre-loaded), connecting to an MT4 broker.

IS this a common experience with MT4?

To guarantee that all data exists for pre-calculation, I use the below snippet to warn me of missing bars:
Quote:
float tdiff;

if (is(TRADEMODE) && Bar>=StartBar-1)
{

tdiff=(wdate(NOW)-wdate(0))*(24*60);

if (tdiff>BarPeriod)
msg("# MISSING %.1f BARS!", tdiff/BarPeriod);

}

I believe Zorro's MT4 plug-in can be improved to handle situations like this and re-request the data if missing.
Posted By: Zheka

Re: Gaps when downloading prices in [Trade] mode - 04/03/18 14:17

I have made some checks to confirm if the issue is on MT4's side or Zorro's.

Turns out MT4 does deliver all prices. Seems to be an issue with MT4 plugin.
Posted By: jcl

Re: Gaps when downloading prices in [Trade] mode - 04/03/18 16:37

I don't think that this has something to do with MT4. Depending on server speed and on how many assets you have, history loading takes some time, and that time is then a small gap between the last history price and the first live price.
Posted By: Zheka

Re: Gaps when downloading prices in [Trade] mode - 04/03/18 18:23

No, JCL, this cannot be the reason. I wrote a message to support with details.

3 assets, each needing to load 10 5-min bars(=50 M1 ticks). Loading takes milliseconds, and anyway Zorro MT4 plug-in correctly identifies the time from which to request the data back...
Posted By: kujo

Re: Gaps when downloading prices in [Trade] mode - 04/09/18 20:45

Hi Zheka, any updates from support on this?
Thank you!
Posted By: JRA

Re: Gaps when downloading prices in [Trade] mode - 04/10/18 16:07

The gaps are from MT4 servers, I found some gaps when try to download data, same gaps appears on MT4 chart.

Attached picture Gap.PNG
Posted By: Zheka

Re: Gaps when downloading prices in [Trade] mode - 04/10/18 21:48

No, the gaps are not from MT4 servers - in the case I described.

I tried to reproduce it with Workshop5 - and I cannot. So there is something in my code that causes the error. Observing and investigating..
© 2024 lite-C Forums