Implied Move Based on Weekly Options for ThinkorSwim

markos

markos

Well-known member
VIP
Implied or Expected Move Based on Weekly Options - Per the Picture, this can be used Intraday.

https://tos.mx/bbVk7y



Code:
# Weekly Options Implied Volatility Plotted intraday
# Mobius 
# Chat Room Request
# 02.27.2016

declare Once_Per_Bar;

input series = 1;
input show_label = yes;
input Days_In_Contract = 0;
Assert(series > 0, "'series' must be positive: " + series);

def RTHopen = open(period = AggregationPeriod.Day);
def CurrentYear = GetYear();
def CurrentMonth = GetMonth();
def CurrentDOM = GetDayOfMonth(GetYYYYMMDD());
def Day1DOW1 = GetDayOfWeek(CurrentYear * 10000 + CurrentMonth * 100 + 1); # First DOM is this DOW
def FirstFridayDOM1 = if Day1DOW1 < 6
    then 6 - Day1DOW1
    else if Day1DOW1 == 6
         then 7
         else 6;

def SecondFridayDOM = FirstFridayDOM1 + 7;
def ThirdFridayDOM = FirstFridayDOM1 + 14;
def FourthFridayDOM = FirstFridayDOM1 + 21;
def RollDOM = FirstFridayDOM1 + 21; #14; changed to 21 to pick up all Fridays of the current month for weekly options
def ExpMonth1 = if RollDOM > CurrentDOM
    then CurrentMonth + series - 1
    else CurrentMonth + series;
def ExpMonth2 = if ExpMonth1 > 12
    then ExpMonth1 - 12
    else ExpMonth1;

def ExpYear = if ExpMonth1 > 12
    then CurrentYear + 1
    else CurrentYear;

def Day1DOW = GetDayOfWeek(ExpYear * 10000 + ExpMonth2 * 100 + 1);
def FirstFridayDOM = if Day1DOW < 6
    then 6 - Day1DOW
    else if Day1DOW == 6
         then 7
         else 6;

def ExpDOM = if currentDOM < FirstFridayDOM -1
    then FirstFridayDOM1
    else if between(currentDOM, FirstFridayDOM, SecondFridayDOM-1)
         then SecondFridayDOM
         else if between(currentDOM, SecondFridayDOM, ThirdFridayDOM-1)
              then ThirdFridayDOM
              else if between(currentDOM, ThirdFridayDOM, FourthFridayDOM-1)
                   then FourthFridayDOM
                   else FirstFridayDOM;

def NextFriday = DaysTillDate(ExpYear * 10000 + ExpMonth2 * 100 + ExpDOM);
def ExpirationDate = GetYYYYMMDD() + NextFriday;
def ExpData = (ExpirationDate / 1) + 1;
def yr = Round(GetYear() / 100, 0);
def yr2 = GetYear() - 2000;
def OptionDateString = ExpYear * 10000 + ExpMonth2 * 100 + ExpDOM + 1;
def ATMCprice = if isNaN(close(symbol = GetATMOption(GetUnderlyingSymbol(), OptionDateString, OptionClass.CALL)))

    then ATMCprice[1]

    else close(symbol = GetATMOption(GetUnderlyingSymbol(), OptionDateString, OptionClass.CALL));

def HPD = if Days_In_Contract == 0 #HPD = Holding Period Days

    then NextFriday

    else Days_In_Contract;

def t = HPD / 365;

def ClosedForm_IV_est = if isNaN(((ATMCprice[1] * Sqrt(2 * Double.Pi)) / (RTHopen * Sqrt(t))))
                        then ClosedForm_IV_est[1]
                        else ((ATMCprice * Sqrt(2 * Double.Pi)) / (RTHopen * Sqrt(t)));

def Intraday_IV = if ClosedForm_IV_est > 0 then ClosedForm_IV_est else double.nan;
def ImpMove = Round((close[1] * Intraday_IV / Sqrt(365)) / tickSize(), 0) * tickSize();
plot upper = RTHopen + ImpMove[1];
plot lower = RTHopen - ImpMove[1];

upper.SetStyle(Curve.Firm);
upper.SetDefaultColor(Color.Cyan);
lower.SetStyle(Curve.Firm);
lower.SetDefaultColor(Color.Cyan);

def ActualMove = close[1] - RTHopen;

AddLabel(show_label and IsOptionable(), "ATM Call option is " +
         GetATMOption(GetUnderlyingSymbol(), OptionDateString, OptionClass.CALL) + 
       " Price = $" + 
         ATMCprice + 
      "  Intraday IV = " + 
         AsPercent(ClosedForm_IV_est) +
      "  Implied Move = +- " +
         AsDollars(ImpMove) +
      "  Actual Move = " +
         AsDollars(ActualMove)
, if close > RTHopen then color.green else color.red);

# End Code Weekly Options
 
E

ext99k

Member
The implied move and the actual moves, anyone know how to include the % beside each one? Thank you!
 
M

maddy

New member
VIP
If you trade options and don't have a way of knowing how the market it pricing them, you may be missing out!
Hi Markos,

Thanks for sharing this. Could you please let us how to use this?
 
markos

markos

Well-known member
VIP
Hi Markos,

Thanks for sharing this. Could you please let us how to use this?
@maddy sorry I missed this. It tells me how much the options market expects a stock to move. Per the math they are supposed to be corect 68% of the time at 1 standard deviation. @BenTen or someone else that day trades would have to help further.
 
markos

markos

Well-known member
VIP
First off, I'd like to say interesting chart. On another note, can you explain how it works? I would love to know and utilize it on a daily basis.
@Money_Maker put this in the questions forum with a little more detail. Try the search bar above as well. Try "Expected Move".
 
A

alphabeta

Member
Implied or Expected Move Based on Weekly Options - Per the Picture, this can be used Intraday.

https://tos.mx/bbVk7y



Code:
# Weekly Options Implied Volatility Plotted intraday
# Mobius
# Chat Room Request
# 02.27.2016

declare Once_Per_Bar;

input series = 1;
input show_label = yes;
input Days_In_Contract = 0;
Assert(series > 0, "'series' must be positive: " + series);

def RTHopen = open(period = AggregationPeriod.Day);
def CurrentYear = GetYear();
def CurrentMonth = GetMonth();
def CurrentDOM = GetDayOfMonth(GetYYYYMMDD());
def Day1DOW1 = GetDayOfWeek(CurrentYear * 10000 + CurrentMonth * 100 + 1); # First DOM is this DOW
def FirstFridayDOM1 = if Day1DOW1 < 6
    then 6 - Day1DOW1
    else if Day1DOW1 == 6
         then 7
         else 6;

def SecondFridayDOM = FirstFridayDOM1 + 7;
def ThirdFridayDOM = FirstFridayDOM1 + 14;
def FourthFridayDOM = FirstFridayDOM1 + 21;
def RollDOM = FirstFridayDOM1 + 21; #14; changed to 21 to pick up all Fridays of the current month for weekly options
def ExpMonth1 = if RollDOM > CurrentDOM
    then CurrentMonth + series - 1
    else CurrentMonth + series;
def ExpMonth2 = if ExpMonth1 > 12
    then ExpMonth1 - 12
    else ExpMonth1;

def ExpYear = if ExpMonth1 > 12
    then CurrentYear + 1
    else CurrentYear;

def Day1DOW = GetDayOfWeek(ExpYear * 10000 + ExpMonth2 * 100 + 1);
def FirstFridayDOM = if Day1DOW < 6
    then 6 - Day1DOW
    else if Day1DOW == 6
         then 7
         else 6;

def ExpDOM = if currentDOM < FirstFridayDOM -1
    then FirstFridayDOM1
    else if between(currentDOM, FirstFridayDOM, SecondFridayDOM-1)
         then SecondFridayDOM
         else if between(currentDOM, SecondFridayDOM, ThirdFridayDOM-1)
              then ThirdFridayDOM
              else if between(currentDOM, ThirdFridayDOM, FourthFridayDOM-1)
                   then FourthFridayDOM
                   else FirstFridayDOM;

def NextFriday = DaysTillDate(ExpYear * 10000 + ExpMonth2 * 100 + ExpDOM);
def ExpirationDate = GetYYYYMMDD() + NextFriday;
def ExpData = (ExpirationDate / 1) + 1;
def yr = Round(GetYear() / 100, 0);
def yr2 = GetYear() - 2000;
def OptionDateString = ExpYear * 10000 + ExpMonth2 * 100 + ExpDOM + 1;
def ATMCprice = if isNaN(close(symbol = GetATMOption(GetUnderlyingSymbol(), OptionDateString, OptionClass.CALL)))

    then ATMCprice[1]

    else close(symbol = GetATMOption(GetUnderlyingSymbol(), OptionDateString, OptionClass.CALL));

def HPD = if Days_In_Contract == 0 #HPD = Holding Period Days

    then NextFriday

    else Days_In_Contract;

def t = HPD / 365;

def ClosedForm_IV_est = if isNaN(((ATMCprice[1] * Sqrt(2 * Double.Pi)) / (RTHopen * Sqrt(t))))
                        then ClosedForm_IV_est[1]
                        else ((ATMCprice * Sqrt(2 * Double.Pi)) / (RTHopen * Sqrt(t)));

def Intraday_IV = if ClosedForm_IV_est > 0 then ClosedForm_IV_est else double.nan;
def ImpMove = Round((close[1] * Intraday_IV / Sqrt(365)) / tickSize(), 0) * tickSize();
plot upper = RTHopen + ImpMove[1];
plot lower = RTHopen - ImpMove[1];

upper.SetStyle(Curve.Firm);
upper.SetDefaultColor(Color.Cyan);
lower.SetStyle(Curve.Firm);
lower.SetDefaultColor(Color.Cyan);

def ActualMove = close[1] - RTHopen;

AddLabel(show_label and IsOptionable(), "ATM Call option is " +
         GetATMOption(GetUnderlyingSymbol(), OptionDateString, OptionClass.CALL) +
       " Price = $" +
         ATMCprice +
      "  Intraday IV = " +
         AsPercent(ClosedForm_IV_est) +
      "  Implied Move = +- " +
         AsDollars(ImpMove) +
      "  Actual Move = " +
         AsDollars(ActualMove)
, if close > RTHopen then color.green else color.red);

# End Code Weekly Options
hi greak study is it possible to get at the money implied volatility change like market chameleon and implied volatility movers thank you
 
A

alphabeta

Member
is it possible to get percentage change of implied move from yesterday thank you
 
P

premiumseller

New member
I'm new to the platform and apologies if this was asked before.

Is there an indicator to calculate 1 day, 1 week, 1 month standard deviation based on Implied Volatility?

Thanks
 

Similar threads

Top