pull back option data

mikemoewill

New member
How can I pull back option data for a stock that falls within the range of specific delta price? For instance, Looking at SPY after 45 minutes from the opening bell if the price crosses above 562, what is the call option closest to .15 delta within the range of .10 and .14 delta? I want to print this value on the chart but only when both conditions are meet.

So far I only see the following functions: Delta, GetATMOption, GetNextITMOption, GetNextOTMOption, OptionPrice.

I am looking for similar functionality of what the user is describing here:
https://usethinkscript.com/threads/...used-in-thinkorswim.13822/page-14#post-144456

How can I pull back option data that matches a specific delta criteria. I am testing this in the OnDemand feature in TOS. For example, looking at SPX, for August 28, 2024 from the opening bell, I am looking to find the first OTM option call with a delta between .9 and .15 not including the endpoints.

I know how to get the current ATM call option and the Next OTM call option, but am looking for a for loop that can iterate up the option ladder to find an option that meets the delta criteria. Currently, I have not found a way to use Delta to pull back the data for the ATM call option or Next OTM call option to compare the results and traverse through the loop.

Any help would be appreciated.

-------------
MOD edit
did you mean this link #273
https://usethinkscript.com/threads/...used-in-thinkorswim.13822/page-14#post-143763
 
Last edited by a moderator:
Solution
How can I pull back option data for a stock that falls within the range of specific delta price? For instance, Looking at SPY after 45 minutes from the opening bell if the price crosses above 562, what is the call option closest to .15 delta within the range of .10 and .14 delta? I want to print this value on the chart but only when both conditions are meet.

So far I only see the following functions: Delta, GetATMOption, GetNextITMOption, GetNextOTMOption, OptionPrice.

I am looking for similar functionality of what the user is describing here:
https://usethinkscript.com/threads/...used-in-thinkorswim.13822/page-14#post-144456

How can I pull back option data that matches a specific...
How can I pull back option data for a stock that falls within the range of specific delta price? For instance, Looking at SPY after 45 minutes from the opening bell if the price crosses above 562, what is the call option closest to .15 delta within the range of .10 and .14 delta? I want to print this value on the chart but only when both conditions are meet.

So far I only see the following functions: Delta, GetATMOption, GetNextITMOption, GetNextOTMOption, OptionPrice.

I am looking for similar functionality of what the user is describing here:
https://usethinkscript.com/threads/...used-in-thinkorswim.13822/page-14#post-144456

How can I pull back option data that matches a specific delta criteria. I am testing this in the OnDemand feature in TOS. For example, looking at SPX, for August 28, 2024 from the opening bell, I am looking to find the first OTM option call with a delta between .9 and .15 not including the endpoints.

I know how to get the current ATM call option and the Next OTM call option, but am looking for a for loop that can iterate up the option ladder to find an option that meets the delta criteria. Currently, I have not found a way to use Delta to pull back the data for the ATM call option or Next OTM call option to compare the results and traverse through the loop.

Any help would be appreciated.


Unfortunately, no.

It is not possible to build a loop that can iterate up the option ladder to scan for an option that meets the delta criteria.

Here is what is available:
https://usethinkscript.com/threads/options-scan-hacker-in-thinkorswim.5114/
 

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

How can I pull back option data for a stock that falls within the range of specific delta price? For instance, Looking at SPY after 45 minutes from the opening bell if the price crosses above 562, what is the call option closest to .15 delta within the range of .10 and .14 delta? I want to print this value on the chart but only when both conditions are meet.

So far I only see the following functions: Delta, GetATMOption, GetNextITMOption, GetNextOTMOption, OptionPrice.

I am looking for similar functionality of what the user is describing here:
https://usethinkscript.com/threads/...used-in-thinkorswim.13822/page-14#post-144456

How can I pull back option data that matches a specific delta criteria. I am testing this in the OnDemand feature in TOS. For example, looking at SPX, for August 28, 2024 from the opening bell, I am looking to find the first OTM option call with a delta between .9 and .15 not including the endpoints.

I know how to get the current ATM call option and the Next OTM call option, but am looking for a for loop that can iterate up the option ladder to find an option that meets the delta criteria. Currently, I have not found a way to use Delta to pull back the data for the ATM call option or Next OTM call option to compare the results and traverse through the loop.

Any help would be appreciated.
A work around is using "Watchlist Gadgets", please follow these steps.

1 - Create a Watchlist and only add "SPY" (I called mine "SCALP")
2 - Create scan query (Option Hacker) ...
a. Use the below settings:

Scan in: SCALP
Open Interest: Up to you.
Delta min: 10 (or whatever)
Delta max: 15 (or whatever)
Date to exp: blank to whatever
Screenshot 2024-09-13 164933.png


Screenshot 2024-09-13 1656132.png


then create a gatget and will look like this. (Gatgets refresh is a bit slow between 3 to 5 min)

Screenshot 2024-09-13 165852.png
 
Solution
The option hacker, for some reason, does not pull back data for 0DTE options. So, it does not appear to provide me the information I need for current day trading.

Is there a way using the option code on a chart to pull back the actual data provided in the option chain? For example if I have the option code .SPXW2409165565, can I use this code to grab the delta?

I have been able to use the following script to pull back an approximate delta, but it is not accurate because the IV value won't update like the delta does:
Code:
def expirationDate = GetYYYYMMDD();
def epsilon = 0.01 * close(getunderlyingSymbol());
def yield = 0.0;
def interest_rate = 0.0;
def DTE = DaysTillDate(expirationDate)+1;
def StockPrice = close(getUnderlyingSymbol());
def CenterStrike = RoundUp((StockPrice / 5), 0) * 5;

script getIV {
    input a = 0;
    def IV = imp_volatility(getUnderlyingSymbol());
    plot getIV = if isNaN (imp_volatility(getUnderlyingSymbol())) then IV[1] else IV;
}

def IV = getIV(expirationDate);

script getDelta {
    input a = 0;
    input b = 0;
    input c = 0;
    input d = 0;
    input e = 0;
    input f = 0;
    input g = 0;
    input h = 0;
    plot getDelta = (OptionPrice(h, no, DaysTillDate(a)+1, g, f, no, c, d) - OptionPrice(h + b, no, DaysTillDate(a)+1, g, f, no, c, d))/b;
}

def Delta = getDelta(expirationDate, epsilon, yield, interest_rate, DTE, IV2, StockPrice, CenterStrike);

AddLabel (yes, "Delta Approximate " + Delta);
AddLabel (yes, "IV " + IV);
addlabel (yes, "DTE " + DTE);

Is there anyway to get the IV value to update with each bar? Am I missing something in my code. Why does the built in function Delta not work on the symbol's chart?
 
Last edited by a moderator:

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

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