Thanks for the heads up, I will look into that!I had a chance to look at your code.
def IV = SeriesVolatility(series = OptionSeries);
This IV is an average or maybe based on atm option volatility. To accurately calculate gamma you would need to calculate the IV for each strike.
Zero Gamma would be a significant data point.Thanks for the heads up, I will look into that!
I’m really curious to try out the series depth and data type should stay as us because, it might be take too much processing power otherwiseHi All, I am working on some updates. On the todo wait list are the above mentioned Zero Gamma, possibly calculating IV to get a better gamma representation.
Before I get to those though I wanted to add a 'Series' selection for OPEX dates, which I have managed to do.
In addition, I think have found a way to get multiple expiries in there.
For now I'm playing with adding an input 'SeriesDepth' which is a number you set.
For example at Series=Weekly, SeriesDepth=2 it will scan this upcoming friday expiries at the depth setting like normal, and also scan next friday with the same depth.
What other ways or modes would you like to see?
Side question: What are the thoughts on the 'DataType' switch. Should this be changed to just a toggle for each one, that way you can choose to see multiple at once? You could always add the indicator twice as well and change the datatype on the second ...
I'm curious how that works, as I understand it, the thinkscript is stored and run on TOS servers correct? So in the script we are processing the data for every mode regardless, the DataType switch just sets the hiding for the plots.I’m really curious to try out the series depth and data type should stay as us because, it might be take too much processing power otherwise
Would that possibly improve performance? Even though its still setting a value to zero technically. The downside to this approach if I'm understanding correctly, is that you would have reload every time you wanted to change the DataType.def TotalPutVolume = if DataType == DataType.Volume #THIS CHECK HERE <--------------------
fold pvIndex = -(StrikeDepth) to (StrikeDepth + 1)
with pv = 0
do
if !IsNaN(
volume(("." + GetSymbolPart()) + AsPrice(OptionExpiryDate - 20000001) + "P" + AsPrice(CenterStrike + StrikeSpacing * pvIndex))
)
then pv + volume(("." + GetSymbolPart()) + AsPrice(OptionExpiryDate - 20000001) + "P" + AsPrice(CenterStrike + StrikeSpacing * pvIndex))
else pv + 0
else 0; # ELSE ZERO HERE <---------------
Yeah probably best to separate for faster performanceI'm curious how that works, as I understand it, the thinkscript is stored and run on TOS servers correct? So in the script we are processing the data for every mode regardless, the DataType switch just sets the hiding for the plots.
Even if I added a check for the datatype on the fold like:
Would that possibly improve performance? Even though its still setting a value to zero technically. The downside to this approach if I'm understanding correctly, is that you would have reload every time you wanted to change the DataType.
Might be better to just separate these out into three separate indicators ... will continue researching ...
Thanks, I do have those calculations in place already! Check out the input for 'gex calculation method'Hola friend. Nice update. Thank you.
Ideas for you:
Call GEX = gamma * OI * 100 * Spot Price
Spot Price refers to the price of the underlying.
Also if it helps to reduce processing power you can use this:
GEX = (TotalCallGammaExposure - TotalPutGammaExposure) * 100 * Spot Price
Hey nice updates - I'm not able to get V.3 to show on lower.Thanks, I do have those calculations in place already! Check out the input for 'gex calculation method'
I want to use that to get zero gamma, as pointed out by conmayne above, but I'm having a hard time following what exactly I need to do. Doesn't make it easier that it is incredibly difficult to work inside the 'fold' within thinkscipt. (i.e cannot set variables, def etc. etc.)
Make sure you are on 1day timeframe. Can you post a pic of the setup maybe I can help troubleshoot more?Hey nice updates - I'm not able to get V.3 to show on lower.
Ahh, I'll look into that as I wasn't quite sure. For that I am following this: https://perfiliev.co.uk/market-commentary/how-to-calculate-gamma-exposure-and-zero-gamma-level/"
if GEXMethod == 1 then
OptionPrice((CenterStrike + (StrikeSpacing * index)), !IsCall, DTE, close, IV, no, 0.0, r)"
It looks like you are multiplying the OI times the option price. But you should be multiplying OI times the spot price of the stock.
Make sure you are on 1day timeframe. Can you post a pic of the setup maybe I can help troubleshoot more?
Yeah it’s the stock price , not the option priceAhh, I'll look into that as I wasn't quite sure. For that I am following this: https://perfiliev.co.uk/market-commentary/how-to-calculate-gamma-exposure-and-zero-gamma-level/
I assumed it was spot price of the option ...
Can this be applied for 0DTE SPX as well? ThanksAhh, I'll look into that as I wasn't quite sure. For that I am following this: https://perfiliev.co.uk/market-commentary/how-to-calculate-gamma-exposure-and-zero-gamma-level/
I assumed it was spot price of the option ...
The functionality isn't there yet for days other than friday expirations, but I'm playing with a way to do that, not sure if it will work yet but if I do get it I will post an update here.Can this be applied for 0DTE SPX as well? Thanks
Join useThinkScript to post your question to a community of 21,000+ developers and traders.
Start a new thread and receive assistance from our community.
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.
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.