# option_stop_price_01
# https://usethinkscript.com/threads/how-can-i-determine-what-the-stock-price-is-compared-to-the-option-price.12446/
# How can I determine what the Stock price is compared to the option price?
# METAL 8/31 #1
# I hope I am asking this clearly. When I have two charts, One with the Option Call/Put and i have the stock on other chart, When I am trying to determine a good SL point based off the Stock chart, How do I know where that price is on the Options chart? I am using Active Trader at the moment and was wandering if there is a clear way to figure this out. Thanks in advance.
# declare lower;
# wmt #132.60 on 8/31
input underlying = "WMT";
#def stock_price = close;
def stock_price = close(underlying);
addlabel(1, " ", color.black);
addlabel(1, underlying, color.yellow);
addlabel(1, "stock $ " + round(stock_price, 2), color.yellow);
input strike = 132.0;
input expiration_date = 20220916;
input is_put = no;
#input interest_rate = 0.06;
input interest_rate = 0.01;
input yield = 0.0;
input is_european = no;
def iv;
if GetAggregationPeriod() < AggregationPeriod.DAY {
iv = imp_volatility(underlying, AggregationPeriod.DAY);
} else {
iv = imp_volatility(underlying);
}
# actual
plot TheoOptPrice = OptionPrice(strike, is_put, DaysTillDate(expiration_date), stock_price, iv, is_european, yield, interest_rate);
TheoOptPrice.setdefaultcolor(color.yellow);
# +- stop loss
input stk_stop_loss = 132.0;
addlabel(1, " ", color.black);
addlabel(1, "stoploss " + stk_stop_loss, color.cyan);
def stk_price2 = stk_stop_loss;
plot TheoOptPrice2 = OptionPrice(strike, is_put, DaysTillDate(expiration_date), stk_price2, iv, is_european, yield, interest_rate);
TheoOptPrice2.setdefaultcolor(color.cyan);
#