Have you checked whether the orientation of your buffers is the way you thing it is - meaning that the first bar (buffer[0]) is the very first or the actual bar or is it the last bar - this is different in mql5 compared to mql4.
Here is an explantation: https://www.mql5.com/en/docs/series/bufferdirection.
- www.mql5.com
Have you checked whether the orientation of your buffers is the way you thing it is - meaning that the first bar (buffer[0]) is the very first or the actual bar or is it the last bar - this is different in mql5 compared to mql4.
Here is an explantation: https://www.mql5.com/en/docs/series/bufferdirection.
Hi Carl,
Thanks for your comments. Yes, the orientation is correct. I've added some more output code to show this, you'll see the index value getting smaller and the date value getting higher (more recent). Then, you can see index 2,1,0 getting new values as new data comes in on OnCalculate.
So, it looks OK in that respect. Any further thoughts?
Many 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
Hi all,
I have developed a stochastic indicator that has an UpdateBuffer function that receives parameters that allows it to update the Signal and Main buffers with appropriate values. On GU/M5, rates_total is set to 100,731 of which the first 731 records correspond to null datetime values. The remaining 100,000 records correspond with good datetime bar values. The main problem that I am experiencing is that whilst there are 100,000 correct values in the buffers, the indicator window is only showing circa 1024 records. I am working in MT5 for the first time (after using MT4 for a few years) so, I'm not exactly sure whether I have missed something obvious or whether I am simply missing the point! :) I have included the UpdateBuffer code and some screenshots that show the problem. If anyone could take a look and advise accordingly, that would be greatly appreciated.
Thanks.
Screenshot debug window shows the values at the end of the function call.
Here is a screen shot of the 1024 bars-worth of stochastic values.
Cheers! :)