How to make a string alert based on a enum?

To add comments, please log in or register
Fernando Jose Velasco Borea
705
Fernando Jose Velasco Borea  

I'm learning MQL4 and I'm developing a simple script that tells you the TP and SL price when you set it on pips (If you set 10 pip TP it tells you where to put it)

I want to add an alert telling wether its a buy or a sell but it keeps giving me 0 or 1

The enum part its like this:

enum OperationType
      {
         Buy, // Buy
         Sell // Sell
      };
input OperationType Type = Buy;

And the alert is like this:

Alert("The trade type is ", Type);

//Also tried this

Alert("The trade type is " + Type);

//And this

Alert ("The trade type is " + string(Type);

But in all versions of the alert code it still throws 0 or 1. Any suggestions? (Please don't be too technical on the answer as I'm learning).


Best regards,

Fernando.

Alain Verleyen
36123
Alain Verleyen  
EnumToString()
Fernando Jose Velasco Borea
705
Fernando Jose Velasco Borea  
Alain Verleyen:
EnumToString()

It would be something like this?

Alert("The trade type is " EnumToString(Type));
To add comments, please log in or register