nayphee: but the iMAOnArray results are different. Can anyone explain to me what's going on here?
Indicator buffers are set as series. Your arrays are not, so OnArray is calculating backwards.
ah, ok cool.
make those arrays into calculating buffers
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've noticed some strange behaviour with iMAOnArray() function.
Maybe it is the function, but it could also be in the way EAs differ from indicators. Anyway...
I was trying to incorporate the TDI indicator into an EA to give signals (rather than use iCustom and address the indicator directly, so perhaps that is my first mistake, but anyway....)
Here's the TDI code (note the debugging Print line:)
I run this on the weekend with no market activity. Here is the debugging results:
... so then I coded this function to run in an EA... which is more or less the same code except for the fact that I have to declare the arrays beforehand, and not use IndicatorCounted()
However, the results are entirely different. Additionally, the first line in for processing is 0 where on the indicator, there is already a value:
Note that the RSIBuf is calculated correctly between both bits of code - which as far as I can tell are more or less the same - but the iMAOnArray results are different.
Can anyone explain to me what's going on here?