Quote:
|
Originally Posted by iscuba11
This is a simple question. I am not well versed in MQ4 language.
How can I change a statement from:
if (OsMA Previous > OsMAPrevious 2) OsMADirection = 1
To: (OsMA Previous > OsMAPrevious 2) OsMADirection = Bullish ??
Is it as simple as putting quotations around Bullish. Your simple advice is appreciated.
Dave
<><<<
|
hi Dave if you are intending to use strings then OsmaDirection will also be a string .
string Bullish;
string Bearish;
string OsMADirection = "";
double OSMAPREVIOUS,OSMAPREVIOUS2;
-- your code.....
now you could say
if (OsMA Previous > OsMAPrevious 2) OsMADirection = Bullish;
else if(OSMA Previous < OsmaPrevious2) OsMADirection = Bearish;
Keep in mind OsMADirection is a string which means you can only use it with other string variables there are other ways to convert between variables but i think you are not asking for that.
regards
EACAN.