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
Good Morning All,
In the MT4 terminal, it is possible to add a MA to an indicator by dragging the MA indicator onto the chart and selecting apply to “Previous Indicator’s Data” but, since I couldn’t figure out how to duplicate that same action in my EA, I decided I needed to build my own indicator that would. And, since I recall seeing some posts here in the past about others trying to do the same, I thought I’d share what I created and hopefully it will be found useful to someone.
In this indicator the first array is the difference between to MA’s and the second is the first array’s value shifted a given number of bars(MT_Shift). It is the third array, that I made as a MA of the first array (in this case, also using the value of MT_Shift as the period for the MA), that I am referring to above and that is the one you would want to mimic in your own custom indicator. Below is the pertinent part and attached is the whole indicator.