Make the handler in Oncalculate, not in OnInit.
Also check out the Documentation: Organizing Data Access
Documentation on MQL5: Timeseries and Indicators Access / Organizing Data Access
- www.mql5.com
Organizing Data Access - Timeseries and Indicators Access - MQL5 Reference - Reference on algorithmic/automated trading language for MetaTrader 5
Thanks, the file attachment I added was not deleted, I don't know why the image attachment was.
Thank-god Avwerosuoghene Odukudu # :
Thanks, the file attachment I added was not deleted, I don't know why the image attachment was.
Thanks, the file attachment I added was not deleted, I don't know why the image attachment was.
Study this Documentation, after that you will know that when requesting data from someone else's timeframe, you should always check the error code (just in case: suddenly the timeseries has not been built yet).
Vladimir Karputov #:
I can check to ensure there is value, but I am wondering what would happen before I can get a value at the start. I have been reading the documentation and searching the forum. It might be something I overlooked, please, point me in that direction, thanks.
Study this Documentation, after that you will know that when requesting data from someone else's timeframe, you should always check the error code (just in case: suddenly the timeseries has not been built yet).
Thank-god Avwerosuoghene Odukudu # :
I can check to ensure there is value, but I am wondering what would happen before I can get a value at the start. I have been reading the documentation and searching the forum. It might be something I overlooked, please, point me in that direction, thanks.
I can check to ensure there is value, but I am wondering what would happen before I can get a value at the start. I have been reading the documentation and searching the forum. It might be something I overlooked, please, point me in that direction, thanks.
I do not have telepathic abilities - insert your code correctly and I can help you.
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Hello,
How do you get a value from iBarShift() function for a timeframe other than the current at the start of the terminal (that is the first run)? It is always returning -1(or no bar) no matter what I have tried. I am creating a Multi-time Frame indicator that loops from the start date to the present, analyzing for the said pattern.
if the iBarShift() is called for the current timeframe, you get a value.
meaning, the user would have to change chart, or something that would re-initialize the chart for the indicator buffers to be plotted. Thanks.
Note: I wrote a test program, outputting the values of iBarShift() inside the onCalculate() function for both the current timeframe and a TF different from the current.
***
Test Code: