I want to do something IF the last values of the string "name of CFD" are something. The problem is for what I know in MQL5 there is no ELSEIF or ELIF. Basically I need to do something in case the last values are "US-d" , another in case is "GE-d" (or many others), another case is "UK-d" and in all other cases (there are many" do something else. Please help.
string words = StringSubstr(_Symbol, StringLen(_Symbol) - 4, -1);
if (words=="US-d")
// do something with thiselseif ( words=="GE-d" || words =="IT-d" || words =="FR-d" || (words =="BE-d") || (words =="PO-d") || (words =="NE-d") || (words =="ES-d"))
// do something with thiselseif (words =="UK-d")
// do something with thiselse// do something with this
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
Hello,
I want to do something IF the last values of the string "name of CFD" are something. The problem is for what I know in MQL5 there is no ELSEIF or ELIF. Basically I need to do something in case the last values are "US-d" , another in case is "GE-d" (or many others), another case is "UK-d" and in all other cases (there are many" do something else. Please help.