Option Delta Diff from Max delta for the day and current

sam147

New member
Hi All,

I am trying to create a study for Options Delta change from Max delta for the day. I have written the code which works well on lower Chart but when i create it as a watchlist column with same code its shows wrong info. Any idea what i am doing wrong?

Some of the Symbols for your test:
.DASH210827C190
.GOOGL210827C2780
.PENN210827C70

Code in Lower Study: ( Daily 3 Minute Chart )
Ruby:
``````Code in Lower Study: ( Daily 3 Minute Chart )

##
# Find Max Delta and substract to find out Delta Max Change
#

declare lower;
def epsilon = 0.01 * close(GetUnderlyingSymbol());
def delta = (OptionPrice(underlyingPrice = close(GetUnderlyingSymbol()) + epsilon) - OptionPrice()) / epsilon;

#Find Highest Delta
def highdelta = if barnumber() == 1 then delta[0]

else if delta[0] > highdelta[1]

then delta[0]

else highdelta[1];
#def highdelta= if Highest(delta,length) > delta[0] then Highest(delta,length) else delta;

def Flag= if delta[1] > delta[0] then 0 else 1;

DeltaDiff.AssignValueColor(if Flag==1 then Color.GREEN else Color.RED);

Code in Watchlist with 3 minute Aggregation:

##
#declare lower;
def epsilon = 0.01 * close(GetUnderlyingSymbol());
def delta = (OptionPrice(underlyingPrice = close(GetUnderlyingSymbol()) + epsilon) - OptionPrice()) / epsilon;

#Find Highest Delta
def highdelta = if barnumber() == 1 then delta[0]

else if delta[0] > highdelta[1]

then delta[0]

else highdelta[1];
#def highdelta= if Highest(delta,length) > delta[0] then Highest(delta,length) else delta;

#def Flag= if highdelta[0] > delta[0] then 0 else 1;

Any help will be appricaited.

Last edited:
Hi All,

I am trying to create a study for Options Delta change from Max delta for the day. I have written the code which works well on lower Chart but when i create it as a watchlist column with same code its shows wrong info. Any idea what i am doing wrong?

Some of the Symbols for your test:
.DASH210827C190
.GOOGL210827C2780
.PENN210827C70

Code in Lower Study: ( Daily 3 Minute Chart )

##
# Find Max Delta and substract to find out Delta Max Change
#

declare lower;
def epsilon = 0.01 * close(GetUnderlyingSymbol());
def delta = (OptionPrice(underlyingPrice = close(GetUnderlyingSymbol()) + epsilon) - OptionPrice()) / epsilon;

#Find Highest Delta
def highdelta = if barnumber() == 1 then delta[0]

else if delta[0] > highdelta[1]

then delta[0]

else highdelta[1];
#def highdelta= if Highest(delta,length) > delta[0] then Highest(delta,length) else delta;

def Flag= if delta[1] > delta[0] then 0 else 1;

DeltaDiff.AssignValueColor(if Flag==1 then Color.GREEN else Color.RED);

Code in Watchlist with 3 minute Aggregation:

##
declare lower;
def epsilon = 0.01 * close(GetUnderlyingSymbol());
def delta = (OptionPrice(underlyingPrice = close(GetUnderlyingSymbol()) + epsilon) - OptionPrice()) / epsilon;

#Find Highest Delta
def highdelta = if barnumber() == 1 then delta[0]

else if delta[0] > highdelta[1]

then delta[0]

else highdelta[1];
#def highdelta= if Highest(delta,length) > delta[0] then Highest(delta,length) else delta;

#def Flag= if highdelta[0] > delta[0] then 0 else 1;

Any help will be appricaited.
I think whenever you need to scan in watchlist don't used word plot and used DEF
change it and try it if it works.

Tried with DEF .. Still Results are not correct..

is your watchlist just a list of option symbols , not stocks?

column studies use just 1 function for output. 1 plot OR 1 addlabel.
you have 2 of each. you need to disable 3 of them.
then determine if you can combine you formulas and display your desired data in 1 addlabel. or make another study for another column.
( i guessed addlabel will work for you, because it can display text and numbers)

in a column, the addlabel color will be the font color.
to change the background color of the cell, use AssignBackgroundColor
https://tlc.thinkorswim.com/center/reference/thinkScript/Functions/Look---Feel/AssignBackgroundColor
hal_col

Last edited:
yes my Watchlists are only Options... My watchlist code has only one plot and one label others twos are actually commented. I will try to experiment little bit more and see if it works..

Last edited:
yes my Watchlists are only Options... My watchlist code has only one plot and one label others twos are actually commented. I will try to experiment little bit more and see if it works..
disable one of them

yes my Watchlists are only Options... My watchlist code has only one plot and one label others twos are actually commented. I will try to experiment little bit more and see if it works..
I am speaking from memory. Studies and things that are normally possible on non-options are sometimes not possible on options themselves. I will need to check my references.

For example. I changed your script to plot the epsilon value that merely uses the underlying price. I could not see that value posted on the watchlist, where as it works for regular equity. Please see if that helps.

Last edited:

Not the exact question you're looking for?

87k+ Posts
210 Online

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?