multiple if statements

To add comments, please log in or register
SirFency
173
SirFency  

When I have multiple if statements, will the if statements after the first true if statement run?


      //Signals to purchase or sell the EURGBP
//Let's say this bit is true      
      if(((perGBP - perEUR) > gap) && (((Close[i+1] < previousK) < previousD)) && currentK > currentD && currentD < 20)
        {
         uparrow[i] = Close[i];
         Print("Buy EURGBP");
        }
      if((perEUR - perGBP) > gap && (((Close[i+1] > previousK)  >previousD)) && currentK < currentD && currentD > 80)
        {
         downarrow[i] = Close[i];
         Print("Sell EURGBP");
        }

      //Signals to purchase or sell the EURAUD
//Will this bit run or has the program stopped?      
      if(perAUD - perEUR > gap && Close[i+1] < previousK < previousD && currentK > currentD && currentD < 20)
        {
         uparrow[i] = Close[i];
         Print("Buy EURAUD");
        }
      if(perEUR - perAUD > gap && Close[i+1] > previousK  >previousD && currentK < currentD && currentD > 80)
        {
         downarrow[i] = Close[i];
         Print("Sell EURAUD");
        }
SirFency
173
SirFency  
I adjusted some math to force it to run and it appears to run through all the statements just fine.
kypa
1079
kypa  

They will run, if you don't want some of them to (after one 'if' is true) insert return/return(o).

To add comments, please log in or register