Please, always use the CODE button (Alt-S) when inserting code.
Derk Wehler: I was trying to use the MaxBars parameter (the zero after MODE_EMA) for a while, but then it gives even worse values. But when I send zero, I get warnings on the experts tab like this:
Zero means all bars. Use something non-zero like 3*length.
Thanks, I had a hard time finding that
Yes, zero means all bars. So I tried a smaller number (like twice the MA period) and the return values were even worse (compared to value in data window) than when I send zero.
I'm not clear exactly what happens when you do an iCustom call. When I ask for index 1, but it's a buffer of a MA of the main (index zero) value, how does it have enough values to run the iMAOnArray?
If anyone knows of any in-depth articles that describe exactly how MT4 deals with this, please send a link. Thanks.
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 [written] a quite simple currency strength indicator (for CAD), it just uses the average of the close price of all seven CAD crosses. Then, since that line is quite jagged, I added a moving average to smooth it out. When I call it from an EA with iCustom, it get 'similar' values, but not the exact values shown in the Data window. So far I'm s tumped as to why. Can anyone enlighten me?
The ind code is attached, and I am calling it like this:
...where sh = 1 & 2, so calling for closed candle and next one back. The value returned is sometimes exactly correct, most of the time just pretty close. Any help appreciated.
I was trying to use the MaxBars parameter (the zero after MODE_EMA) for a while, but then it gives even worse values. But when I send zero, I get warnings on the experts tab like this: