Download MetaTrader 5
To add comments, please log in or register
Share your programs. That will improve your rating.
Achim Rogalski
61
Achim Rogalski 2015.08.04 07:55 

I want draw different colors for different Situations.

Example:

if(MACD_Value == 100.0)

  {   string Col = "Green";  Order_Close(Col); }

if(MACD_Value == 0.0)

{ string Col = "Red"; Order_Close(Col); } 

 

 

--------------------------------------------------------------------------

// Functions:

void Order_Close( string Col)

{ bool OrdClose = OrderClose(OrderTicket(),1.0,Bid,1.0,Col); }

 

Result: Mistake  implicit Conversion from string to number.

How is the correct Code under MQL 4 ? 

Keith Watford
Moderator
8017
Keith Watford 2015.08.04 09:01  
 color Col = clrGreen;

//-----
void Order_Close( color Col) 
You don't set colour with a string
Achim Rogalski
61
Achim Rogalski 2015.08.05 09:01  

Thank you, GumRai. That was a good advice.

Greetings from Germany, Hamburg.

/
To add comments, please log in or register