thinkScript for Option Volume Twice the Option Open Interest

calvingee

New member
Hello thinkScript wizards, trying to setup a scan for option volume twice the option open interest for the same strike date. Need a thinkScript to insert into the editor. Any guidance or help would be appreciated. Not code literate.

Thanks in advance.
 

samks_30

New member
2019 Donor

calvingee

New member
@samsk_30 thanks for the quick reply. When I insert into editor I get an error message --> No such function: GetATMOption

Also, can it be coded without specifying the DOE and scan all of them. I will use a filter for DOE's less than 60 days.
 

tomsk

Well-known member
VIP
@calvingee No, GetATMOption() is not available within the scanner, that's why you see the message as displayed

I have seen studies with code using GetATMOption within a study. Additionally I have also used it in the past within a user defined custom quote within an option chain. That helps me to flag strikes where the volume is greater than the open interest
 

Superfast

New member
Hello, can someone create a script that scans for options with the highest change in open interest from the previous session e.g. day or hour, 5 min etc. Perhaps a % change may be most suitable.
 

tomsk

Well-known member
VIP
Cindy Faber TOS: Select one of the custom watchlist columns and replace code in it with this. Then open option chain and select your new custom column's name as an option chain column.

IMPORTANT REMINDER: per industry regulation OI is updated only once/day, a few hours after market close.

Unfortunately, fields like Option Volume, Open Interest are not available to scan against. I recently tuned in to the Thinkscript lounge where this specific issue was discussed.

Code:
#HINT: this is a custom watchlist column that can be selected as a column on a watchlist of option symbols and/or as a column on the option chain


plot OI_NetChg = open_interest() - open_interest()[1];
OI_NetChg.SetDefaultColor(color.BLACK);
AssignBackgroundColor(if OI_NetChg > 0 then color.GREEN
                                                                          else if OI_NetChg < 0
                                                                                  then color.RED
                                                                                  else color.GRAY);


Or a more space efficient version:


def OI_NetChg = open_interest() - open_interest()[1];
AddLabel(yes, Round(OI_NetChg, 0), color.BLACK);
AssignBackgroundColor(if OI_NetChg > 0 then color.GREEN
                                                                          else if OI_NetChg < 0                             
                                                                                  then color.RED
                                                                                  else color.GRAY);


here is another way to use one of your custom columns to create an option chain column:


#HINT: this is a custom watchlist column that can be selected as a column on a watchlist of option symbols and/or as a column on the option chain.  It is blank if volume is lower than open_interest allowing it to act as an alert by only appearing when volume is higher than open_interest


def alert = volume > open_interest;
AddLabel(yes, if alert then "volume vs OI" else ".", color.BLACK);
AssignBackgroundColor(if alert == 1 then color.RED else color.LIGHT_GRAY);
 

xexykid

New member
Hi all, Does any one know in thinkscript "Option Time & Sales", how to call this highest traded option's DOE, Class etc? (and also the second biggest option, etc) Any such example scripts available anywhere? Thanks!

 

alphabeta

Member
@samks_30 great study . is it possible to get at the money implied volatility change in percentage from yesterday thank you!!

@Superfast hi i am also looking for same solution did you find it!!! if you find it can you please share with us thank you
 

Jimbo69

New member
I’m needing to customize a scan that shows current volume contracts 2x(times) the open interest. Just a basic scan with no specific price or expiration
 

rad14733

Well-known member
VIP
I haven't checked in the past week but all of the Option functions were broken after a recent TOS update... The functions weren't working anywhere, not even in Studies or Strategies...
 

Jimbo69

New member
@rad14733 Thanks for the update. I just started using the scan query yesterday and it seems to be working, i did talk to support and the rep told me that the scan I’m wanting cannot be performed.
 

Similar threads

Top