This indicator will show you where expected earnings should hit. I use it on a daily and mark out the lines because I day trade and don't want more indicators on my charts. It also has spread predictions for those of you who are above my brain capacity at the moment.
Speaking with the person I received it from it will either go up to that line or down depending on markets reactions to earnings, no in between.
I watched it and it seemed to even go past some of the earning predictions. Kind of dig it. There are hints within the script.
Speaking with the person I received it from it will either go up to that line or down depending on markets reactions to earnings, no in between.
I watched it and it seemed to even go past some of the earning predictions. Kind of dig it. There are hints within the script.
thinkScript Code
Code:
input price = close;
input aggregationPeriod = AggregationPeriod.DAY;
def onExpansion = if IsNaN(close) then yes else no;
#third friday calc
def series = 1;
Assert(series > 0, "'series' must be positive: " + series);
def showonlytoday = yes;
def CurrentYear = GetYear();
def CurrentMonth = GetMonth();
def CurrentDOM = GetDayOfMonth(GetYYYYMMDD());
def Day1DOW1 = GetDayOfWeek(CurrentYear * 10000 + CurrentMonth * 100 + 1);
def FirstFridayDOM1 = if Day1DOW1 < 6
then 6 - Day1DOW1
else if Day1DOW1 == 6
then 7
else 6;
def RollDOM = FirstFridayDOM1 + 14;
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 = FirstFridayDOM + 14;
def N3rdF = if IsNaN(close) then Double.NaN else DaysTillDate(ExpYear * 10000 + ExpMonth2 * 100 + ExpDOM);
def "exiprationdate" = (ExpYear * 10000 + ExpMonth2 * 100 + ExpDOM);
def expirationdate = "exiprationdate";
##Defining Front month
def call = close(getATMOption(GetUnderlyingSymbol(), expirationdate + 1, OptionClass.CALL));
def put = close(getATMOption(GetUnderlyingSymbol(), expirationdate + 1, OptionClass.PUT));
rec closeSymbolWithOutNaN = CompoundValue(1, if IsNaN(call) then closeSymbolWithOutNaN[1] else call, call);
rec closeSymbolWithOutNaN1 = CompoundValue(1, if IsNaN(put) then closeSymbolWithOutNaN1[1] else put, put);
def "Put + Call" = closeSymbolWithOutNaN + (closeSymbolWithOutNaN1 );
def moveup = "Put + Call" + close;
def movedown = close - "Put + Call";
def day = GetDay();
def lastDay = GetLastDay();
def isToday = If(day == lastDay, 1, 0);
def show_Plot = If(showonlytoday and isToday, 1, If(!showonlytoday, 1, 0));
def Last_Close = if show_Plot and !IsNaN(close(period = aggregationPeriod)[-1])
then price else Double.NaN;
rec lastprice = CompoundValue(1, if IsNaN(close) then lastprice[1] else close, close);
def a = if HasEarnings() then GetYYYYMMDD() else Double.NaN;
def b = if GetYYYYMMDD() == a then lastprice else Double.NaN;
def d = if onExpansion then b else Double.NaN;
#making an earnings target
plot Bullseye = b;
Bullseye.HideTitle();
Bullseye.HideBubble();
Bullseye.SetPaintingStrategy(PaintingStrategy.POINTS);
Bullseye.AssignValueColor(Color.RED);
plot WhiteBullseye = b;
WhiteBullseye.HideTitle();
WhiteBullseye.HideBubble();
WhiteBullseye.SetPaintingStrategy(PaintingStrategy.POINTS);
WhiteBullseye.AssignValueColor(Color.WHITE);
WhiteBullseye.SetLineWeight(5);
rec moveonup = CompoundValue(1, if IsNaN(moveup) then moveonup[1] else moveup, moveup);
plot "Front Month Range Up" = if onExpansion then moveonup else Double.NaN;
"Front Month Range Up".SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
"Front Month Range Up".AssignValueColor(Color.WHITE);
"Front Month Range Up".HideTitle();
rec moveondown = CompoundValue(1, if IsNaN(movedown) then moveondown[1] else movedown, movedown);
plot "Front Month Range Down" = if onExpansion then moveondown else Double.NaN;
"Front Month Range Down" .SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
"Front Month Range Down" .AssignValueColor(Color.WHITE);
"Front Month Range Down" .HideTitle();
def hasearnings = if HasEarnings() then GetYYYYMMDD() else Double.NaN;
plot "Front Month Range Up Dot" = if GetYYYYMMDD() == hasearnings then "Front Month Range Up" else Double.NaN;
"Front Month Range Up Dot".SetPaintingStrategy(PaintingStrategy.POINTS);
"Front Month Range Up Dot" .AssignValueColor(Color.WHITE);
"Front Month Range Up Dot".SetLineWeight(4);
"Front Month Range Up Dot".HideTitle();
plot "Front Month Range down Dot" = if GetYYYYMMDD() == hasearnings then "Front Month Range Down" else Double.NaN;
"Front Month Range down Dot" .SetPaintingStrategy(PaintingStrategy.POINTS);
"Front Month Range down Dot" .AssignValueColor(Color.WHITE);
"Front Month Range down Dot" .SetLineWeight(4);
"Front Month Range down Dot" .HideTitle();
##next month
def NextCallOption = close( getNextExpirationOption((getATMOption(GetUnderlyingSymbol(), expirationdate + 1, OptionClass.CALL))));
rec nextmonthcalloption = CompoundValue(1, if IsNaN(NextCallOption) then nextmonthcalloption[1] else NextCallOption, NextCallOption);
def NextPutOption = close(getNextExpirationOption((getATMOption(GetUnderlyingSymbol(), expirationdate + 1, OptionClass.PUT))));
rec nextmonthputoption = CompoundValue(1, if IsNaN(NextPutOption) then nextmonthputoption[1] else NextPutOption, NextPutOption);
def nextstraddleprice = nextmonthcalloption + nextmonthputoption ;
def volcrush = (put + call) - nextstraddleprice;
def nextstraddlerangeup = price + nextstraddleprice;
def nextstraddlerangedown = price - nextstraddleprice;
rec nextmoveondown = CompoundValue(1, if IsNaN(nextstraddlerangedown) then nextmoveondown[1] else nextstraddlerangedown, nextstraddlerangedown);
plot "Next Month Straddle Down" = if onExpansion then nextmoveondown else Double.NaN;
"Next Month Straddle Down" .SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
"Next Month Straddle Down" .AssignValueColor(Color.CYAN);
"Next Month Straddle Down" .HideTitle();
rec nextmoveonUp = CompoundValue(1, if IsNaN(nextstraddlerangeup) then nextmoveonUp[1] else nextstraddlerangeup, nextstraddlerangeup);
plot "Next Month Straddle Up" = if onExpansion then nextmoveonUp else Double.NaN;
"Next Month Straddle Up" .SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
"Next Month Straddle Up".AssignValueColor(Color.CYAN);
"Next Month Straddle Up".HideTitle();
#chartlabels
AddLabel(yes, Concat(Concat(Concat("Front Month Straddle: ", (getATMOption(GetUnderlyingSymbol(), expirationdate + 1, OptionClass.CALL))), " / "), (getATMOption(GetUnderlyingSymbol(), expirationdate + 1, OptionClass.PUT))), (Color.WHITE));
AddLabel(yes, Concat("Front Straddle Price: ", "Put + Call") , (Color.WHITE));
AddLabel(yes, Concat(Concat(Concat("Next Month Straddle: ", getNextExpirationOption((getATMOption(GetUnderlyingSymbol(), expirationdate + 1, OptionClass.CALL)))), " / "), getNextExpirationOption((getATMOption(GetUnderlyingSymbol(), expirationdate + 1, OptionClass.PUT)))), (Color.CYAN));
AddLabel(yes, Concat("Next Month Straddle Price: ", nextstraddleprice) , (Color.CYAN));
#hint: <b>Dalke's Earnings Indicator</b>\n\n This study calls the ATM Options for the regular front month and next month's option chain. The straddle is priced and overlayed on the chart to show option's short straddle pricing as a move. The next month's short straddle is priced as well.
Shareable Link
https://tos.mx/fYx7yxFVideo Tutorial
Last edited by a moderator: