When CustomRatesUpdate() and CustomRatesReplace() are executed, only the latest bar is added. On the rest, messages are displayed in the log of the form ” invalid bar 2018.03.30 08: 32 (1) <= 2018.03.30 09:52 (0)”. Please respond to anyone who has encountered: how did you manage to win?
Error ” invalid bar .. <= .. “when executing CustomRatesUpdate() and CustomRatesReplace()
Share
goldrat
I agree, but in this case it is enough – the exchange gives prices with an accuracy of 2 characters.
After deleting, I create the symbol programmatically with the CustomSymbolCreate () function. I didn’t seem to notice such a mistake.
fxsaber
Yes, in the Documentation this is described only in the part of ticks.
Just another MT5 error is indicative here. For example, I erase your character completely. And I create it based on the corrected json file. An attempt to record bars will still return the same error. Because somewhere in the caches are stored the old settings-the deleted symbol. And do nothing.
But it is necessary to simply restart the Terminal, as the new settings get into the cache and the work becomes correct. This is very annoying, because in fact, to see the result of changing the settings of the user symbol, you have to restart the terminal every Time.
goldrat
From MqlTick[] is not suitable – it is necessary to upload the bars. Files attached
fxsaber
Look at Rates.mqh, there is the formation of MqlRates[] from MqlTick[].
If you already have a problem MqlRates [] ready, write it down via FileSave and attach it here. And also throw off the JSON file of the custom symbol.