How can I transfer a Color into a function ?

Back to topics list To post a new topic, please log in or register
avatar
18
24hworker 2015.08.04 09: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 ? 

 

avatar
Moderator
3418
GumRai 2015.08.04 11:01 #
 
 color Col = clrGreen;

//-----
void Order_Close( color Col) 
You don't set colour with a string
avatar
18
24hworker 2015.08.05 11:01 #
 

Thank you, GumRai. That was a good advice.

Greetings from Germany, Hamburg.

Back to topics list  

To add comments, please log in or register