Run Monte Carlo simulations for Finance Guru portfolio strategy...
Monte Carlo simulation engine for Finance Guru's 4-layer dividend income + margin living strategy. Runs 10,000 market scenarios to project income probabilities, margin safety, and portfolio outcomes over 28 months.
| Workflow | Trigger | File |
|---|---|---|
| RunSimulation | "run monte carlo", "simulate portfolio", "stress test" | workflows/RunSimulation.md |
| IncorporateBuyTicket | "include buy ticket", "add ticket to simulation" | workflows/IncorporateBuyTicket.md |
Example 1: Run standard Monte Carlo simulation
User: "Run the monte carlo simulation with current portfolio"
-> Invokes RunSimulation workflow
-> Derives current values, then updates the hard-coded inputs in run_single_scenario()
-> Runs 10,000 scenarios with v3.0 4-layer model
-> Outputs JSON summary + full CSV + Excel to analysis/
Example 2: Incorporate a buy ticket into simulation
User: "Run monte carlo with my new buy ticket from 12-31"
-> Invokes IncorporateBuyTicket workflow
-> Reads buy ticket from tickets/buy-ticket-2025-12-31-*.md
-> Parses YAML frontmatter + Execution Summary table from the canonical ticket format
-> Adjusts starting portfolio values based on ticket allocations
-> Runs simulation with updated positions
Example 3: Stress test margin safety
User: "What's my margin call probability?"
-> Invokes RunSimulation workflow
-> Focuses on margin_call_rate and margin_ratio metrics
-> Reports 5th percentile (worst case) margin ratio
All outputs saved to analysis/:
monte-carlo-v3-{date}.json - Summary statisticsmonte-carlo-v3-full-results-{date}.csv - All 10,000 scenariosmonte-carlo-v3-analysis-{date}.xlsx - Excel workbook with chartsThe instance-local script at strategies/dividend_margin_monte_carlo.py reads starting portfolio values that are hard-coded in run_single_scenario(). It does not auto-detect values from CSV. Before each run, follow the RunSimulation workflow to derive current values and edit those assignments.
Simulation parameters include:
run_single_scenario())v3.0 (Jan 2026) - Full 4-layer portfolio:
Fixes applied: