Skip to content

sickmill73/Multi-Leg-Breakeven

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 

Repository files navigation

📊 Multi‑Leg Sync — Portfolio Breakeven Visualizer

Download

Your portfolio’s heartbeat, visualized at a glance.
Multi‑Leg Sync transforms scattered position data into a single, coherent breakeven canvas — no more manual spreadsheet gymnastics.


🧭 Why Multi‑Leg Sync Exists

Every trader eventually faces the same puzzle: “Where exactly is my portfolio’s breakeven price when I hold five different options contracts, two futures, and a swing trade?”

Traditional solutions demand either heroic mental math or expensive subscription platforms. Multi‑Leg Sync bridges that gap with an open‑source, lightweight indicator that:

  • Aggregates any number of open positions into a unified breakeven line.
  • Works across asset classes (equities, futures, forex, crypto).
  • Updates in real time as prices move or positions change.
  • Provides both a visual overlay (on your chart) and numeric readouts for precision.

Think of it as a financial periscope — you can see the exact waterline where your portfolio stops sinking and starts floating.


🎨 Core Philosophy

Traditional Tool Multi‑Leg Sync Equivalent
Separate position trackers Unified breakeven horizon
Manual spreadsheets Automatic aggregation
Single‑leg analysis Multi‑leg synthesis
Static P&L Dynamic threshold detection

🔍 Who Should Use This?

  • Options traders juggling multi‑leg strategies (iron condors, butterflies, calendars).
  • Futures traders hedging across contract months.
  • Swing traders managing a basket of correlated stocks.
  • Portfolio managers needing a quick sanity check before market open.
  • Algorithmic traders who want to surface breakeven levels via API.

🧩 System Architecture

flowchart LR
    A[Position Data Feed] --> B{Aggregation Engine}
    B --> C[Weighted Average Calculator]
    B --> D[Direction Adjuster]
    C & D --> E[Unified Breakeven Signal]
    E --> F[Chart Overlay]
    E --> G[API Endpoint]
    G --> H[Slack/Telegram Bot]
    G --> I[Custom Dashboard]
    F --> J[User Interface]
Loading
  • Position Data Feed: Accepts CSV, JSON, or direct broker API connections.
  • Aggregation Engine: Normalizes position sizes, directions, and asset classes.
  • Weighted Average Calculator: Computes a single breakeven price weighted by contract size.
  • Direction Adjuster: Accounts for long/short asymmetries (e.g., short options breakeven differs structurally).
  • Unified Breakeven Signal: The final threshold — displayed as a horizontal line on your chart.
  • API Endpoint: Exposes the breakeven level for external consumption (bots, dashboards, etc.).

🚀 Feature Matrix

Feature Description Status
🎯 Multi‑leg aggregation Combines any number of open positions
📱 Responsive UI Works on mobile, tablet, and desktop
🌐 Multilingual support 14 languages (auto‑detect or manual)
🔌 OpenAI API integration Natural‑language querying of breakeven data
🤖 Claude API integration Risk narrative generation (e.g., “You’re 3% below breakeven”)
🛡️ 24/7 support Community forum + priority ticket system
🔄 Real‑time sync Sub‑second updates via WebSocket
🧾 CSV/JSON export Portable position snapshots
🔗 Webhook triggers Alert when price crosses breakeven

⚙️ Example Profile Configuration

[profile: spx_iron_condor]
positions = [
    {"asset": "SPX", "type": "call", "strike": 5800, "premium": 12.50, "contracts": 5, "side": "short"},
    {"asset": "SPX", "type": "call", "strike": 5900, "premium": 3.20, "contracts": 5, "side": "long"},
    {"asset": "SPX", "type": "put", "strike": 5500, "premium": 8.90, "contracts": 5, "side": "short"},
    {"asset": "SPX", "type": "put", "strike": 5400, "premium": 2.10, "contracts": 5, "side": "long"},
]
aggregation_method = "weighted_contract_size"
breakeven_display = "horizontal_line"
alert_on_cross = true
webhook_url = "https://hooks.example.com/breakeven"
language = "auto"

💻 Example Console Invocation

# Run Multi‑Leg Sync with a saved profile
python multileg_sync.py --profile spx_iron_condor --interval 1m

# Or provide positions inline
python multileg_sync.py \
  --add "AAPL:200:long:10" \
  --add "AAPL:190:short:5" \
  --add "MSFT:450:long:15" \
  --output json

# With Telegram alerts
python multileg_sync.py --profile my_portfolio --notify telegram

Sample output (console):

╔══════════════════════════════════════════════╗
║ Multi‑Leg Sync v2.3.0  (2026)               ║
╠══════════════════════════════════════════════╣
║ Positions aggregated: 7                      ║
║ Unified breakeven:     437.82                ║
║ Current price:         442.15                ║
║ Distance to BE:        +4.33 (+0.99%)        ║
║ Status:               ⬆️ Above breakeven     ║
╚══════════════════════════════════════════════╝

🖥️ OS Compatibility

Operating System Version Verified
🍏 macOS 12+ (Intel & Apple Silicon)
🪟 Windows 10, 11
🐧 Linux Ubuntu 20.04+, Debian 11+, Fedora 36+
📱 iOS/iPadOS 16+ (via web app)
🤖 Android 11+ (via web app)

🔌 OpenAI & Claude Integration

Multi‑Leg Sync exposes two AI‑driven capabilities:

OpenAI API

# Ask "What happens to my breakeven if SPX drops 2%?"
response = multileg.openai_query(
    api_key="sk-...",
    prompt="Simulate a 2% drop in SPX and recalculate portfolio breakeven."
)
# Returns: interpretable scenario analysis

Claude API

# Generate a risk narrative
narrative = multileg.claude_narrative(
    api_key="sk-ant-...",
    position_data=current_portfolio
)
# Returns: "Your portfolio is above breakeven, but the short puts have 72% delta exposure..."

Both integrations never send raw position data — only anonymized aggregates. You maintain full control via environment variables or config file.


🎯 SEO‑Driven Discovery

Multi‑Leg Sync is optimized for the following search terms (naturally integrated):

  • portfolio breakeven calculator
  • multi‑leg position aggregator
  • unified breakeven line indicator
  • options trading breakeven tool
  • futures breakeven visualization
  • real‑time portfolio threshold
  • multiple positions breakeven line
  • cross‑asset breakeven analysis
  • breakeven alert system
  • open source breakeven indicator

📜 License

This project is distributed under the MIT License.
You are free to use, modify, and distribute it — even commercially — as long as the original copyright notice is included.

View the full license


⚠️ Disclaimer

Multi‑Leg Sync is a visualization and calculation tool — not financial advice.
Breakeven calculations are based on the data you provide and do not account for:

  • Transaction costs, slippage, or commissions
  • Dividend adjustments or corporate actions
  • Tax implications
  • Liquidity constraints

Always verify your breakeven levels with your broker’s official P&L.
Past performance of any strategy does not guarantee future results. Trading involves substantial risk of loss. Consult a licensed financial advisor before making investment decisions.


🤝 Contributing

We welcome contributions of all kinds:

  • 🐛 Bug reports — open an issue with reproduction steps
  • 💡 Feature requests — describe the use case and desired output
  • 🌍 Translations — help us reach more languages
  • 📚 Documentation — improve examples or add tutorials

Please read our CONTRIBUTING.md before submitting pull requests.


📦 Quick Start

git clone https://github.com/example/multileg-sync.git
cd multileg-sync
pip install -r requirements.txt
python multileg_sync.py --demo  # runs with sample positions

Download

Multi‑Leg Sync — because every portfolio deserves a single, honest baseline.
Built for clarity. Designed for conviction.

Releases

No releases published

Packages

 
 
 

Contributors