Indicator values correct from Script, but struggling from EA
- 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
-
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.
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.