Hi there....garyfritz wrote:(...)
Help? Anybody with indicator experience, can you offer me some advice?
This is such a BLOODY STUPID IDIOTIC model!!! This is WHY there is such a problem with repainting indicators -- because the stupid damn thing keeps recalculating the last few bars, changing its mind retroactively. I've coded indicators on half a dozen different trading platforms and I've never seen anything like this -- nothing this complicated, nothing this confusing, and nothing that produces erroneous repainting indicators. Stupid %@#!$! braindead @%^@$%! CRAP!!T4!!
I know exactly how you feel, Gary...
Coding indicators is a very special activity, requiring a very special mindset, indeed .
You found your answer by yourself, and sometimes this is the best thing that can happen to you !
You MUST recalculate the EMA for each bar.
Empty4 designers had their moment of lucidity ( ) when they decided to provide the iMAOnArray() function...
However, don't think it is now a piece of cake... naaaa.... too easy...
Because then their tortured minds came up with the ArraySetAsSeries() function...
and you'll start pulling your hair again, believe me....
Fortunately enough, if you are playing with "buffers" as the input data, then you can use iMAOnArray() directly on the "buffers" at no extra brain cost...
I let you play a bit with that function...
However, that issue will be irrelevant when it comes to invoking the indicator from an EA, because iCustom() calls will reload and recalculate the indicator buffers every time, so it will give correct output buffer values at each call.
BTW, nice and clean work on the indicator code!
Sq