EA that recognizes round numbers and support/resistance levels from indicators

To add comments, please log in or register
clinteas2
31
clinteas2  
Can an EA incorporate or read price values from indicators that are active on a chart? Eg, an indicator that looks for daily S/R levels, pivots, or round numbers? Apologies if this has been asked before. Also, how would one go about programming an EA to enter a trade when price reaches a round number? All ideas much appreciated, thank you.
Carl Schreiber
Moderator
7650
Carl Schreiber  
Just search here with Ctrl-F for "round"
Zee Zhou Ma
1903
Zee Zhou Ma  

There are 3 ways to do it:

1) The indicator has to generate display objects for the levels, then your EA has to extract the prices off these levels using double price = ObjectGetDouble(ChartID(),<Level>,OBJPROP_PRICE);

2) Or the indicator has to generate global variables for the levels, then your EA just needs to read from the global variables.

3) Don't use any indicator at all. Just code the logic of your levels into your EA. This way is the best. 

Here you go: https://www.mql5.com/en/docs/convert/normalizedouble

Documentation on MQL5: Conversion Functions / NormalizeDouble
Documentation on MQL5: Conversion Functions / NormalizeDouble
  • www.mql5.com
Calculated values of StopLoss, TakeProfit, and values of open prices for pending orders must be normalized with the accuracy, the value of which can be obtained by Digits(). Please note...
clinteas2
31
clinteas2  
Zee Zhou Ma:

There are 3 ways to do it:

1) The indicator has to generate display objects for the levels, then your EA has to extract the prices off these levels using double price = ObjectGetDouble(ChartID(),<Level>,OBJPROP_PRICE);

2) Or the indicator has to generate global variables for the levels, then your EA just needs to read from the global variables.

3) Don't use any indicator at all. Just code the logic of your levels into your EA. This way is the best. 

Here you go: https://www.mql5.com/en/docs/convert/normalizedouble

thank you, that is actually very helpful!
To add comments, please log in or register