- Sameer Shariff: What am I missing?! Very frustrated.
for (int shift = (rates_total - prev_calculated - 3); shift >= 1; shift--)
After the initial run (where prev_calculated is zero), prev_calculated equals rates_total, and your loop does nothing.
-
double prev_fastMA = iMA(NULL, 0, FastMA, 0, MODE_EMA, PRICE_CLOSE, shift + 1); double prev_slowMA = iMA(NULL, 0, SlowMA, 0, MODE_EMA, PRICE_CLOSE, shift + 1);
The look back is max(FastMA-1, SlowMA-1)+1 or just SlowMA.
How to do your lookbacks correctly #9 — #14 & #19
William Roeder #:
-
After the initial run (where prev_calculated is zero), prev_calculated equals rates_total, and your loop does nothing.
-
The look back is max(FastMA-1, SlowMA-1)+1 or just SlowMA.
How to do your lookbacks correctly #9 — #14 & #19
Awesome! Thank you. Sometimes the obvious gets the better of us.
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 have this test indicator:
I test it from a Script as follows and works fine:
Struggling to get values from an EA as follows:
What am I missing?! Very frustrated.