Many IF and the rest an ELSE

 

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.

   string words = StringSubstr(_Symbol, StringLen(_Symbol) - 4, -1);

   if (words=="US-d")
   // do something with this

   else if ( words=="GE-d" || words =="IT-d" || words =="FR-d" || (words =="BE-d") || (words =="PO-d") || (words =="NE-d") || (words =="ES-d")) 
   // do something with this

   else if (words =="UK-d") 
   // do something with this

   else
   // do something with this
 
  1. Help you with what? You didn't ask a question.
  2. There is no ELSEIF but you already know the equivalent: "else if"