I have a custom symbol that I created and I want to add MqlTick data to it using the function CustomTicksUpdate (In the documentation it's called CustomTicksAdd, but this function doesn't exists inside mql5, I think the documentation is outdated).
To do that, I have a timer in my EA and every time OnTimer is called, I try to add a MqlTick, the way I'm doing that for now as a test is like that:
ticks_array.ask = 1.32787;
ticks_array.flags = TICK_FLAG_BID;
ticks_array.time = TimeLocal();
ticks_array.time_msc = 0;
As you can see, I create a MqlTick array, with one position, add a ask value, set the flag and time and send it as a parameter to CustomTicksUpdate.
As far as I know, this should work no problem, but every time CustomTicksUpdate is called, I receive a -1 as return value.
Calling GetLastError returns the error id 5304:
A custom symbol with the same name already exists
I don't get it, why is it returning this error? It's obvious that this symbol already exists, it's the symbol that I'm trying to update the ticks data..
Calling CustomRatesUpdate to add Rates data to that same symbol works flawlessly.
What I'm doing wrong?
MT5 1653 build.