Algorithmic Trading & Indicators Intermediate

Calculate Combined ATM Straddle Premium & Straddle VWAP for Intraday Option Selling in Python

Track combined Call + Put ATM Straddle price and Straddle VWAP in Python Pandas to time intraday non-directional option selling entries.

#pandas#numpy

Problem Statement

Intraday Nifty and BankNifty straddle sellers don't watch spot charts—they plot the combined premium of `ATM_CE + ATM_PE` against its combined Volume-Weighted Average Price (Straddle VWAP) to short whenever combined premium drops below VWAP.

Formula / Core Logic

Straddle_Close = CE_Close + PE_Close Straddle_Vol = CE_Volume + PE_Volume Straddle_VWAP = CumSum(Straddle_Close * Straddle_Vol) / CumSum(Straddle_Vol)

Installation

pip install pandas numpy
intraday-atm-straddle-premium-vwap-decay-chart-python.py
import pandas as pd
import numpy as np

def compute_straddle_vwap(ce_df, pe_df):
    df = pd.DataFrame(index=ce_df.index)
    df['CE_Close'] = ce_df['Close']
    df['PE_Close'] = pe_df['Close']
    df['Combined_Premium'] = df['CE_Close'] + df['PE_Close']
    df['Combined_Volume'] = ce_df['Volume'] + pe_df['Volume']
    
    dates = df.index.date
    pv = df['Combined_Premium'] * df['Combined_Volume']
    df['Straddle_VWAP'] = pv.groupby(dates).cumsum() / df['Combined_Volume'].groupby(dates).cumsum()
    df['Short_Straddle_Zone'] = np.where(df['Combined_Premium'] < df['Straddle_VWAP'], 1, 0)
    return df

Get the Complete 100+ Python Quant & Automation Bundle

Instant lifetime access to all production-ready scripts, valuation models, and trading bots ($19).

Buy Full Bundle on Gumroad ($19) →

Frequently Asked Questions

Q: What triggers a stop-loss when trading using Straddle VWAP?

Option sellers typically exit or hedge the losing leg if `Combined_Premium` closes 2 consecutive 5-minute candles above `Straddle_VWAP`.