Thanks, I'll have a look at iMA and see how I get on.
Aug.
Thanks, I'll have a look at iMA and see how I get on.
Aug.
I've added a MA ok using iMA, but I'm not sure how to do the below - all the examples I can find are for MA crossovers, where as I want to compare the MA to itself to determine the slope.
I want to effectively be able to do this:
MA[1] > MA[2]
Thanks.
I've added a MA ok using iMA, but I'm not sure how to do the below - all the examples I can find are for MA crossovers, where as I want to compare the MA to itself to determine the slope.
I want to effectively be able to do this:
MA[1] > MA[2]
Thanks.
iMAOnArray
Ah, thanks :)
iMAOnArray is irrelevant. What is the last parameter in iMA? What does your 1 and 2 mean?
If I have a 100 SMA moving average, I would like to compare the SMA value 1 candle ago against 2 candles ago, to determine if the slope of the SMA is currently up or down.
Thanks
Answer my other question.
The Shift? So I could create two iMA's with a Shift of 0 and 1 respectively, and this would effectively give me the last and second to last values from the moving average? If so, sounds good.
Just an aside, is there any best practice to ensure when using MA's in an EA that you avoid 'looking into the future' when using the strategy tester? If I use a shift of 0 will it always be entirely safe?

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hi all,
I need to add a single moving Average to an EA I am using, I will use the moving average to determine if the trend is up or down.
I just need to very simply compare the current candle MA to the last candle MA to give me my 'UP' or 'Down' trend indication (is MA greater or less than last candle MA?)
I'm confident in feeding the UP/Down into my Buy/Sell triggers, but I'm not sure how to add the MA or perform the above calc?
Any help would be much appreciated!
Thanks
Aug