# Option Chain Relative Value

> Custom ThinkScript indicator using implied volatility and option pricing formulas to identify relative value opportunities.

Page: https://tosindicators.com/indicators/options-deep-dive  
Video: https://www.youtube.com/watch?v=_kTxWNBwAaE  
Section: Indicators  
Skill: Advanced  
Access: free  
Updated: 2026-02-12

## 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
```

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

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


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:




- Open an options chain in ThinkOrSwim

- Add a Custom Quote Formula column

- Paste your script code

- Set the column name to "Pricing" or "RelValue"

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

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



#### 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
```


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 (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.

## thinkScript code

```
# 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;

# Basic relative value calculation
def signal = ((close/close[lookbackPeriod]));

# Option to Stock Price Ratio (uncomment to use)
#plot condition = if signal = 0.5 then color.green 
         else if condition = minVolume;

def filteredCondition = if volumeFilter 
                       then (close - close[lookbackPeriod])/close[lookbackPeriod]
                       else Double.NaN;

# Multi-timeframe analysis
def change1Day = if close[1] != 0 then (close - close[1])/close[1] else 0;
def change5Day = if close[5] != 0 then (close - close[5])/close[5] else 0;
def change10Day = if close[10] != 0 then (close - close[10])/close[10] else 0;

# Toggle between different timeframes by changing the condition variable
# condition = change1Day;  # 1-day analysis
# condition = change5Day;  # 5-day analysis  
# condition = change10Day; # 10-day analysis
```

## Questions

### How do I use the option chain relative value scanner to find trading opportunities?

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.

### What percentage changes indicate significant options trading opportunities?

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

### How do I customize the lookback period for different trading styles?

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).

### Can I use Option Chain Relative Value indicator for day trading?

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.

### How do I interpret the option-to-stock price ratio feature?

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

### What liquidity filters should I use to avoid false signals?

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.

### Can I use this scanner for cryptocurrency or forex options?

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).

### Can I combine this scanner with other technical indicators for better timing?

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.

## Related

- [How to Build a Fair Value Gap Indicator in ThinkorSwim](https://tosindicators.com/indicators/fair-value-gap)
- [How to Build a Heiken Ashi Trend Dots Indicator in ThinkOrSwim](https://tosindicators.com/indicators/heiken-ashi)
- [Commodities Tracker](https://tosindicators.com/indicators/commodities-tracker)
- [Trend Squeeze](https://tosindicators.com/indicators/trend-squeeze)
- [Volume Intensity](https://tosindicators.com/indicators/volume-intensity)
- [Parabolic SAR](https://tosindicators.com/indicators/parabolic-sar)

