Earthian
Member
Code:
plot data = if IsPut() then ceil(gamma() * -100 * open_interest ()) else ceil(gamma() * 100 * open_interest());
assignbackgroundcolor (if absvalue(data) > 200000 then CreateColor(136, 8, 8) else if AbsValue(data) > 100000 then CreateColor(170, 74, 68) else if absvalue(data) > 2000 then createcolor(250, 160, 160) else color.gray);
data.assignvaluecolor(if AbsValue(data) > 100000 then color.yellow else if AbsValue(data) > 100 then color.black else color.current);
Any idea if it's possible to sum the call side calculation and put side calculation in an option chain column? For instance, in the above, I would like to have something like below accomplished, but I am not think through it correct.
call_gamma_exposure = call_gamma * call_open_interest * 1;
put_gamma_exposure = put_gamma * put_open_interest * -1;
plot data = call_gamma_exposure + put_gamma_exposure;
Any help is much appreciated!
Last edited by a moderator: