iCustom() Question

 

Hello everybody

I need some help on how can I use a the iCustom() function to detect the color of the circles that the indicator draw’s (Red or Green ?) 

 

 

,I try to look to the Data Window to know the indicator buffers  , but there is nothing .

(I have the compiled file) 


 
yassin.mokni:

Hello everybody

I need some help on how can I use a the iCustom() function to detect the color of the circles that the indicator draw’s (Red or Green ?) 

 

 

,I try to look to the Data Window to know the indicator buffers  , but there is nothing .

(I have the compiled file) 


You can't use iCustom for this. These indication on the chart are objects, you have to find them and get their values with Objects function, see documentation.
 
angevoyageur:
You can't use iCustom for this. These indication on the chart are objects, you have to find them and get their values with Objects function, see documentation.

Thanks Mr.Alain 

How can we use Objects function if we want to use the indicator objects values in an  EA ?

Or how I can call this indicator to use the objects function ? 

 
yassin.mokni:

Thanks Mr.Alain 

How can we use Objects function if we want to use the indicator objects values in an  EA ?

Or how I can call this indicator to use the objects function ? 

Loop through all the objects of the chart, check each object  : https://www.mql5.com/en/docs/objects
Documentation on MQL5: Object Functions
Documentation on MQL5: Object Functions
  • www.mql5.com
Object Functions - Reference on algorithmic/automated trading language for MetaTrader 5
 
angevoyageur:
Loop through all the objects of the chart, check each object  : https://www.mql5.com/en/docs/objects
aha , you mean that we do not need to include the Indicator into the Ea , just we save it with the template ? 
 
Is this right ?
static int Trend=1245;
string clr;
clr=ColorToString( ObjectGet( "D1B", OBJPROP_COLOR ),True); // "D1B" is the name of the object 
      
      if (clr=="clrLimeGreen")
      {
            Trend=0; // Up 
            
            Print("The color is ", clr ," and the Trend = ",Trend);

      }
         if(clr=="clrRed")
         {

            Trend=1; // Down
            
            Print("The color is ", clr  ," and the Trend = ",Trend);
         }
I try this code but it run's just one time when I Run the strategy tester 
Reason: