Download MetaTrader 5
To add comments, please log in or register
Track all payments in your profile. It is easy!
cpips
8
cpips 2009.07.03 00:51 

I can set Moving Average Levels on my charts in the dialog box settings,


so how do I program the MA Levels into an EA lines of code?


To Buy when Price is between the MA Level values of up +20 and +40.

To Sell when Price is between the MA Level values of down -20 and -40.

Standard Moving Average Parameters allow for shift to the right and left only.

As MetaTrader lets me set MA Levels on the charts, surely there must be a way to program MA Levels into an EA.

Can anyone help me solve this puzzle?

Ray
2655
Ray 2009.07.03 01:07  

Use iMA() in your EA to get the moving average, then add/subtract from that to get the levels.

spot007
35
spot007 2010.06.21 17:40  

I am also looking for the source code for this. The built-in indicator cannot be modified in editor, and the source code posted online is for the Custom Indicator "Moving Averages" (which does not let you add levels), not the built-in "Moving Average" which lets you add "Levels".

If someone can post the code or knows where to find it, there would be more than one person that would appreciate this!

/
To add comments, please log in or register