An if then with 2 equation
i tried a variation of the close open difference, but I can't get it to draw x.
The logic is if the current open is more than 2 points from previous close then x is open +1 if current open is less than previous close and open -1 if current open is greater than precious close
Now do these have to be 2 different if then else statements and can these be converted to Ternary operator.
I tried the following but it did not work.
i tried a variation of the close open difference, but I can't get it to draw x.
The logic is if the current open is more than 2 points from previous close then x is open +1 if current open is less than previous close and open -1 if current open is greater than precious close
PHP Code:
if (close(-1) - open(0) >= 2){
x = open(0) +1;
}
if (open(0) - close (-1) >= 2){
x = open(0) -1;
}else{
x= null;
}
I tried the following but it did not work.
PHP Code:
x = open(0) - close(-1) >= 2 ? open(0) - 1 : null;
x = close(-1) - open (0) >=2 ? open(0) + 1: null;
Comment