GWAP - Gamma Weighted Average Price

jpmcewen

Member
Hoping for some help on this indicator. I've tried all kinds of combos of getting Tos to plot gamma and delta...with and without parenthesis, using reference, using OptionGamma & OptionDelta, etc. Can't get this damn thing to plot.

Ruby:
declare upper;

def c = close;

plot gwapCall = c + (((gamma() * (VWAP() - c)) + delta()) * (VWAP() - c));
plot gwapPut = c + (((gamma() * (VWAP() - c)) - delta()) * (VWAP() - c));
 
Solution
You can't 'plot' the greeks on a chart. They can be scripted into a column on the option chain.
Here is an example how some members have approached it and the challenges faced:
https://usethinkscript.com/threads/dollar-gamma-calculation.761/

Another example, is where you define the greeks yourself and create a label with what you are looking for.
greek definitions:
https://usethinkscript.com/threads/option-greeks-calculation-labels-for-thinkorswim.399/#post-2707

There are other ways members work around the plotting issue, if you search the forum
You can, you have to be crafty. Start with Mobius Greeks and then work out from there using many other code examples.
Realize the Dollar Gamma formulas are sus and do all...
Hoping for some help on this indicator. I've tried all kinds of combos of getting Tos to plot gamma and delta...with and without parenthesis, using reference, using OptionGamma & OptionDelta, etc. Can't get this damn thing to plot.

Ruby:
declare upper;

def c = close;

plot gwapCall = c + (((gamma() * (VWAP() - c)) + delta()) * (VWAP() - c));
plot gwapPut = c + (((gamma() * (VWAP() - c)) - delta()) * (VWAP() - c));
You can't 'plot' the greeks on a chart. They can be scripted into a column on the option chain.
Here is an example how some members have approached it and the challenges faced:
https://usethinkscript.com/threads/dollar-gamma-calculation.761/

Another example, is where you define the greeks yourself and create a label with what you are looking for.
greek definitions:
https://usethinkscript.com/threads/option-greeks-calculation-labels-for-thinkorswim.399/#post-2707

There are other ways members work around the plotting issue, if you search the forum
 

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

You can't 'plot' the greeks on a chart. They can be scripted into a column on the option chain.
Here is an example how some members have approached it and the challenges faced:
https://usethinkscript.com/threads/dollar-gamma-calculation.761/

Another example, is where you define the greeks yourself and create a label with what you are looking for.
greek definitions:
https://usethinkscript.com/threads/option-greeks-calculation-labels-for-thinkorswim.399/#post-2707

There are other ways members work around the plotting issue, if you search the forum
You can, you have to be crafty. Start with Mobius Greeks and then work out from there using many other code examples.
Realize the Dollar Gamma formulas are sus and do all the deep dive Quant research on Gex yourself, dust off your math skills and spray with WD-40, two cans ought to do it.

https://usethinkscript.com/threads/black-scholes-options-model-by-mobius-for-thinkorswim.326/

Spend days, not hours, days of your life reading this forum, Horserider, BenTen, Mobius and many other fine authors figuring out the function flow inside TOS, that Option Chains data and Option String manipulation is BULLSHIT in TOS but you soldier on anyhow and learn to build labels for testing, oscillators for lowers, then figure out how to plot upper lines (high/low greeks) and spend 2 years of your life beating your brain against a wall, def, rec, if/then nested loops and switches (that Fold is fuggered), Look and Feel are your friend, then finally plot. :) Happy coding.
 
Last edited:
Solution
@griftingthrulife haha, thank you for your comment. I have seen Mobius Greeks (have to look at that again) and I remember realizing the Dollar Gama wasn't going to work. I will have look back into it. I've been compiling my own 'Tos can't do this' file but it's scant right now. Hard to find real, straight answers.
 
You can't 'plot' the greeks on a chart. They can be scripted into a column on the option chain.
Here is an example how some members have approached it and the challenges faced:
https://usethinkscript.com/threads/dollar-gamma-calculation.761/

Another example, is where you define the greeks yourself and create a label with what you are looking for.
greek definitions:
https://usethinkscript.com/threads/option-greeks-calculation-labels-for-thinkorswim.399/#post-2707

There are other ways members work around the plotting issue, if you search the forum
@MerryDay @rad14733 @tomsk I can't for the life of me figure out how to use greeks as a variable in custom quote in options chain. I just get NaN. It looks like other members were able to do this but I've tried all I can think of how the heck to get this thing to print in the options chain tables. Can y'all please help a brotha' out?

Untitled.png
 
@MerryDay @rad14733 @tomsk I can't for the life of me figure out how to use greeks as a variable in custom quote in options chain. I just get NaN. It looks like other members were able to do this but I've tried all I can think of how the heck to get this thing to print in the options chain tables. Can y'all please help a brotha' out?

Untitled.png
Sometimes it does that. Perhaps delete usergui or reload the studies. I know this works in its own column.
Also, not sure you can use cross purpose functions (you either use the Gamm() or the Gamma, but not unlike Imp_Volatility and ImpliedVolatility. Function calls are not all the same in my experience. When in doubt, try labels to test if any result is retuned in a chart.

#option chains custom column script
#determine dollar gamma sitting out at a particular strike price
def uPrice = close(GetUnderlyingSymbol());
def data = volume * uprice;
#AddLabel(yes, AsText(data, NumberFormat.DOLLAR), Color.CURRENT);
plot dg = round(0.5 * gamma() * sqr(uprice/100) * open_interest, 0);
AddLabel(yes, "$" + Round(dg,0) + "M" , Color.CURRENT);
 
@MerryDay @rad14733 @tomsk I can't for the life of me figure out how to use greeks as a variable in custom quote in options chain. I just get NaN. It looks like other members were able to do this but I've tried all I can think of how the heck to get this thing to print in the options chain tables. Can y'all please help a brotha' out?

Untitled.png
Make sure editing "custom" script.

# current volume time ask price
def uPrice = close(GetUnderlyingSymbol());
def price = close;
def value = volume * ask;
def data = volume * uprice;
#AddLabel(yes, AsText(data, NumberFormat.DOLLAR), Color.CURRENT);

#plot dg = round(0.5 * gamma() * sqr(uprice/100) * open_interest, 0);
plot dg = round(0.5 * gamma() * 100 * uprice * open_interest, 0);
#AddLabel(yes, "$" + Round(dg,0) + "M" , Color.CURRENT);
AddLabel(yes, "$" + Round(dg,0) , Color.CURRENT);
 
Thread starter Similar threads Forum Replies Date
C Spx gamma Levels Questions 1
Earthian call and put gamma Questions 3
T gamma squeezes Questions 1
J Gamma profile Questions 1
C Gamma Exposure Profile Questions 2

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

87k+ Posts
528 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