# 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:

Another example, is where you define the greeks yourself and create a label with what you are looking for.
greek definitions:

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:

Another example, is where you define the greeks yourself and create a label with what you are looking for.
greek definitions:

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

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:

Another example, is where you define the greeks yourself and create a label with what you are looking for.
greek definitions:

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.

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:
@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:

Another example, is where you define the greeks yourself and create a label with what you are looking for.
greek definitions:

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?

@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?

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;
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?

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;

#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);

call and put gamma Questions 3
Summing call and put Gamma for option column Questions 0
gamma squeezes Questions 1
Gamma profile Questions 1
Gamma Exposure Profile Questions 2

87k+ Posts
355 Online

## The Market Trading Game Changer

Join 2,500+ subscribers inside the useThinkScript VIP Membership Club
• Exclusive indicators
• Proven strategies & setups
• Private Discord community
• Exclusive members-only content
• 1 full year of unlimited support

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?