Inferring the Direction of Option Trades In ThinkOrSwim

ChocolateVol

New member
VIP
Reposting a recent bearish indicator publicly shared by Dr. Stephen Harlin here:
https://x.com/stephenharlinmd/status/1708146734587621505?s=20
Would be interested to find the most reliable timeframe and similarly a valid bullish indicator.

Dr. Harlin states:
Category: "On Inferring the Direction of Option Trades
Market microstructure analysis begs a determination of whether a transaction was initiated by a buyer or a seller. Our broker data sets do not provide information about the initiator of a transaction ... so this must be inferred. (Guessed.)

There are multiple algorithms published in the research literature that examine the predictive value of various classification systems. Two of the most widely studied systems show accuracy in the 70-83% range.

Thinkscript, show me occurences when ... ATM put option transaction volume exceeded 10 and, simultaneously:
• options volume pushed a close below the price bar's open,
• the market had just rallied (slope > 0),
• the high was above a 100-period moving average,
• the range of the price bar was > average true range, and
• the open was > the close 4 bars ago (DeMark qualifier).

In simple terms, this Thinkscript study just says, "Tag short-term rally highs when option volume contributes to push the close down off its open."

Points
1. There are lots of ways to infer whether options were bought or sold and they have been published and compared for accuracy ... for years.
2. In my own work on developing classification systems ... sometimes I see bursts of options activity related to news that absolutely gives away direction clues. And other times I see nothing suggesting institutional activity ... when a great trade could have been made.

On could rightfully argue that the criteria embedded in this Thinkscript is just a common sense trading strategy ... so who cares if institutions ... with their various motives ... are behind unusual options activity.


Code:
input expirationDate = 231030;
def ATR = MovingAverage(AverageType.WILDERS, TrueRange(high, close, low), 5);
def MA = Average(close, 100);
def range = high - low;
def m = 6 * (WMA(OHLC4, 6) - Average(OHLC4, 6)) / (6 - 1);
def atmVolume = volume(GetATMOption(GetUnderlyingSymbol(), expirationDate, OptionClass.PUT));

AddChartBubble(
close < open
and atmVolume > 10
and m > 0
and high > MA
and range > ATR
and open > close[4], high, "Buy" + "\nPUTS", Color.WHITE, yes);
 
Last edited by a moderator:
Hi @MerryDay, is the above code working for you on a SPY 1 min chart? do you get any actual bubble signals?

I was trying the 231030 last night but didn't get anything for ytday's intraday price action
 
Last edited by a moderator:
Hi @MerryDay, is the above code working for you on a SPY 1 min chart? do you get any actual bubble signals?

What expiration date did you use?
https://x.com/The_Money_Bin/status/1708167719202464195?s=20
ENFTSau.png


I was trying the 231030 last night but didn't get anything for ytday's intraday price action
Not sure where you have gone astray.

Here is a share chart link: http://tos.mx/JtOCESB Click here for --> Easiest way to load shared links
i7RbKZo.png
 
Last edited:

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