Skip to main content ThinkOrSwim Option Chain Relative Value Skip to main content Skip to content
Master the TTM Squeeze with our comprehensive 19-module course Start Learning →
TOS Indicators
  • Tools

    Categories

    • Indicators
    • Backtesters
    • Scans
    • Dashboards
    • thinkScript
    • Member Resources
    Browse Full Library

    Featured Tutorials

    Heiken Ashi Trend Indicator
    Heiken Ashi Trend Indicator
    Indicators

    Download our Custom Heiken Ashi indicator for ThinkOrSwim. Full ThinkScript code, formula...

    Learn more →
    Commodities Tracker
    Commodities Tracker
    Indicators

    For acceleration signals: trend-following strategies and buying pullbacks. For deceleration signals: short...

    Learn more →
    Build an Election Backtester in 10 Minutes
    Build an Election Backtester in 10 Minutes
    Backtesters

    Learn how to create a Post-Election Backtester in ThinkOrSwim to analyze market...

    Learn more →

    Popular Posts

    Unusual Volume
    Unusual Volume
    Scans

    Build 4 scans to easily find stocks with greater than...

    Learn more →
    Upcoming Earnings with High Short Interest
    Upcoming Earnings with High Short Interest
    Scans

    Build a scan to find stocks that are likely to...

    Learn more →
    Unusual Volume Pro Scans
    Unusual Volume Pro Scans
    Scans

    4 additional scans to find unusual volume overlapping with key...

    Learn more →
  • Courses
    Squeeze Course
    Squeeze Course
    19 Modules

    Scan, backtest, and trade the TTM Squeeze setup with precision.

    Unlock Course →
    Earnings Course
    Earnings Course
    3 Modules

    Master earnings plays with free indicators and proven strategies for ThinkOrSwim.

    Unlock Course →
    V-Shaped Reversals
    V-Shaped Reversals
    7 Modules

    Identify and trade powerful V-shaped reversal patterns with confidence and precision.

    Unlock Course →
    Fibonacci Trading
    Fibonacci Trading
    4 Modules

    Learn to trade Fibonacci retracements and extensions in ThinkOrSwim effectively.

    Unlock Course →
  • Products
    Futures Volatility Box Premium
    Futures Volatility Box

    Volatility models for 10 major futures markets, including micros & SPX.

    Explore Futures VB →
    Stock Volatility Box Premium
    Stock Volatility Box

    Dynamic support & resistance for 595+ stocks/ETFs, with a live scanner.

    Explore Stock VB →
    Opening Range Breakouts Premium
    Opening Range Breakouts

    Powerful live scanner & backtester for ORB strategies on 595+ stocks.

    Explore ORB Setups →
My Account
Back to Tutorials
Advanced 40 minutes ThinkOrSwim

Option Chain Relative Value

Build a custom ThinkScript that compares current option prices to historical values and displays percentage changes for smarter options trading decisions

How to install in ThinkOrSwim →
Table of Contents
  • Build a Custom Option Chain Relative Value Analysis System
  • The Problem with Traditional Options Analysis
  • Understanding Relative Value in Options Trading
  • Step-by-Step Coding Tutorial: Building the Relative Value Scanner
  • Real-World Application Examples
  • Integration with Portfolio Management
  • Common Implementation Mistakes and Solutions
  • Advanced Strategy Applications
  • Automation and Scanning Workflows

Build a Custom Options Relative Value Scanner

Track which options have become expensive or cheap compared to recent trading periods. This custom ThinkScript scanner reveals percentage changes in option premiums across different timeframes.

What you’ll learn to build:

  • Compare current option prices to any historical period
  • Identify options with extreme percentage changes
  • Calculate option-to-stock price ratios for context
  • Filter for liquid options to avoid false signals

Designed for options traders who want objective data about premium expansion and contraction cycles.

Build a Custom Option Chain Relative Value Analysis System

Options traders often buy premium at the worst times—purchasing calls after volatility spikes or selling puts when IV has already collapsed. Instead of guessing whether premium is fair, you can build a custom scanner that shows exact percentage changes compared to any historical period.

This tutorial shows you how to create a ThinkScript that transforms option chain analysis by revealing which strikes have become cheap or expensive relative to recent trading periods.

The Problem with Traditional Options Analysis

Standard options analysis focuses on Greeks, implied volatility percentiles, and theoretical pricing models. While these tools provide valuable insights, they miss a crucial element: historical context for individual strike prices.

Common Analysis Gaps:

  • IV percentile shows overall volatility but not strike-specific changes
  • Greeks provide sensitivity measures but not value comparisons
  • Volume and open interest show popularity but not pricing efficiency
  • Bid-ask spreads indicate liquidity but not historical value shifts

These traditional metrics leave traders asking: “Is this $2.50 call expensive compared to last week?” The relative value scanner answers this question with precise percentage calculations.

Understanding Relative Value in Options Trading

Relative value analysis compares current option prices to their historical levels, revealing opportunities that traditional analysis misses. When the market sells off, put premiums often spike 100-300% while call premiums collapse by similar amounts. Understanding these shifts creates significant trading advantages.

Key Relative Value Concepts:

Premium Expansion: During market stress, option premiums inflate beyond their historical norms. Put options become expensive as fear peaks, while call options crash as optimism fades.

Premium Contraction: As markets stabilize, inflated premiums return to normal levels. This creates opportunities to sell expensive options and buy cheap ones.

Strike-Specific Changes: Different strikes experience different premium changes. Out-of-the-money puts might increase 200% while near-the-money puts increase only 75%.

Time Decay Interaction: Premium changes compound with time decay effects. Understanding both components helps optimize entry and exit timing.

Step-by-Step Coding Tutorial: Building the Relative Value Scanner

Follow this detailed tutorial to create a custom ThinkScript that displays percentage changes in option prices compared to historical periods.

Step 1: Setting Up the Basic Script Structure

Create a new Custom Quote Formula in ThinkOrSwim and start with the essential input variables:

input lookbackPeriod = 5;
input showPriceRatio = no;

def signal = ((close/close[lookbackPeriod]));

The lookbackPeriod determines how many days back to compare prices. Start with 5 days to compare current prices to last week’s levels. The signal variable calculates the price ratio between current and historical periods.

Step 2: Creating the Percentage Change Calculation

Convert the price ratio into a meaningful percentage change:

def condition = (close - close[lookbackPeriod])/close[lookbackPeriod];

AddLabel(condition, Round(condition*100,0)+"%", if condition >= 0.5 
         then color.green else if condition <= -0.5 
         then color.red else color.white);

This calculation shows the exact percentage change from the historical period. Positive values indicate the option has become more expensive, while negative values show it has become cheaper.

Step 3: Adding Conditional Color Coding

Visual indicators help quickly identify significant changes:

def condition = (close - close[lookbackPeriod])/close[lookbackPeriod];

AddLabel(condition, Round(condition*100,0)+"%", 
         if condition >= 0.5 then color.green 
         else if condition <= -0.5 then color.red 
         else color.white);

Green labels indicate options that increased 50% or more (expensive). Red labels show options that decreased 50% or more (cheap). White labels show moderate changes under 50%.

Step 4: Implementing the Option-to-Stock Ratio Feature

Add a second condition to show how expensive the option is relative to the underlying stock price:

# Commented out - Option to Stock Price Ratio
#plot condition = if signal = 0.5 then color.green 
         else if condition <= -0.5 then color.red 
         else color.white);

When uncommented, the first condition checks if the option costs less than 4% of the stock price, following the IBD rule for reasonable option pricing.

Step 5: Customizing the Lookback Period

Different trading scenarios require different comparison periods:

1-Day Lookback: Change to input lookbackPeriod = 1; for overnight analysis

2-Day Lookback: Use input lookbackPeriod = 2; for recent volatility changes

Weekly Analysis: Keep input lookbackPeriod = 5; for week-over-week comparison

Step 6: Testing the Scanner on Live Data

Apply the script to an options chain and verify the calculations:

  1. Open an options chain in ThinkOrSwim
  2. Add a Custom Quote Formula column
  3. Paste your script code
  4. Set the column name to "Pricing" or "RelValue"
  5. Apply to see percentage changes across all strikes

Step 7: Interpreting the Results

The scanner displays percentage changes that reveal trading opportunities:

Large Positive Changes (+100% to +300%): Options have become expensive, potentially good for selling premium strategies like cash-secured puts or covered calls.

Large Negative Changes (-50% to -75%): Options have become cheap, potentially good for buying strategies like long calls or protective puts.

Moderate Changes (-25% to +25%): Normal price fluctuations that may not warrant specific action.

Step 8: Adding Volume and Liquidity Filters

Enhance the script to filter out illiquid options:

input lookbackPeriod = 5;
input minVolume = 10;

def condition = if volume >= minVolume 
               then (close - close[lookbackPeriod])/close[lookbackPeriod]
               else Double.NaN;

AddLabel(!IsNaN(condition), Round(condition*100,0)+"%", 
         if condition >= 0.5 then color.green 
         else if condition <= -0.5 then color.red 
         else color.white);

This version only shows data for options with adequate trading volume, preventing analysis of illiquid strikes that may show misleading percentage changes.

Step 9: Creating Multiple Timeframe Analysis

Build versions for different analysis periods:

# Version 1: Short-term (1-day)
def condition1d = (close - close[1])/close[1];

# Version 2: Medium-term (5-day) 
def condition5d = (close - close[5])/close[5];

# Version 3: Long-term (10-day)
def condition10d = (close - close[10])/close[10];

# Display based on timeframe preference
def condition = condition5d; # Change to 1d or 10d as needed

AddLabel(condition, Round(condition*100,0)+"%", 
         if condition >= 0.5 then color.green 
         else if condition <= -0.5 then color.red 
         else color.white);

Step 10: Advanced Implementation and Optimization

Final version with error handling and optimization:

input lookbackPeriod = 5;
input showPriceRatio = no;
input minVolume = 5;

def validData = !IsNaN(close) and !IsNaN(close[lookbackPeriod]) and close[lookbackPeriod] != 0;
def volumeFilter = volume >= minVolume;

def condition = if validData and volumeFilter 
               then (close - close[lookbackPeriod])/close[lookbackPeriod]
               else Double.NaN;

# Option to Stock Price Ratio (when enabled)
def stockRatio = if showPriceRatio and validData 
                then close / GetUnderlyingPrice() 
                else Double.NaN;

AddLabel(!IsNaN(condition), Round(condition*100,0)+"%", 
         if condition >= 0.75 then color.green 
         else if condition <= -0.5 then color.red 
         else color.white);

This final version includes error handling for missing data, volume filtering for liquidity, and optional stock ratio analysis.

Real-World Application Examples

Market Selloff Scenario: During a 3-day market decline, SPY puts might show +150% increases while calls show -60% decreases. The scanner immediately identifies this volatility expansion, suggesting opportunities to sell expensive puts and buy cheap calls for recovery plays.

Earnings Volatility Crush: After earnings announcements, options often experience rapid premium contraction. A stock reporting in-line results might see options decrease 40-70% overnight, creating buying opportunities for future catalysts.

Sector Rotation Events: When investors rotate from growth to value stocks, tech calls might show sustained decreases while financial calls show increases. The scanner helps identify these sector-specific opportunities.

Fed Announcement Impact: Central bank announcements create predictable volatility patterns. Rate decision days often see puts spike 100%+ beforehand, then crash 75%+ afterward as uncertainty resolves.

Integration with Portfolio Management

Position Sizing Guidance: Use percentage changes to determine position sizes. When puts show extreme increases (+200%), consider smaller position sizes due to elevated risk. When options show moderate changes (<50%), standard position sizing applies.

Risk Management Applications: Monitor existing positions using the scanner. If puts you sold continue showing increases, prepare for potential assignment. If calls you bought show sustained decreases, consider reducing exposure.

Profit-Taking Strategies: Use the scanner to time exits. If you sold puts showing +150% increases and they now show only +25% increases, consider buying them back to lock in profits from volatility contraction.

Common Implementation Mistakes and Solutions

Ignoring Liquidity Filters: Analyzing illiquid options creates false signals. Always filter for minimum volume and reasonable bid-ask spreads.

Wrong Lookback Periods: Using 10-day lookbacks for day trading or 1-day lookbacks for swing trading provides irrelevant context. Match your analysis period to your trading timeframe.

Overreacting to Extreme Changes: A put showing +300% might seem like a great selling opportunity, but if the underlying is in free fall, assignment risk may be unacceptable.

Neglecting Fundamental Context: Technical relative value analysis must consider fundamental factors. Earnings dates, Fed meetings, and sector events affect option pricing beyond pure technical patterns.

Advanced Strategy Applications

Volatility Arbitrage: Identify options showing unusual relative value changes compared to similar strikes. Sometimes 30-day calls decrease 40% while 45-day calls decrease only 20%, creating calendar spread opportunities.

Cross-Strike Analysis: Compare percentage changes across different strikes on the same underlying. Often, out-of-the-money options show more extreme changes than at-the-money options, revealing skew opportunities.

Sector Relative Analysis: Apply the scanner across multiple stocks in the same sector. When airline stocks sell off, compare which airline puts increased most—this identifies relative value within the sector.

ETF vs. Individual Stock Analysis: Compare sector ETF option changes to individual stock changes. Sometimes individual stocks show more extreme moves than their ETFs, creating dispersion trading opportunities.

Automation and Scanning Workflows

Daily Scanning Routine: Each morning, run the scanner on your watchlist with a 1-day lookback to identify overnight changes. Focus on options showing >75% changes for immediate opportunities.

Weekly Planning Process: Every weekend, use a 5-day lookback to identify options that changed significantly during the week. This helps plan strategies for the following week.

Catalyst-Driven Analysis: Before known events (earnings, Fed meetings, etc.), run the scanner with appropriate lookbacks to understand pre-event positioning and post-event opportunities.

The Option Chain Relative Value Scanner transforms options analysis from subjective guesswork into objective, data-driven decision making. By understanding which options have become cheap or expensive relative to their recent history, you gain a significant edge in timing entries and exits across all options strategies.

Option Chain Relative Value Script.ts
# Option Chain Relative Value Scanner

# TOS Indicators – Custom Quote Formula for Options Analysis

# Tutorial: tosindicators.com/indicators/option-relative-value

input lookbackPeriod = 5;

input showPriceRatio = no;


// ... 31 more lines ...

Unlock This Code

Create a free account to access the full source code and download files.

Create Free Account Login
Run the scanner on option chains after market moves to identify premium expansion or contraction. Look for puts showing +100% increases after selloffs (good for selling premium) or calls showing -50% decreases during stable periods (good for buying cheap premium). Use 1-day lookback for overnight changes, 5-day for weekly analysis. Filter for volume >10 and open interest >50 to ensure liquidity.
Generally, changes >50% indicate significant opportunities. Puts increasing 100-300% during market stress often present excellent premium selling opportunities. Calls decreasing 50-75% during volatility crush may offer attractive buying opportunities. Changes 300% require careful analysis as they may indicate fundamental shifts requiring position sizing adjustments.
Use 1-2 day lookbacks for day trading and overnight analysis, 3-5 days for swing trading weekly cycles, and 10-20 days for longer-term trend analysis. Earnings traders should use 1-day lookbacks to capture volatility crush effects. For Fed meetings or major events, use 2-3 day lookbacks to see pre and post-event changes. Adjust the input parameter in the script: input lookbackPeriod = 5 (change 5 to your desired days).
Yes, the Option Chain Relative Value works well for day trading when properly configured. Use it on 5-15 minute charts with tighter settings for more responsive signals. Combine with volume analysis and support/resistance levels for higher probability setups. Always use stop losses as intraday moves can be volatile.
The ratio shows what percentage of the stock price the option costs. The IBD rule suggests at-the-money options should cost 6% often indicate expensive options, while <2% may indicate cheap options or low volatility periods. Use this with the percentage change data: a 3% ratio with +150% recent increase suggests overpriced options, while 2% ratio with -50% decrease may indicate value.
Set minimum volume ≥10 and open interest ≥50 for individual stocks, higher for ETFs (volume ≥50, OI ≥200). Avoid options with bid-ask spreads >20% of midpoint price. For penny stocks or low-priced options, increase volume requirements proportionally. The script includes these filters: input minVolume = 10; input minOpenInterest = 50. Adjust based on your trading size and underlying liquidity.
Yes, but crypto and forex options often have different volatility patterns than stock options. Also, you are limited to the symbols inside of ThinkOrSwim (/BTC for Bitcoin -- or one of the Bitcoin ETFs).
Yes, combine with volatility indicators like VIX levels, moving averages for trend context, and volume analysis for confirmation. Use the Volatility Box or squeeze indicators to time entries when relative value aligns with technical setups. For example, buy cheap calls (showing -60% decrease) when price bounces from support levels. Sell expensive puts (showing +150% increase) when price hits resistance in downtrends. Layer fundamental catalysts for highest probability setups.

Here are some resources that you may find useful:

  • How to import an indicator into ThinkOrSwim (video tutorial)
Featured Tools:
Stock Volatility Box

Stock Volatility Box

Spot reversal zones across 600 stocks & ETFs.

  • Hourly & daily models
  • Powerful Live Scanner
  • Built for day traders
Futures Volatility Box

Futures Volatility Box

Pinpoint reversal zones in 10 major futures markets.

  • 5 models (incl. Scalper)
  • ThinkOrSwim & TradingView
  • SPX traders
ORB Setups

ORB Setups

Find the best Opening Range Breakout setups.

  • Powerful real-time scanner
  • Instant backtests
  • 2+ years data

Get Free Access

Create a free account for downloads and new tutorial alerts.

Create Free Account

More Tutorials Like This

Edge Signals

Edge Signals

Beginner-Friendly • 14 mins
Trend Squeeze

Trend Squeeze

Beginner • 22 minutes
Candle Counter

Candle Counter

Beginner-Friendly • 16 mins

Ready to Trade With an Edge?

Join 40,000+ traders using institutional-grade tools for ThinkOrSwim.

Get the Bundle
TOS Indicators

Premium thinkorswim indicators, scans, and trading tools to help you trade smarter.

ThinkOrSwim Tools

  • Indicators
  • Scans
  • Backtesters
  • Dashboards
  • thinkScript
  • Browse All

Courses

  • Squeeze Course
  • Earnings Course
  • V-Shaped Reversals
  • Fibonacci Trading

Products

  • Futures Volatility Box
  • Stock Volatility Box
  • ORB Setups
  • Shop All

Guides

  • TTM Squeeze
  • Automated Trading
  • Volatility Trading
  • Opening Range Breakouts
  • Trade Reports
  • Contact Us

© 2026 TOS Indicators. All rights reserved.

Privacy Policy Terms of Service Disclaimer

The information contained on this website is solely for educational purposes, and does not constitute investment advice. The risk of trading in securities markets can be substantial. You must review and agree to our Terms of Service prior to using this site.

U.S. Government Required Disclaimer - Commodity Futures Trading Commission. Futures and options trading has large potential rewards, but also large potential risk. You must be aware of the risks and be willing to accept them in order to invest in the futures and options markets. Don't trade with money you can't afford to lose. This website is neither a solicitation nor an offer to Buy/Sell futures or options. No representation is being made that any account will or is likely to achieve profits or losses similar to those discussed on this website. The past performance of any trading system or methodology is not necessarily indicative of future results.

Individual results may vary, and testimonials are not claimed to represent typical results. All testimonials are by real people, and may not reflect the typical purchaser's experience, and are not intended to represent or guarantee that anyone will achieve the same or similar results.

TOS Indicator's Traders and employees will NEVER manage or offer to manage a customer or individual's options, stocks, currencies, futures, or any financial markets or securities account. If someone claiming to represent or be associated with TOS Indicator solicits you for money or offers to manage your trading account, do not provide any personal information and contact us immediately.

CFTC RULE 4.41 - HYPOTHETICAL OR SIMULATED PERFORMANCE RESULTS HAVE CERTAIN LIMITATIONS. UNLIKE AN ACTUAL PERFORMANCE RECORD, SIMULATED RESULTS DO NOT REPRESENT ACTUAL TRADING. ALSO, SINCE THE TRADES HAVE NOT BEEN EXECUTED, THE RESULTS MAY HAVE UNDER-OR-OVER COMPENSATED FOR THE IMPACT, IF ANY, OF CERTAIN MARKET FACTORS, SUCH AS LACK OF LIQUIDITY, SIMULATED TRADING PROGRAMS IN GENERAL ARE ALSO SUBJECT TO THE FACT THAT THEY ARE DESIGNED WITH THE BENEFIT OF HINDSIGHT. NO REPRESENTATION IS BEING MADE THAT ANY ACCOUNT WILL OR IS LIKELY TO ACHIEVE PROFIT OR LOSSES SIMILAR TO THOSE SHOWN.