Options Gamma Study For ThinkOrSwim

Would it be possible to take the code below that I have on the options chain and build a lower study that would show the change in gamma for the highlighted Strikes for 0DTE? Even if I had to change the date each day in the code to get it to pull the data? I would want this for SPX and SPY so I could see change in gamma on the chart without having to open up the options chain. I view this every day to get an idea of the gamma wall that may be support or resistance. What I have noticed is that on the SPX if gamma is call heavy then it most likely goes up and those strikes are ITM at end of day. And on SPY just the opposite. Seems to be more of a contrarian indicator on SPY and a direction on SPX. But only 0DTE matters.

CODE
# Gamma Exposure at each strike is calculated by the formula option gamma * open interest * 100 (calls, x-100 for puts)

plot data = if IsPut() then gamma() * -100 * open_interest() else gamma() * 100 * open_interest();
assignbackgroundcolor(if AbsValue(data) > 2000 then createcolor(250,150,100) else color.black);
data.assignvaluecolor(if AbsValue(data) > 2000 then color.black else color.current);
15176[/ATTACH]']
Ua5aYVo.jpg
 

Attachments

  • Ua5aYVo.jpg
    Ua5aYVo.jpg
    448.8 KB · Views: 846
I have done this process of sharing links 100's of times and never had any issues. The newest link you sent does not work for me. Thanks for trying again. I'm done. Take care P.S. I tried it on another computer to see if it would help but it failed there too
I don't know why it's not working since it's the same script that I copied here from thread #64.
 
@halcyonguy Can this code be made as a lower study chart and label?
plot data = if IsPut() then gamma() * -100 * open_interest() else gamma() * 100 * open_interest();

def rangeHigh = Highestall (absvalue(data)) ;


assignbackgroundcolor (if absvalue(data) > 1000000 then color.white else if AbsValue(data) > 500000 then color.gray else if absvalue(data) > 200000 then color.green else if absvalue(data) > 100000 then color.yellow else if AbsValue(data) > 50000 then color.light_orange else if AbsValue(data) > 20000 then color.cyan else if AbsValue(data) > 9999 then createcolor(250,150,100) else color.black);




data.assignvaluecolor(if absvalue (data) > 200000 then color.blue else if absvalue (data) > 100000 then color.light_red else if AbsValue(data) > 9999 then color.black else color.current);



1KOmlQa.jpg
 
@samer800 Can you covert the code to a lower study on a chart?

plot data = if IsPut() then gamma() * -100 * open_interest() else gamma() * 100 * open_interest();

def rangeHigh = Highestall (absvalue(data)) ;


assignbackgroundcolor (if absvalue(data) > 1000000 then color.white else if AbsValue(data) > 500000 then color.gray else if absvalue(data) > 200000 then color.green else if absvalue(data) > 100000 then color.yellow else if AbsValue(data) > 50000 then color.light_orange else if AbsValue(data) > 20000 then color.cyan else if AbsValue(data) > 9999 then createcolor(250,150,100) else color.black);




data.assignvaluecolor(if absvalue (data) > 200000 then color.blue else if absvalue (data) > 100000 then color.light_red else if AbsValue(data) > 9999 then color.black else color.current);
 
thank you for pointing out the uselessness of the highestall line in the code. also, I added gray background for spx options on any reading 1000+ .


plot data = if IsPut() then gamma() * -100 * open_interest() else gamma() * 100 * open_interest();




assignbackgroundcolor (if absvalue(data) > 1000000 then color.white else if AbsValue(data) > 500000 then color.gray else if absvalue(data) > 200000 then color.green else if absvalue(data) > 100000 then color.yellow else if AbsValue(data) > 50000 then color.light_orange else if AbsValue(data) > 20000 then color.cyan else if AbsValue(data) > 9999 then createcolor(250,150,100) else if AbsValue(data) > 999 then color.light_gray else color.black);










data.assignvaluecolor(if absvalue (data) > 200000 then color.blue else if absvalue (data) > 100000 then color.light_red else if AbsValue(data) > 999 then color.black else color.current);
 
Hi I was able to add this to my Thinkorswim. But I want to understand more about what the highlighted numbers mean. For example of SPX, there are highlighted values on each side of the options. The one is negative and other positive, which one implies a potential market move? Can you provide some info on it? Your help is much appreciated, thanks!
 
GEX works amazingly on the trade section of TOS but is there any way to plot it on the graph? I have a code that highlights levels on the chart but I'm having issues adding the gex on it
I have been exploring GEX and observing it in the SPY 0DTE options chain. It's fascinating how market gets repelled and attracted at net positive and net negative gex. Do you still trade using gex? Mind sharing the type of trades you jam on and how you go about entering and exit your trades?
 
I have been exploring GEX and observing it in the SPY 0DTE options chain. It's fascinating how market gets repelled and attracted at net positive and net negative gex. Do you still trade using gex? Mind sharing the type of trades you jam on and how you go about entering and exit your trades?
What do you mean "gets repelled and attracted at net positive and net negative gex"?
 
Hi I was able to add this to my Thinkorswim. But I want to understand more about what the highlighted numbers mean. For example of SPX, there are highlighted values on each side of the options. The one is negative and other positive, which one implies a potential market move? Can you provide some info on it? Your help is much appreciated, thanks!
Curious if anyone has any further insight on this question.
 
can't get the diff color tabs can someone help with this?

this is what I am putting in and nothing

plot data = if IsPut() then gamma() * -100 * open_interest() else gamma() * 100 * open_interest();

def rangeHigh = Highestall (absvalue(data)) ;


assignbackgroundcolor (if absvalue(data) > 1000000 then color.white else if AbsValue(data) > 500000 then color.gray else if absvalue(data) > 200000 then color.green else if absvalue(data) > 100000 then color.yellow else if AbsValue(data) > 50000 then color.light_orange else if AbsValue(data) > 20000 then color.cyan else if AbsValue(data) > 9999 then createcolor(250,150,100) else color.black);




data.assignvaluecolor(if absvalue (data) > 200000 then color.blue else if absvalue (data) > 100000 then color.light_red else if AbsValue(data) > 9999 then color.black else color.current);

1709829242565.png

see I just have the regular one. thanks
 

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

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

87k+ Posts
404 Online
Create Post

Similar threads

Similar threads

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