Options Gamma script does not work on my platform

3AMBH

Active member
2019 Donor
Script is for Options chain under Trade Tab to show highlighted Gamma

Hi, Please see post https://usethinkscript.com/threads/options-gamma-study.11951/page-5#posts in order to see history. The following script works for a member by the name of Focus. The same script does not work for me. He has sent this also and it does not work for me either https://tos.mx/VWf2UpO (This link shows up in my Watchlists selections)

Here is the script he posted: Can someone please tell me ahy it des not work for me and does work for Focus? Thanks

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);
 
Last edited:
Script is for Options chain under Trade Tab to show highlighted Gamma

Hi, Please see post https://usethinkscript.com/threads/options-gamma-study.11951/page-5#posts in order to see history. The following script works for a member by the name of Focus. The same script does not work for me. He has sent this also and it does not work for me either https://tos.mx/VWf2UpO (This link shows up in my Watchlists selections)

Here is the script he posted: Can someone please tell me ahy it des not work for me and does work for Focus? Thanks

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);
Curious what's those color codes mean? When is safe to buy or exit?
 
The code is not the problem, its just some basic arithmetic and some built-in functions. The syntax is correct. The issue is at the platform / settings level, outside of the code, and may involve some of the platform's lesser known "dirty tricks," for lack of a better word.

Here is the code both working and not working, even though everything appears to be identical on the surface.

wDEB7Af.png

rKyqVwI.png


Most of this has already been mentioned here to elsewhere, but I am just going to summarize to get everything in one place.

For one, get rid of the rangeHigh line, its not doing anything.

The option chain's spread must be set to Single.

OHh8I7C.png


Please ensure that the problem code is inserted into an original column script slots that comes with TOS by default. Custom columns are finicky when used on the option chain, especially if they are extra custom columns obtained via share link, as opposed to the original set.

Secondly, and I know this sounds weird, but set the column to the Daily aggregation, and with Extended Hours On. To do this, you must select any random intraday aggregation, which will display the extended hours check box, turn extended hours on, and then set it back to daily.

If that doesn't solve the issue, here is what I need:

You mentioned that one script works, while the other one doesn't. Do you have them both saved as two separate custom column scripts? Or, are you just moving each code back and forth into the same box with Copy & Paste perhaps? If you do have two separate scripts, what happens if you switch each of their codes from one to the other?

Lastly, if all else fails, on column that doesn't work, I need you to set all that code aside, by either commenting it out with #, or copy and pasting it into a text file for safe keeping. Then, in that same code exact box, do each of these, one at a time, by themselves, and tell me the result of each:
  1. plot data = isPut();
  2. plot data = Gamma();
  3. plot data = Open_Interest();
They will fail at different times for different reasons, and if one fails the whole thing fails, I need to know the root of the problem.
Where do you set the aggregation from intraday to daily? In the column itself or in the script?
 
Its in the column script editor; that button right next to where you name the column. Where it says [ D ] at the top of the images you quoted.
 

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
510 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