I have a short question about logic with "if" and "else if" please.
I´m confused now about logic in my scripts with "if" and "else if". I think it shouldn´t trigger the targets as I have done it, but it does.
if (flat)
{Variables...
SetStopLoss()}
else if (long)
{Variables..
SetStopLoss(Breakeven)}
if(Long && conditions1)
{ExitLong(1);}
if(Long && conditions2)
{ExitLong(2);}
Why does Exitlong work? Shouldn´t the reading of script in this region stop with executing what is in the "else if" statement? So, shouldnt the script only change setstoploss?
Thank you
Tony
Comment