How can I transfer a Color into a function ? New comment [Deleted] 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 ? Code from Indicator to EA - "WARNING" implicit conversion from 'number' to 'string' Conversion from String To Number Is there any function to show Positive & Negative Sign for numbers? Looking for best solution. Keith Watford 2015.08.04 09:01 #1 color Col = clrGreen; //----- void Order_Close( color Col) You don't set colour with a string [Deleted] 2015.08.05 09:01 #2 Thank you, GumRai. That was a good advice.Greetings from Germany, Hamburg. New comment
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 ?