Option Chain Column For ThinkOrSwim

HumbledTrader

New member
@rad14733 what your looking at is it, and yes you can do a custom column by editing the script in the custom extras custom 1-whatever amount they give you, in fact, what your looking at is real it is not mine to give as i need permission, but it slows the system and i have a decent computer i beleive

Yes Please if you can help?
 
@jngy2k you may not be aware but "Open Interest" is calculated following the trading activity for each day. Therefore the most you can do is subtract the the previous from the current to calculate. If you wish to have more data you would have to look at the tape history.
 

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

Hey everyone! I'm looking for some coding on my option chain column that should be pretty straight forward hopefully. I would like one of my columns to calculate the percentage difference between the ask prices. Since the contracts are listed from lowest to highest strikes it would be calculating for example Strike 70 Ask price $10 minus the Strike 71 Ask price $5 resulting in a 50% difference. I'm not a coder and new to this so thank you for any help you can give!
 
Is there a way to achieve this outside of the option chain?
It depends on what you are trying to do, youde have to explain more. A basic formula for percent can be made and you can manually enter the prices. there are many strikes in a chain, not sure what your are referring to and comparing to.
 
@Brittany Even if the calculations could be done the roundabout way of getting the information you want would be processing intensive and would cause lag and delayed option chain updates... Remember, standard option chain data updates near real-time yet calculated columns calculate at a lower priority so results would not necessarily be accurate... It would take some reverse engineering for every strike price to determine what may or may not be the next strike price above or below in the option chain and that takes processing time... I just don't see it as a practical endeavor...
 
I am trying to add a column in the option chain which formula as Delta/optionprice * Stock price
Code:
plot output = Delta/optionprice * Close
But I have no TOS coding experience and i can't for the life for me figure out how to do this, Can someone please help?
 
I am trying to add a column in the option chain which formula as Delta/optionprice * Stock price
Code:
plot output = Delta/optionprice * Close
But I have no TOS coding experience and i can't for the life for me figure out how to do this, Can someone please help?

Not sure exactly what you are looking forbut the following should get you closer...

Ruby:
plot output = (Delta() / Close) * close(symbol=GetUnderlyingSymbol());
 
I want to create a custom column for displaying the intrinsic divided by extrinsic value in a cusomt column for each strike. What functions can do this? I am not seeing anything in functions window that supports using the int/ext values for calculations. Help greatly appreciated.

Regards,
 
this isn't a scan, but i have this code in a column, in the option chain, to display the bid ask spread as a % number, and show different colors depending on which range it is in.

Code:
# add to a custom column in the option chain
# this code calcs a  bid/ask spread ratio to ask   (ask-bid)/ask
#  if % is 0  to 10 then gray background
#  if % is 10 to 20 then blue
#  if % is  > 20 then red

def lvl1 = 10;
def lvl2 = 20;
def per = Round("number" = ((ask - bid ) / ask) * 100, "numberOfDigits" = 0);
assignbackgroundColor( if per > lvl2 then color.red  else if per > lvl1 then color.blue else color.dark_gray );
plot ppp = per;

https://youtu.be/qJvoZbu3YPw
TD ameritrade
Watch "Customizing the Option Chain" on YouTube
hal_col
 
Last edited:
this is untested

i think this has to be done in an option chain column.

EDITED
i made a watchlist column study , then tried to add it to my option chain. but i couldn't.
it seems only the first 19 custom WATCHLIST column studies show up to be picked from , IN THE OPTION CHAIN.
i have added watchlist column studies, by opening share links. i had assumed all of the watchlist column studies would appear in all places that column studies are used. but they don't.

at this time i'm not ready to rearrange my column studies, so i invite someone else to verify this or prove it wrong.
i didn't test for divide by 0.

Ruby:
# intextratio01

# column study
# ======================================
#  Intrinsic/Extrinsic ratio

#https://www.investopedia.com/terms/i/intrinsicvalue.asp

#https://www.investopedia.com/articles/optioninvestor/07/options_beat_market.asp

#Intrinsic value is the value any given option would have if it were exercised today. Basically, the intrinsic value is the amount by which the strike price of an option is profitable or in-the-money

#Intrinsic value = if stock price > strike then stock price - strike else 0

def stkcls = close(GetUnderlyingSymbol());
def strik = getstrike();

def intrin = if stkcls > strik then (stkcls - strik) else 0;


#extrinsic value
#time value = option price - Intrinsic value

# use mark for option price , (bid+ask)/2
def optprice = (bid+ask)/2;
def extrin = optprice - intrin;

plot intextratio = intrin/extrin;

#In other words, the time value is what's left of the premium after calculating the profitability between the strike price and stock's price in the market. As a result, time value is often referred to as an option's extrinsic value since time value is the amount by which the price of an option exceeds the intrinsic value.

#https://tlc.thinkorswim.com/center/reference/thinkScript/Functions/Option-Related

# =================================================

# make background color black
#assignBackgroundColor(Color.black);

#

..
 
Last edited:
@halcyonguy There are only 19 Custom Watchlist Columns available across the platform... The only way I know of to increase that number is through the use of importing Shared Items...
that is how i understand it, that you have to use share links to add column studies beyond the default quantity of 19. i have added watchlist column studies by importing links. i had assumed all of them would show up in the column list in the option chain, but they don't, only 19. ( in paper mode, if that matters)
i just tried creating a link from a study in my option chain. then used the link and changed the name, to add a copy of the study. it shows up in my watchlist column list, but not as a choice in option column list.

i am experimenting with my study , in live mode now ( have some extra columns available)
i see i didn't check if the option is a call or put....
 
Last edited:
that is how i understand it, that you have to use share links to add column studies beyond the default quantity of 19. i have added watchlist column studies by importing links. i had assumed all of them would show up in the column list in the option chain, but they don't, only 19. ( in paper mode, if that matters)
i just tried creating a link from a study in my option chain. then used the link and changed the name, to add a copy of the study. it shows up in my watchlist column list, but not as a choice in option column list.

It wouldn't surprise me if the shared items aren't available for Option Chains and I seem to recall trying myself, unsuccessfully, some months back...
 
here is an updated column study for the option chain. it checks if the option is a call or a put


Ruby:
# intextratio02

# option chain column study
#  Intrinsic/Extrinsic ratio

def stkcls = close(GetUnderlyingSymbol());
def strik = getstrike();

def intrin = if (!isput() and stkcls > strik) then round(stkcls - strik, 2)
 else if (isput() and stkcls < strik) then round(strik - stkcls, 2)
 else 0;

#extrinsic value
#time value = option price - Intrinsic value
def optprice = OptionPrice();

def extrin = round(optprice - intrin, 2);
def intextratio2 = round(intrin/extrin, 2);


# this shows just the ratio number
# to use this, remove # in front of plot, and add a # in front of the addlabel
#plot intextratio = intextratio2;

# test line to show several variables
addlabel(1, intrin + " / " + extrin + " = " + intextratio2, color.white);
#

this shows 3 values in the column. Intrinsic, Extrinsic, and the ratio
BoUJ6cp.jpg

#
 

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

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