Download MetaTrader 5
To add comments, please log in or register
Are you used to trading from your smartphone? Mobile version of MetaTrader 5 will suit you best!
MF
51
MF 2015.04.05 00:08 

Hello,

Im  programming an EA and i want to use custom indicator so I using the iCouston function.The problem is that this indicator is colors and not numbers(when its black buy and when its whit sell for example).

How i turn this colors to signels that well tell the EA when to open order? How I writ if function with colors and not a nomber?

 

Keith Watford
Moderator
7976
Keith Watford 2015.04.05 01:12  

If the indicator uses buffers, if you open the data window, you will see the different buffer values for 0,1,2 etc

You should be able to work out what combination of values/lack of values equate to a buy or a sell signal

MF
51
MF 2015.04.05 08:14  

Thank you for your answer,

I found the buffer values,but when I'm write if function  like this:

 

int start ()

{

  

double Buy2_2 = iCustom (NULL, 0 ,"superscalper05" , 0 , 0);

double Buy2_1 = iCustom (NULL, 0 ,"superscalper05" , 2 , 2);

 

 if (Buy1 < Sell1)

  OrderSend(NULL,0,1,Ask,1,StopLoss,TakeProfit,NULL,MagicNumber,Green,Green);

 

return(0);

}
It dosent work.I attached the indicator.
Files:
Keith Watford
Moderator
7976
Keith Watford 2015.04.05 11:34  
int start ()

{

  

double Buy2_2 = iCustom (NULL, 0 ,"superscalper05" , 0 , 0);

double Buy2_1 = iCustom (NULL, 0 ,"superscalper05" , 2 , 2);

 

 if (Buy1 < Sell1)   //What are these 2 variables and where do they get their values???

  OrderSend(NULL,0,1,Ask,1,StopLoss,TakeProfit,NULL,MagicNumber,Green,Green);

 

return(0);

}
MF
51
MF 2015.04.05 13:21  

Excuse me,my mistake.this is what I ment:

int start ()

{

  

double Buy2_2 = iCustom (NULL, 0 ,"superscalper05" , 0 , 0);

double Buy2_1 = iCustom (NULL, 0 ,"superscalper05" , 2 , 2);

 

 if (Buy2_2 < Buy2_1)

  OrderSend(NULL,0,1,Ask,1,StopLoss,TakeProfit,NULL,MagicNumber,Green,Green);

 

return(0);

}
/
To add comments, please log in or register