Hi all, I am trying to calculate level of trike price in option chain
ex: on the Call i try to find what is a strike price down 7 lines from the strike price ATM
or the Put what is the strike price goes back 7 lines from the strike price ATM
it looks like when you set top loss by select level instead % or +/-
what is a code to calculate a level in option chain?
this is a draft that I came up with
Any advice and suggestions would be greatly appreciated.
ex: on the Call i try to find what is a strike price down 7 lines from the strike price ATM
or the Put what is the strike price goes back 7 lines from the strike price ATM
it looks like when you set top loss by select level instead % or +/-
what is a code to calculate a level in option chain?
this is a draft that I came up with
Code:
input level = 7 and -7;
input DTE = (default 14, 20, 30); #number of day of period
def Symbol = underfying;
def Strike = getstrike();
plot output = if (isput level = -7) and (level = 7) and (DTE = 14) then 1 else 0;
assignBackgroundColor(if ouput == 1 then color.GREEN else color.CURRENT);
Any advice and suggestions would be greatly appreciated.