Adjustable implied daily move lines

roscopt1223

New member
So I'm still pretty new to trying to actually write code and I've become pretty frustrated going through other scripts on here and trying to adjust code to fit what I want. So as result I'm just going to ask and reach out and see if someone has something for this. I imagine this should be a very easy script to write which only has fueled my frustration. I am subscribed to SpotGamma.com, and on their daily stats they give an estimated daily percentage move on the SPX, which I don't entirely trade from for any hard lines or anything but I have found that for the most part it is reliable on most days as an estimate and they even state that it is an estimate only. This percentage changes daily, and goes off mainly where the VIX is at, and is only applicable at the open. That stated, I have to quickly do the math which isn't hard but just consumes time I would like to not spend waiting for the open to calculate the opening price and then add my high and low lines for the day based on the estimated percentage they give. I trade mostly the XSP, but also watch /ES, and would like the this code to work on any index or chart. So basically I need an indicator that I can possibly even set up before the open obviously the lines would only populate upon open but would immediately show up as soon as the index opens based on the percentage I put into the adjustable parameters for that day. The only adjustable portion I would need would be the percentage of move based on the opening price, and possibly the line colors and maybe even thickness/type. Sounds simple but for someone like myself it has led to a lot of frustration. Any help on this would be immensely appreciated and I would be incredibly grateful for any help with this.
 
first study I have posted here, give this a whirl!

#BOGART |
#Expected Move/Range Input
|
#on the edit script menu type in the expected move +- from the options chain. |
#change inputs for Expected Move Plus-Expected Move Minus value as needed for each ticker. |
#Two Ticker ranges included in this study, available to turn both on or off. |
#Also, ranges are only shown on specified tickers when you change charts. |
#Viewable on multiple timeframes. |
#Switch between open or close prices as the starting range value. |
#Select date you want to view the open or close from. |
#----------------------------------------------------------------------------------------------


#
def period = AggregationPeriod.day;
#


#-------------------------------------lookback
def plotlimit = 1;
def lookback = 0;
def bn = BarNumber();
def lastbn = HighestAll(
if !IsNaN(close) and IsNaN(close[-1])
then bn
else Double.NaN);



#---------------------------------------(Range1. Input Values for Expected Move Lines +- )

#showTicker1
input show_em_ticker1 = yes;
#


#Ticker
input ticker1 = "SPY";
def tickerone= ticker1==getsymbol();
#-----------------------------------------------------

#Switch open or close as the value starting point.
input open_or_close = {default "open", "close"};
def valuestart;
switch (open_or_close ) {
case open:
valuestart = open(period = period);
case close:
valuestart = close(period = period);
}
#-----------------------------------------------------

#Choose date for starting value based on close
input priceAtDate = 20220722;
def date = if GetYYYYMMDD() == priceAtDate then valuestart else date[1];
def dateclose = date;

#or choose to input your own starting value by unhashtagging this, and edit dateclose in defs below.
#input value_start_point = .01;
#-----------------------------------------------------



input expected_move_plus = .01 ;
input expected_move_minus = .01;
def emplusfromclose = dateclose + expected_move_plus; #
def emminusfromclose = dateclose - expected_move_minus; #
plot EMplus = if tickerone and show_em_ticker1 and Between(bn, lastbn - lookback, lastbn - lookback + plotlimit) then emplusfromclose else double.nan;#emplusfromclose;
plot EMminus = if tickerone and show_em_ticker1 and Between(bn, lastbn - lookback, lastbn - lookback + plotlimit) then emminusfromclose else double.nan; #emminusfromclose;
EMplus.SetStyle(Curve.LONG_DASH);
emplus.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
EMplus.SetLineWeight(3);
EMplus.SetDefaultColor(Color.dark_orange);
EMplus.HideTitle();
EMminus.SetStyle(Curve.LONG_DASH);
emminus.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
EMminus.SetLineWeight(3);
EMminus.SetDefaultColor(Color.dark_orange);
EMminus.HideTitle();




#---------------------------------------(Range 2. Input Values for Expected Move Lines +- )
#input Spacer for ease of viewing.
input _ = "-Enter 2nd Ticker Range Below-";
#

#ShowTicker2
input show_em_ticker2 = yes;
#

#Ticker
input ticker2 = "F";
def tickertwo= ticker2==getsymbol();
#-----------------------------------------------------

#Switch open or close as the value starting point.
input open_or_close2 = {default "open2", "close2"};
def valuestart2;
switch (open_or_close2 ) {
case open2:
valuestart2 = open(period = period);
case close2:
valuestart2 = close(period = period);
}
#-----------------------------------------------------


#Choose date for starting value based on close
input priceAtDate2 = 20220722;
def date2 = if GetYYYYMMDD() == priceAtDate2 then valuestart2 else date2[1];
def dateclose2 = date2;

#or choose to input your own starting value by unhashtagging this, and edit dateclose in defs below.
#input value_start_point2 = .01;
#-----------------------------------------------------


input expected_move_plus2 = .01;
input expected_move_minus2 = .01;
def emplusfromclose2 = dateclose2 + expected_move_plus2; #value_start_point
def emminusfromclose2 = dateclose2 - expected_move_minus2; #
plot EMplus2 = if tickertwo and show_em_ticker2 and Between(bn, lastbn - lookback, lastbn - lookback + plotlimit) then emplusfromclose2 else double.nan;#emplusfromclose;
plot EMminus2 = if tickertwo and show_em_ticker2 and Between(bn, lastbn - lookback, lastbn - lookback + plotlimit) then emminusfromclose2 else double.nan; #emminusfromclose;
EMplus2.SetStyle(Curve.long_DASH);
emplus2.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
EMplus2.SetLineWeight(3);
EMplus2.SetDefaultColor(Color.dark_orange);
EMplus2.HideTitle();
EMminus2.SetStyle(Curve.long_DASH);
emminus2.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
EMminus2.SetLineWeight(3);
EMminus2.SetDefaultColor(Color.dark_orange);
EMminus2.HideTitle();




#---------------------------------------------------------------------
 
So I'm still pretty new to trying to actually write code and I've become pretty frustrated going through other scripts on here and trying to adjust code to fit what I want. So as result I'm just going to ask and reach out and see if someone has something for this. I imagine this should be a very easy script to write which only has fueled my frustration. I am subscribed to SpotGamma.com, and on their daily stats they give an estimated daily percentage move on the SPX, which I don't entirely trade from for any hard lines or anything but I have found that for the most part it is reliable on most days as an estimate and they even state that it is an estimate only. This percentage changes daily, and goes off mainly where the VIX is at, and is only applicable at the open. That stated, I have to quickly do the math which isn't hard but just consumes time I would like to not spend waiting for the open to calculate the opening price and then add my high and low lines for the day based on the estimated percentage they give. I trade mostly the XSP, but also watch /ES, and would like the this code to work on any index or chart. So basically I need an indicator that I can possibly even set up before the open obviously the lines would only populate upon open but would immediately show up as soon as the index opens based on the percentage I put into the adjustable parameters for that day. The only adjustable portion I would need would be the percentage of move based on the opening price, and possibly the line colors and maybe even thickness/type. Sounds simple but for someone like myself it has led to a lot of frustration. Any help on this would be immensely appreciated and I would be incredibly grateful for any help with this.

if you can do the math, then post the formulas you use.
 
Is there a way to pull the +- from the option chain? file:///var/folders/rf/r_g2771n54787g_kznq2pzmw0000gn/T/com.apple.Safari/WebKitDropDestination-M8DoLrIa/Screen%20Shot%202022-07-25%20at%208.13.04%20AM.png

sorry, i don't know what you are asking.
the image link don't work, probably need a login.

this will return the sign of a number
https://tlc.thinkorswim.com/center/reference/thinkScript/Functions/Math---Trig/Sign


here is how to post an image
https://usethinkscript.com/threads/how-to-insert-image-in-a-post-thread.277/
go to some other image hosting site , like www.imgur.com and create an account.
save your image to that site
copy a bb link
paste the link in your post here
 
sorry, i don't know what you are asking.
the image link don't work, probably need a login.

this will return the sign of a number
https://tlc.thinkorswim.com/center/reference/thinkScript/Functions/Math---Trig/Sign


here is how to post an image
https://usethinkscript.com/threads/how-to-insert-image-in-a-post-thread.277/
go to some other image hosting site , like www.imgur.com and create an account.
save your image to that site
copy a bb link
paste the link in your post here
Trying to figure out how they calculate this implied move, to automate the inputs instead of manually entering the +- value.
 
Spotgamma uses their own propietary info so I don't have a formula. Here is a screen shot of what they would post for the day given their data. I just need to plug their estimated % move in before the open so that there are 2 lines that show up based off of that percentage and the open as soon as the market opens. Hold on let me see if I can do a screen shot real quick.


So where you see the Spotgamma Implied 1 day move % is the number % I need to plug into the indicator before open. I'm not basing this off of any formulas I come up with. These guys have a ton of ppl to do all of that I pay under $300/month for their data that's all I need. I've been with them for about a year and their levels combined with the daily implied move along with their HIRO indicator is enough for me and has been pretty spot on so far. I gave up a lot of searching for technical analysis after finding them and doing other stuff. Seems like a lot of ppl that do a lot of TA on their own are in the end tracking hedging via options flows from institutions and market makers. Those are the only people that are capable of actually moving the entire market and or market makers hedging positions and constantly adjusting hedges due to gamma, delta, vanna, IV, etc, changing when the market moves either way and or expirations.
 
Last edited:

Join useThinkScript to post your question to a community of 21,000+ developers and traders.

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

87k+ Posts
447 Online
Create Post

The Market Trading Game Changer

Join 2,500+ subscribers inside the useThinkScript VIP Membership Club
  • Exclusive indicators
  • Proven strategies & setups
  • Private Discord community
  • ‘Buy The Dip’ signal alerts
  • Exclusive members-only content
  • Add-ons and resources
  • 1 full year of unlimited support

Frequently Asked Questions

What is useThinkScript?

useThinkScript is the #1 community of stock market investors using indicators and other tools to power their trading strategies. Traders of all skill levels use our forums to learn about scripting and indicators, help each other, and discover new ways to gain an edge in the markets.

How do I get started?

We get it. Our forum can be intimidating, if not overwhelming. With thousands of topics, tens of thousands of posts, our community has created an incredibly deep knowledge base for stock traders. No one can ever exhaust every resource provided on our site.

If you are new, or just looking for guidance, here are some helpful links to get you started.

What are the benefits of VIP Membership?
VIP members get exclusive access to these proven and tested premium indicators: Buy the Dip, Advanced Market Moves 2.0, Take Profit, and Volatility Trading Range. In addition, VIP members get access to over 50 VIP-only custom indicators, add-ons, and strategies, private VIP-only forums, private Discord channel to discuss trades and strategies in real-time, customer support, trade alerts, and much more. Learn all about VIP membership here.
How can I access the premium indicators?
To access the premium indicators, which are plug and play ready, sign up for VIP membership here.
Back
Top