
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
Now imagine that you had data in indicator buffers, the size of which the terminal changed.
Those 2 examples were primitive. The terminal can also delete bars from the chart sometimes, judging by what other users write on this forum (I myself have never seen bars deleted from the chart). After buffers are truncated, they may still contain data, but the indexing is corrupted.
I would look into this furthers, thanks. My understanding from the reference guide is, all plot buffers or IndicatorBuffers() are having the same number as the rates(total bars) on the chart. So even values are added and removed, depending on the total values the chart can hold, the most recent values is just shifted to the left as the buffers are set AsSeries.
Here's how I avoid nested loops:
MT4 empty value: Other constants - Named Constants - Constants, Enumerations and Structures - MQL4 Reference
I actually do this too, and use functions for sections that repeat as well.
I actually do this too, and use functions for sections that repeat as well.
You might want to try that edit because I noticed that your code references rates_total - 1 inside of an OnCalculate function that returns rates_total (without - 1). The snippet that I posted does not.
You might want to try that edit because I noticed that your code references rates_total - 1 inside of an OnCalculate function that returns rates_total (without - 1). The snippet that I posted does not.
Yes, it meant to calculate for only one bar. You would understand it better if you run it.
Yes, it meant to calculate for only one bar. You would understand it better if you run it.
I don't have MT4 because I trade futures in MT5. I did this in MT5, but I can't post it here because this is an MT4 thread. I think that my code would be easy to convert because it doesn't declare buffer indexes on the fly. Shoot me a PM if you like.