Forex Factory (https://www.forexfactory.com/)
-   Platform Tech (https://www.forexfactory.com/forum/69-platform-tech)
-   -   How to get an MA value of first indicators value? (https://www.forexfactory.com/thread/290490-how-to-get-an-ma-value-of-first)

ewinner Apr 16, 2011 9:57am | Post# 1

How to get an MA value of first indicators value?
 
1 Attachment(s)
Hello,

Im hoping one of the great coders on FF can help me out or at least put in the right direction.

I have been playing around with MQL for some time now but have come up against a problem/question i cannot answer. I have searched the forums and internet but cannot find any code i can play with.

Any help is much appreciated.. Here goes...

If i put a CCI 25 Typical Price on a chart and then drag a SMA 18 Close onto the CCi and set it to first indicators data as per the image below.

Now my question is, if you look at the data panel the two values, i want to be able to use those values in an EA, how do i get these values?

I know i can use iCCI(NULL,0,25,PRICE_TYPICAL,0) to get the CCI value, how do i get the MA value of CCI?

Im completely stumped on this, from what i have been able to find out is its to do with iCCIOnArray... but that is as far as i have got.

One again, thank you for any advice and suggestions on this.

Regards
Mark
Name:  cci_ma.png
Views: 557
Size:  37 KB

iwjw Apr 16, 2011 10:19am | Post# 2

you can use the iMAOnArray function

ewinner Apr 16, 2011 1:31pm | Post# 3

Thanks for the tip.... done some searching and found a good tutorial here http://www.metatrader.info/node/84 explains it very well

Cheers
Mark


© Forex Factory