Options Straddle and Strangle Calculator — Free Trading Calculator (Download, Runs in Your Browser)
- 36-straddle-strangle-calculator/index.html — the calculator page — open this in a browser
- 36-straddle-strangle-calculator/ui.mjs — the interface logic
- options-calculators/options.mjs — the calculation engine (options)
- shared/style.css — the styles
- README-FIRST.md — what it does and how to run it
- FREE-LICENSE.md — the free-edition license terms
About this product
Options Straddle and Strangle Calculator is a free trading calculator by Script Master Labs. It prices a long or short straddle or strangle with Black-Scholes and finds both breakevens. It runs entirely in your browser — no server, no account, and nothing you type leaves your device — and its complete source is printed in full on this page and in the free download. No payment, no account, no subscription.
What it computes, in its own terms: a long or short straddle or strangle, priced leg by leg with the Black–Scholes–Merton model from the spot, both strikes, days to expiry, implied volatility, rate and dividend yield you enter. Equal strikes make a straddle; a put strike below the call strike makes a strangle, and the calculator names which you built. It shows each leg's premium, the total cost, both expiry breakevens (put strike − total premium, call strike + total premium), and the percent move required. For a long position the maximum loss is the premium paid and the maximum profit is unlimited; for a short position those reverse.
How to use it
Claim the free download, unzip it, and open the index.html inside the calculator's folder in any modern browser — it runs entirely on your device, with no install, no server and no account. The full source of every file is printed on this page below, and the free download carries the same working files with a README and the free-edition license.
Free edition vs paid edition
The download is the complete calculator — the same working files sold in the paid edition (https://dual.scriptmasterlabs.com/product/straddle-strangle-calculator, $14.99 one-time). The paid edition adds the full written user guide, the evidence receipt, and the licensing and security reviews. Nothing in the calculator is held back from the free edition.
More free tools — free Pine Script v6 indicators and strategies, free trading calculators and a free x402 pre-payment trust check — are collected on the Free Tools hub. Educational software, not financial advice: it computes stated formulas from your inputs; it does not predict price and shows no win rate.
The complete calculator source — free, on this page
Options Straddle and Strangle Calculator is a free trading calculator by Script Master Labs. It prices a long or short straddle or strangle with Black-Scholes and finds both breakevens. It runs entirely in your browser — no server, no account, and nothing you type leaves your device — and its complete source is printed in full on this page and in the free download. No payment, no account, no subscription.
===== file: 36-straddle-strangle-calculator/index.html =====
<!doctype html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><meta name="robots" content="noindex"><title>Options Straddle and Strangle Calculator | SML</title><meta name="description" content="Price a long or short straddle/strangle with Black-Scholes: each leg's premium, the total cost, both breakevens, and the percent move required."><link rel="stylesheet" href="../shared/style.css"></head><body><main><h1>Options Straddle and Strangle Calculator</h1><p>Price a long or short straddle/strangle with Black-Scholes: each leg's premium, the total cost, both breakevens, and the percent move required.</p><form id="calc"><section class="inputs"><label>Underlying price ($)<input name="spot" type="number" step="any" required></label><label>Call strike ($)<input name="callStrike" type="number" step="any" required></label><label>Put strike ($)<input name="putStrike" type="number" step="any" required></label><label>Days to expiry<input name="days" type="number" step="any" required></label><label>Implied volatility (%)<input name="volatilityPercent" type="number" step="any" required></label><label>Risk-free rate (%)<input name="ratePercent" type="number" step="any" value="0" required></label><label>Dividend yield (%)<input name="dividendPercent" type="number" step="any" value="0" required></label><label>Side<select name="side"><option value="long">Long</option><option value="short">Short</option></select></label><label>Contracts<input name="contracts" type="number" step="any" value="1" required></label></section><button type="submit">Calculate</button></form><p id="error" role="alert"></p><section id="results" hidden><h2>Results</h2><div id="metrics"></div><button id="export">Export JSON</button></section><section><h2>How this is calculated</h2><p>Each leg is priced with the Black-Scholes-Merton model: the call at the call strike and the put at the put strike, from the spot, days to expiry, implied volatility, rate and dividend yield you enter. Equal strikes make a straddle; a put strike below the call strike makes a strangle (the calculator names which you built). Total premium per share is the sum of the two legs; the position premium multiplies by contracts × 100. Breakevens at expiry are put strike − total premium and call strike + total premium, and the move needed is the total premium as a percent of spot. For a long position the maximum loss is the premium paid and the maximum profit is unlimited; for a short position those reverse.</p><p>Limitations: Black-Scholes prices European options under constant volatility and a lognormal price model; listed equity options are American, and real implied volatility varies by strike (the smile) — entering one IV for both legs is a simplification this calculator makes openly. Breakevens and max loss/profit are expiry values; the position's value before expiry differs. Commissions, fees, assignment and pin risk are not modelled. This calculator is not financial advice.</p></section></main><script type="module" src="ui.mjs"></script></body></html>
===== file: 36-straddle-strangle-calculator/ui.mjs =====
import {straddleStrangle} from '../options-calculators/options.mjs';const form=document.querySelector('#calc'),results=document.querySelector('#results'),metrics=document.querySelector('#metrics'),error=document.querySelector('#error');let last=null;form.addEventListener('input',()=>{last=null;results.hidden=true;error.textContent=''});form.addEventListener('submit',e=>{e.preventDefault();last=null;results.hidden=true;error.textContent='';try{const inputs=Object.fromEntries([...new FormData(form)].map(([k,v])=>[k,k==='side'?v:Number(v)]));const output=straddleStrangle(inputs);metrics.replaceChildren();for(const [k,v] of Object.entries(output)){const d=document.createElement('div');d.className='metric';d.textContent=k.replace(/([A-Z])/g,' $1');const s=document.createElement('strong');s.textContent=v===null?'Undefined':typeof v==='number'?v.toLocaleString('en-US',{maximumFractionDigits:4}):String(v);d.append(s);metrics.append(d)}last={inputs,output};results.hidden=false}catch(e){error.textContent=e.message}});document.querySelector('#export').onclick=()=>{if(!last)return;const url=URL.createObjectURL(new Blob([JSON.stringify(last,null,2)],{type:'application/json'}));const a=document.createElement('a');a.href=url;a.download='36-straddle-strangle-calculator.json';a.click();URL.revokeObjectURL(url)};
===== file: options-calculators/options.mjs =====
// Shared original calculation engine for the Batch-3 options calculators
// (products 30, 31, 40). The pricing model is the published Black-Scholes-Merton
// model (1973); the normal CDF uses the Abramowitz & Stegun 26.2.17 polynomial
// approximation, the same published numerical method used by product 27's
// engine, and the two implementations are cross-checked against each other in
// options.test.mjs. Fixtures are mathematical, not market observations.
function cdf(x){const t=1/(1+0.2316419*Math.abs(x));const p=Math.exp(-x*x/2)/Math.sqrt(2*Math.PI)*t*(0.319381530+t*(-0.356563782+t*(1.781477937+t*(-1.821255978+t*1.330274429))));return x>=0?1-p:p;}
function pdf(x){return Math.exp(-x*x/2)/Math.sqrt(2*Math.PI);}
export function blackScholes({spot:S,strike:K,years:T,volatility:v,rate:r=0,dividend:q=0,type}){
if(![S,K,T,v,r,q].every(Number.isFinite)||S<=0||K<=0||T<=0||v<=0||!['call','put'].includes(type))throw new RangeError('Positive spot, strike, time and volatility required');
const a=Math.exp(-q*T),b=Math.exp(-r*T),d1=(Math.log(S/K)+(r-q+v*v/2)*T)/(v*Math.sqrt(T)),d2=d1-v*Math.sqrt(T),n=pdf(d1),call=type==='call';
const price=call?S*a*cdf(d1)-K*b*cdf(d2):K*b*cdf(-d2)-S*a*cdf(-d1);
const delta=a*(call?cdf(d1):cdf(d1)-1),gamma=a*n/(S*v*Math.sqrt(T)),vega=S*a*n*Math.sqrt(T)/100;
const theta=(-S*a*n*v/(2*Math.sqrt(T))+(call?q*S*a*cdf(d1)-r*K*b*cdf(d2):r*K*b*cdf(-d2)-q*S*a*cdf(-d1)))/365;
const rho=(call?K*T*b*cdf(d2):-K*T*b*cdf(-d2))/100;
const result={price,delta,gamma,vega,theta,rho};if(!Object.values(result).every(Number.isFinite))throw new RangeError('Model overflow');return result;
}
export function expectedMove({spot,volatilityPercent,days,straddlePrice=null}){
if(![spot,volatilityPercent,days].every(Number.isFinite)||spot<=0||volatilityPercent<=0||days<=0||(straddlePrice!==null&&(!Number.isFinite(straddlePrice)||straddlePrice<=0)))throw new RangeError('Invalid expected-move inputs');
const em=spot*(volatilityPercent/100)*Math.sqrt(days/365);
const result={ivExpectedMove:em,ivExpectedMovePercent:em/spot*100,ivLower:spot-em,ivUpper:spot+em};
if(straddlePrice!==null){const s=0.85*straddlePrice;result.straddleExpectedMove=s;result.straddleExpectedMovePercent=s/spot*100;result.straddleLower=spot-s;result.straddleUpper=spot+s;}
return result;
}
export function deltaHedge({type,side='long',contracts,multiplier=100,spot,strike,days,volatilityPercent,ratePercent=0,dividendPercent=0,sharesHeld=0}){
if(![contracts,multiplier,spot,strike,days,volatilityPercent,ratePercent,dividendPercent,sharesHeld].every(Number.isFinite)||!Number.isInteger(contracts)||contracts<=0||multiplier<=0||spot<=0||strike<=0||days<=0||volatilityPercent<=0||!['long','short'].includes(side))throw new RangeError('Invalid delta-hedge inputs');
const {delta,price}=blackScholes({spot,strike,years:days/365,volatility:volatilityPercent/100,rate:ratePercent/100,dividend:dividendPercent/100,type});
const positionDelta=(side==='long'?1:-1)*contracts*multiplier*delta;
const netDelta=positionDelta+sharesHeld;
const hedgeShares=-Math.round(netDelta);
return {optionPrice:price,deltaPerShare:delta,positionDelta,sharesHeld,netDelta,hedgeShares,hedgeAction:hedgeShares===0?'No hedge trade — already delta-neutral':hedgeShares>0?`Buy ${hedgeShares} shares`:`Sell ${-hedgeShares} shares`};
}
export function breakeven({strategy,strike,premium,contracts=1,multiplier=100,stockPrice,secondPremium,secondStrike}){
if(!Number.isInteger(contracts)||contracts<=0||!Number.isFinite(multiplier)||multiplier<=0)throw new RangeError('Invalid contracts or multiplier');
const m=contracts*multiplier,need=(ok,msg)=>{if(!ok)throw new RangeError(msg);};
const leg=()=>{need([strike,premium].every(Number.isFinite)&&strike>0&&premium>=0,'Strike and premium required');};
switch(strategy){
case 'long-call':leg();return {breakeven:strike+premium,totalPremiumPerShare:premium,maxLoss:premium*m,maxProfit:'Unlimited'};
case 'short-call':leg();return {breakeven:strike+premium,totalPremiumPerShare:premium,maxLoss:'Unlimited',maxProfit:premium*m};
case 'long-put':leg();need(strike-premium>0,'Premium exceeds strike');return {breakeven:strike-premium,totalPremiumPerShare:premium,maxLoss:premium*m,maxProfit:(strike-premium)*m};
case 'short-put':leg();need(strike-premium>0,'Premium exceeds strike');return {breakeven:strike-premium,totalPremiumPerShare:premium,maxLoss:(strike-premium)*m,maxProfit:premium*m};
case 'covered-call':leg();need(Number.isFinite(stockPrice)&&stockPrice>0,'Stock purchase price required');return {breakeven:stockPrice-premium,totalPremiumPerShare:premium,maxLoss:(stockPrice-premium)*m,maxProfit:(strike-stockPrice+premium)*m};
case 'protective-put':leg();need(Number.isFinite(stockPrice)&&stockPrice>0,'Stock purchase price required');need(stockPrice-strike+premium>0,'Strike too high for a protective put on this stock price');return {breakeven:stockPrice+premium,totalPremiumPerShare:premium,maxLoss:(stockPrice-strike+premium)*m,maxProfit:'Unlimited'};
case 'long-straddle':leg();need(Number.isFinite(secondPremium)&&secondPremium>=0,'Put premium required');{const t=premium+secondPremium;return {breakevenLow:strike-t,breakevenHigh:strike+t,totalPremiumPerShare:t,maxLoss:t*m,maxProfit:'Unlimited'};}
case 'long-strangle':leg();need(Number.isFinite(secondPremium)&&secondPremium>=0,'Put premium required');need(Number.isFinite(secondStrike)&&secondStrike>0&&secondStrike<strike,'Put strike (below the call strike) required');{const t=premium+secondPremium;return {breakevenLow:secondStrike-t,breakevenHigh:strike+t,totalPremiumPerShare:t,maxLoss:t*m,maxProfit:'Unlimited'};}
default:throw new RangeError('Unknown strategy');
}
}
export function straddleStrangle({spot,callStrike,putStrike,days,volatilityPercent,ratePercent=0,dividendPercent=0,side='long',contracts=1,multiplier=100}){
if(![spot,callStrike,putStrike,days,volatilityPercent,ratePercent,dividendPercent,contracts,multiplier].every(Number.isFinite)||spot<=0||callStrike<=0||putStrike<=0||days<=0||volatilityPercent<=0||putStrike>callStrike||!Number.isInteger(contracts)||contracts<=0||multiplier<=0||!['long','short'].includes(side))throw new RangeError('Invalid straddle/strangle inputs');
const args={spot,years:days/365,volatility:volatilityPercent/100,rate:ratePercent/100,dividend:dividendPercent/100};
const call=blackScholes({...args,strike:callStrike,type:'call'}),put=blackScholes({...args,strike:putStrike,type:'put'});
const total=call.price+put.price,position=total*contracts*multiplier,long=side==='long';
return {kind:callStrike===putStrike?'Straddle':'Strangle',callPrice:call.price,putPrice:put.price,totalPremiumPerShare:total,positionPremium:position,breakevenLow:putStrike-total,breakevenHigh:callStrike+total,moveNeededPercent:total/spot*100,maxLoss:long?position:'Unlimited',maxProfit:long?'Unlimited':position,side,contracts};
}
===== file: shared/style.css =====
*{box-sizing:border-box}body{margin:0;background:#000;color:#fff;font:16px system-ui}main{max-width:1100px;margin:auto;padding:20px}section{border:1px solid #343434;border-radius:12px;padding:16px;margin:16px 0}h1{font-size:clamp(26px,5vw,42px)}h2{font-size:20px}label{display:grid;gap:6px}input,select,button{font:inherit;color:#fff;background:#121212;border:1px solid #777;border-radius:7px;padding:10px;min-width:0;width:100%}button{background:#123b31;cursor:pointer;width:auto;min-height:44px}button:focus-visible,input:focus-visible,select:focus-visible{outline:3px solid #5eead4}.leg,.inputs,#metrics{display:grid;grid-template-columns:repeat(auto-fit,minmax(130px,1fr));gap:12px}.leg{padding:12px 0;border-bottom:1px solid #444}.metric{padding:12px;border:1px solid #555;border-radius:8px;overflow-wrap:anywhere}.metric strong{display:block;font-size:20px;margin-top:6px}svg{width:100%;height:auto;background:#080808;margin-top:16px}#error{color:#ff9494}p{line-height:1.5}.scroll{overflow-x:auto}table{border-collapse:collapse;width:100%;margin-top:12px;font-size:14px}th,td{border:1px solid #343434;padding:8px;text-align:right;white-space:nowrap}th{background:#121212}td.pos{color:#5eead4}td.neg{color:#ff9494}td.base{background:#123b31;font-weight:700}
Questions about this product
Is there a free straddle and strangle calculator I can download?
Yes. Script Master Labs publishes this Options Straddle and Strangle Calculator as a free download on SML Dual Market (https://dual.scriptmasterlabs.com/product/free-straddle-strangle-calculator). The complete calculator — the same working files sold in the paid edition — is in the free download, and its full source is printed on the product page. No payment, no account, no subscription.
How do I use the Options Straddle and Strangle Calculator?
Claim the free download, unzip it, and open the index.html inside the calculator's folder in any modern browser. Type your numbers and press Calculate. There is nothing to install.
Does the calculator send my numbers anywhere?
No. It runs entirely in your browser on your own device: no server, no account, no feed. The numbers you type never leave your device.
Is the free edition the complete calculator?
Yes — the same working files sold in the paid edition ($14.99 one-time). The paid edition adds the full written user guide, the evidence receipt, and the licensing and security reviews; nothing in the calculator itself is held back.