Moving average source code

 

Anyone know where I can find the source code to moving average ? I want to see how the "applied to" section is coded, especially the weighted close, and the typical price.

 

C:\Program Files\MetaTrader 4.0\experts\indicators\Moving Averages.mq4

Attached in case you can't find it .

Files:
 
msbusinessil:

C:\Program Files\MetaTrader 4.0\experts\indicators\Moving Averages.mq4

Attached in case you can't find it .


That one is the customer indicator version of the moving average, for some reason it doesnt have "applied to" .

It appears to be fixed to the close price, I wanted to see the source code for the regular moving average that does have the applied to input variable

 
Hi, 
Can any one help me building an EA for moving average where it can open a trade when fast moving average cross slow moving average and close the trade when fast moving average cross slow moving average again at the very next point?
Thanks
 
Ian Venner:

Anyone know where I can find the source code to moving average ? I want to see how the "applied to" section is coded, especially the weighted close, and the typical price.

MQL5\Include\MovingAverages.mqh same to MQL4

 
Ian Venner: I want to see how the "applied to" section is coded, especially the weighted close, and the typical price.
  1. Look in the code base, there are lots of examples.
    1. An input variable of applied price.
    2. Either they compute it directly.
    3. Or they call SMA(1, input)
Reason: