OPEN-SOURCE SCRIPT
Iron Condor & Butterfly Visualizer

It helps you visualize and manage your option spread by:
Plotting strike prices and breakeven lines directly on the chart.
Showing profit/loss zones, adjustment zones, and alerts when price nears critical levels.
Calculating risk/reward, probability of profit, theta decay, IV condition, and trade score.
🎯 2. Inputs & Configuration
You input your trade details as a comma-separated string:
For an Iron Condor
ShortCall, LongCall, ShortPut, LongPut, Credit, Contracts, Target%
Example: 626,628,620,618,1.20,1,30
For a Butterfly Spread
LowerWing, Body, UpperWing, Debit, Contracts, Target%
Example: 600,620,640,2.50,2,50
The indicator automatically parses this and knows which strategy type you selected.
You can also control:
Visuals (profit zones, breakevens, labels)
Risk (stop loss %, adjustment zones)
Account/risk sizing
Market conditions (IV Rank, current IV, DTE)
⚙️ 3. Data Parsing & Strategy Recognition
The code reads your pasted string, splits it by commas, and determines:
Which strikes are short vs long (or wings/body for Butterfly)
Whether the strategy is credit (Iron Condor) or debit (Butterfly)
Calculates net credit/debit, contract size, and profit target
📈 4. Profit/Loss Calculations
It dynamically calculates:
Max Profit
Iron Condor: net credit × 100 × contracts
Butterfly: (wing width − debit) × 100 × contracts
Max Loss
Iron Condor: difference between strikes minus credit
Butterfly: debit × 100 × contracts
Breakeven points
Iron Condor: short strikes ± net credit
Butterfly: body ± debit
Current P&L relative to the live price (close).
⚖️ 5. Risk & Position Sizing
It checks:
Stop-loss trigger (% of max loss)
Adjustment alert if price nears short strikes
Recommended contract size based on account size and % risk per trade
Actual % of account at risk
⏱️ 6. Time Decay & IV Analysis
If you input days to expiration, it shows:
Theta (approx daily time decay)
Decay progress bar (% of 30-day cycle)
IV condition:
Green: favorable (>50 IV Rank)
Yellow: neutral (30–50)
Red: poor (<30)
🧮 7. Trade Scoring
It gives a Trade Score (0–100) based on:
IV Rank (favorable market)
Risk/Reward ratio
Probability of profit
Default 20 baseline points
This helps gauge whether the setup is statistically attractive.
🧠 8. Visualizations
When the indicator runs, it draws on your chart:
Lines
Red = short strikes
Orange dashed = long strikes
Yellow dotted = breakeven levels
Boxes
Green = profit zone
Orange shaded = adjustment zones (approaching danger)
Labels (optional)
Strike labels (call/put prices)
Info box summarizing:
Profit, loss, risk/reward
Breakevens, theta, target, gamma risk flag
🚨 9. Alerts
The script triggers TradingView alerts when:
Price nears call or put adjustment zones
Profit target is hit
Stop loss is hit
These help you manage the trade without constant monitoring.
🧭 10. In Practice
You’d:
Copy the option strikes and trade details from your broker or analyzer.
Paste them into 📋 PASTE YOUR TRADE DATA HERE.
The indicator plots:
Profit/loss region
Adjustment warnings
Key metrics
Alerts if your trade is in danger or near target.
Plotting strike prices and breakeven lines directly on the chart.
Showing profit/loss zones, adjustment zones, and alerts when price nears critical levels.
Calculating risk/reward, probability of profit, theta decay, IV condition, and trade score.
🎯 2. Inputs & Configuration
You input your trade details as a comma-separated string:
For an Iron Condor
ShortCall, LongCall, ShortPut, LongPut, Credit, Contracts, Target%
Example: 626,628,620,618,1.20,1,30
For a Butterfly Spread
LowerWing, Body, UpperWing, Debit, Contracts, Target%
Example: 600,620,640,2.50,2,50
The indicator automatically parses this and knows which strategy type you selected.
You can also control:
Visuals (profit zones, breakevens, labels)
Risk (stop loss %, adjustment zones)
Account/risk sizing
Market conditions (IV Rank, current IV, DTE)
⚙️ 3. Data Parsing & Strategy Recognition
The code reads your pasted string, splits it by commas, and determines:
Which strikes are short vs long (or wings/body for Butterfly)
Whether the strategy is credit (Iron Condor) or debit (Butterfly)
Calculates net credit/debit, contract size, and profit target
📈 4. Profit/Loss Calculations
It dynamically calculates:
Max Profit
Iron Condor: net credit × 100 × contracts
Butterfly: (wing width − debit) × 100 × contracts
Max Loss
Iron Condor: difference between strikes minus credit
Butterfly: debit × 100 × contracts
Breakeven points
Iron Condor: short strikes ± net credit
Butterfly: body ± debit
Current P&L relative to the live price (close).
⚖️ 5. Risk & Position Sizing
It checks:
Stop-loss trigger (% of max loss)
Adjustment alert if price nears short strikes
Recommended contract size based on account size and % risk per trade
Actual % of account at risk
⏱️ 6. Time Decay & IV Analysis
If you input days to expiration, it shows:
Theta (approx daily time decay)
Decay progress bar (% of 30-day cycle)
IV condition:
Green: favorable (>50 IV Rank)
Yellow: neutral (30–50)
Red: poor (<30)
🧮 7. Trade Scoring
It gives a Trade Score (0–100) based on:
IV Rank (favorable market)
Risk/Reward ratio
Probability of profit
Default 20 baseline points
This helps gauge whether the setup is statistically attractive.
🧠 8. Visualizations
When the indicator runs, it draws on your chart:
Lines
Red = short strikes
Orange dashed = long strikes
Yellow dotted = breakeven levels
Boxes
Green = profit zone
Orange shaded = adjustment zones (approaching danger)
Labels (optional)
Strike labels (call/put prices)
Info box summarizing:
Profit, loss, risk/reward
Breakevens, theta, target, gamma risk flag
🚨 9. Alerts
The script triggers TradingView alerts when:
Price nears call or put adjustment zones
Profit target is hit
Stop loss is hit
These help you manage the trade without constant monitoring.
🧭 10. In Practice
You’d:
Copy the option strikes and trade details from your broker or analyzer.
Paste them into 📋 PASTE YOUR TRADE DATA HERE.
The indicator plots:
Profit/loss region
Adjustment warnings
Key metrics
Alerts if your trade is in danger or near target.
오픈 소스 스크립트
진정한 트레이딩뷰 정신에 따라 이 스크립트 작성자는 트레이더가 기능을 검토하고 검증할 수 있도록 오픈소스로 공개했습니다. 작성자에게 찬사를 보냅니다! 무료로 사용할 수 있지만 코드를 다시 게시할 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
이 정보와 게시물은 TradingView에서 제공하거나 보증하는 금융, 투자, 거래 또는 기타 유형의 조언이나 권고 사항을 의미하거나 구성하지 않습니다. 자세한 내용은 이용 약관을 참고하세요.
오픈 소스 스크립트
진정한 트레이딩뷰 정신에 따라 이 스크립트 작성자는 트레이더가 기능을 검토하고 검증할 수 있도록 오픈소스로 공개했습니다. 작성자에게 찬사를 보냅니다! 무료로 사용할 수 있지만 코드를 다시 게시할 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
이 정보와 게시물은 TradingView에서 제공하거나 보증하는 금융, 투자, 거래 또는 기타 유형의 조언이나 권고 사항을 의미하거나 구성하지 않습니다. 자세한 내용은 이용 약관을 참고하세요.