
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
I just had a quick look a the code again. Here's the thing, in order to make EMA1[0] and EMA2[0] correspond to the most updated MA value (at current bar), then you need to use ArraysSetAsSeries in OnInit:
^ the same goes for the ATR
Otherwise if you don't do this, then you should be coding it like:
but I don't think that's a common approach to index it that way
I didn't test anything yet, I don't have time, but maybe I can have a closer look later.
It will help you a lot if you print the buffer prices, and then look in the journal.