Thanks in advance!
Follow the example:
I've seen this repeatedly, even in my CME Futures (MT5) broker's forum. For some reason, I haven't experienced the problem.
Two things off the top of my head:
- Connecting MT5 on a centralized futures exchange usually involves a gateway, bridge, or pipe of some kind. In my case, it's all on the backend managed by the broker.
- The Last price is generally the hallmark price that futures traders examine. I do know that there are a lot more Last prices than Bid prices in my historic data. Is it possible that your broker configured bars to print on Last instead of Bid in its gateway?
Any support from any moderators?
@all
I believe that all of the mods code for CFD's and forex, so they're likely unable to help you.
I took a 2nd look at your code. I see that your master loop is counting backward (i--). Instead of:
return(rates_total);
Try:
return(rates_total - 1);And set your prices as Series.
Thanks a lot for the help, unfortunately it didn't solve it :( But if not even the moderators know what's going on or how to handle futures, who can know?
More than anything at the MT4 and MT5 product level, if no one has the situation in hand, how can you encourage other developers to consider these products? I tried to find support elsewhere but the only way is through the forum...
If any moderator would like to address the problem I would be happy to provide some more information,
Thanks so much again for your support Ryan
- Why does this lag only happen with Futures?
Have you asked your broker? It could be that reale time quotes are delayed if you don't pay.
Goodmorning Carl, thanks for your answer.
When I was talking about delay I didn't mean the difference with real time, but the candle is just behind the current price indicated on the axis. Looking at the image you can see that the candle should be smaller because the price is higher.
Below you can find a video where you can see that the last candle can't keep up with the current price, it's struggling a lot. You have an example of code above, but I also have indicators where in Calculate there is a for (500 interactions) where doing a trivial "iTime(_Symbol,PERIOD_M1,i)" slows everything down
Goodmorning Carl, thanks for your answer.
When I was talking about delay I didn't mean the difference with real time, but the candle is just behind the current price indicated on the axis. Looking at the image you can see that the candle should be smaller because the price is higher.
Below you can find a video where you can see that the last candle can't keep up with the current price, it's struggling a lot. You have an example of code above, but I also have indicators where in Calculate there is a for (500 interactions) where doing a trivial "iTime(_Symbol,PERIOD_M1,i)" slows everything down
Ah, I see that you're actually not trading futures contracts at all. You're trading CFD's (contracts for difference). The problem is with your CFD dealer.
When I was talking about delay I didn't mean the difference with real time, but the candle is just behind the current price indicated on the axis. Looking at the image you can see that the candle should be smaller because the price is higher.
Below you can find a video where you can see that the last candle can't keep up with the current price, it's struggling a lot. You have an example of code above, but I also have indicators where in Calculate there is a for (500 interactions) where doing a trivial "iTime(_Symbol,PERIOD_M1,i)" slows everything down
It would be great to clarify what is shown on the chart, specifically what are the ticks during this video, aka time and sales, which can be opened in a separate window in MT5.
I'm asking because the chart can be built on last price, but 2 horizontal lines are most likely ask and bid prices.
Hi what you have described is not a problem, it is a feature.
We take soybean future as an example, most time when it is off the peak trading session, soybean is traded once every 5 minutes or so, your candle stick closing price used the "last price", your bid and ask straight lines are the bid and ask, sometimes bid and ask can both move up and down while nothing has been traded at all.
For example: right now last traded price is 1000, your bid is 999, ask is 1001;
Nothing happens in the next 5 minutes, last traded price is still 1000, but now bid is 1002, ask is 1005. And you will see the mismatch on the chart.

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Thanks in advance!
Follow the example: