cpickens:
Too theoretical question... maybe a pseudo-code or more explanation about your exactly doubt? Is your problem about raw code itself or conceptual separation of "objects of decision" / event-driven decisions?
I need some help. I want to setup a If then type of situation.
I'm trying to setup a situation where I get a signal from a indicator to buy or sell then I want another set of conditions met before a trade is open regardless of how many candles it takes to happen. I know how to write a if situation but not a if then, if that's possible. Any help would be appreciated or if you can direct me to a link where I can read up in this.
Thanks
cpickens: I need some help. I want to setup a If then type of situation. I'm trying to setup a situation where I get a signal from a indicator to buy or sell then I want another set of conditions met before a trade is open regardless of how many candles it takes to happen. I know how to write a if situation but not a if then, if that's possible. Any help would be appreciated or if you can direct me to a link where I can read up in this.
//--- The else part refers to the second if operator: if(x>1) if(y==2) z=5; else z=6; //--- The else part refers to the first if operator: if(x>l) { if(y==2) z=5; } else z=6; //--- Nested operators if(x=='a') { y=1; } else if(x=='b') { y=2; z=3; } else if(x=='c') { y=4; } else Print("ERROR");
Documentation on MQL5: Language Basics / Operators / Conditional Operator if-else
- www.mql5.com
If the expression is true, operator1 is executed and control is given to the operator that follows operator2 (operator2 is not executed). If the expression is false, operator2 is executed.
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
I need some help. I want to setup a If then type of situation.
I'm trying to setup a situation where I get a signal from a indicator to buy or sell then I want another set of conditions met before a trade is open regardless of how many candles it takes to happen. I know how to write a if situation but not a if then, if that's possible. Any help would be appreciated or if you can direct me to a link where I can read up in this.
Thanks