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.
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.
This may work for what I need. I will try to incorporate.
Dave
<<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.
If u don't want to change the entire program u can do the following
at the start of the program put the line
#define Bullish 1
and everytime instead of using 1 as bullish u can just write Bullish instead
Eli
It worked!! Yaa Hoo! Have a blessed Sunday everybody!
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
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.