Download MetaTrader 5
To add comments, please log in or register
We have launched Spanish and Portuguese versions of the website. Try them!
The Xlearner
222
The Xlearner 2015.01.07 23:41 

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) 


Alain Verleyen
Moderator
30635
Alain Verleyen 2015.01.08 10:48  
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.
The Xlearner
222
The Xlearner 2015.01.08 11:39  
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 ? 

Alain Verleyen
Moderator
30635
Alain Verleyen 2015.01.08 13:59  
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
The Xlearner
222
The Xlearner 2015.01.08 20:39  
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 ? 
The Xlearner
222
The Xlearner 2015.01.09 09:22  
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 
/
To add comments, please log in or register