Download MetaTrader 5

Adding and Reading Indicator value from Indicator Windows

To add comments, please log in or register
MQL5 Cloud Network speeds up calculations. Try it!
sunday 2015.10.05 08:31 

I am trying to implement a trading strategy into an EA. The strategy is with the combination of an ATR and a Moving Average indicator, both indicator are in the indicator windows as shown below:

ATR and MA in indicator window 

My challenge is how would I through an EA, add and read the value of the Moving Average in the indicator window? 

Keith Watford
Keith Watford 2015.10.05 08:49  

Do you mean an MA on ATR?

You could write a custom indicator with 2 buffers, the ATR and the 2nd for an iMAOnArray

Get the values for the EA with an iCustom call. 

The other way would be to use arrays in the EA to calculate the values, but that can be a bit more complicated. 

sunday 2015.10.05 08:59  
Hi GumRai, thanks for your quick response, I think your suggestion should be the best solution. Though I am not too good writing a custom indicator, I prefer doing it with an EA. Better still I would try your solution with a custom indicator. Thanks.
To add comments, please log in or register