Skip to content

michaelsboost/StrategyArena

Repository files navigation

Strategy Arena

Strategy Arena is your Monte Carlo trading strategy stress-test simulator!

Strategy Arena Dashboard

MIT License GitHub Stars GitHub Issues


πŸš€ About Strategy Arena

Strategy Arena is a free, open- source trading strategy simulator designed to help you stress-test trading systems against brutal Monte Carlo simulations. It compares survivability, drawdown, expectancy, risk of ruin, and regime adaptability across multiple trading strategies using real simulated market conditions β€” no mock data, no cherry-picked results.

With complete privacy in mind, Strategy Arena runs entirely in your browser β€” no accounts, no backend, no tracking. Just you and the arena.


🌟 Features

βœ… 10 Strategy Archetypes – Momentum, Breakout, Scalping, VWAP, Mean Reversion, Price Action, SMC/ICT, Pullback, Order Flow, and Opening Range Breakout. Each with unique tradable DNA.
βœ… Editable Strategy DNA – Tune signal strictness, risk/reward, discipline, revenge tendency, slippage sensitivity, risk per trade, and commission per trade.
βœ… 8 Market Regimes – Test against Trending Bull/Bear, Ranging, High/Low Volatility, News Shocks, Low Liquidity, and Random Mixed markets. Mix and match any combination.
βœ… Monte Carlo Engine – Simulates hundreds to thousands of independent trading paths per strategy/regime combination. Real statistics, not single-curve backtests.
βœ… Arena Champion Leaderboard – Strategies ranked by Survivability Score, which prioritizes longevity over raw returns.
βœ… Rich Visualizations – Survivability bar chart, risk vs reward scatter map, regime survivability heatmap, champion equity curve, champion drawdown curve, champion DNA radar chart.
βœ… Arena Verdicts & Post-Mortem – Auto-generated insights: Best Overall, Safest, Highest Return, Most Dangerous, Beginner Friendly, Regime Dependent, Most Psychologically Brutal, Worst Overall.
βœ… Simulation Modes – Quick (100 trades, 250 paths), Standard (300 trades, 1000 paths), Deep (500 trades, 2500 paths).
βœ… Share App – Native Web Share API support on mobile, clipboard fallback.
βœ… Local Storage Persistence – All strategy edits and regime selections save automatically to your browser.
βœ… Offline-First – Works without internet after initial load.
βœ… Open Source (MIT) – Free forever, no paywalls, no data collection.


πŸ› οΈ Tech Stack

Strategy Arena uses a number of open-source technologies to work properly:

  • Alpine.js – Lightweight reactive frontend framework.
  • Tailwind CSS – Utility-first styling for a clean, dark interface.
  • Plotly.js – Interactive, publication-quality charts.
  • LocalStorage API – Offline-first data persistence for strategy DNA.
  • Web Share API – Native sharing on mobile devices.

πŸ“₯ Installation & Setup

Strategy Arena is fully web-based – no installation needed. Try it now:
➑️ Strategy Arena Online Demo (Update with your actual URL)

Or, to run locally:

Clone the Repository

git clone https://github.com/michaelsboost/StrategyArena.git
cd StrategyArena

Start a Local Server

To preview Strategy Arena locally, use a simple Python server:

python3 -m http.server 8000

Then, open http://localhost:8000 in your browser.


πŸ’Ύ Data Privacy & Persistence

All Strategy Arena data is stored exclusively in your browser's localStorage under keys arena_strats and arena_regimes. This means:

  • βœ… No accounts or sign-ups required
  • βœ… No data ever leaves your device
  • βœ… No tracking, analytics, or telemetry
  • βœ… Works completely offline
  • βœ… Your strategy DNA and regime selections persist between sessions

Your custom strategy parameters and enabled/disabled regimes save automatically. Reset to defaults anytime with the ⟳ Reset button.


πŸ“Š How It Works

Strategy Arena is built around one reactive Alpine.js component (arenaApp()) that contains all state and methods. Here's how the core metrics are calculated:

Metric Calculation
Win Rate Simulated outcome based on strategy DNA + market regime + random variance across Monte Carlo paths
Survivability Score (Survival Rate Γ— 0.4) + ((100 - Max Drawdown) Γ— 0.2) + (Win Rate Γ— 0.2) + (Positive Return Bonus Γ— 0.2)
Risk of Ruin Percentage of Monte Carlo paths where equity fell below 20% of starting capital
Expectancy Average profit/loss per trade (account %) across all paths
Max Drawdown Average peak-to-trough decline across all paths
Regime Adaptability How survivability score changes across different market conditions

Monte Carlo Engine Logic:

For each enabled strategy in each enabled regime:

  1. Simulates N trades (100/300/500 based on mode)
  2. For each trade, calculates win probability from:
    • Base probability (35% + DNA bias + signal strictness)
    • Regime modifiers (trend coefficient, chop factor, fakeout rate)
    • Strategy discipline and revenge tendency
  3. Rolls random number β†’ determines win/loss
  4. Calculates PnL using risk/reward on loss or win
  5. Subtracts commissions and slippage
  6. Updates equity curve and max drawdown
  7. Strategy "blows up" if equity < 20% of starting
  8. Repeats for M paths (250/1000/2500)
  9. Averages results across all paths

No mock data. Every win and loss is statistically generated based on your strategy's DNA and the market regime you choose.


🧬 Strategy DNA Parameters

Parameter What It Does Default Range
Signal Strictness Higher = fewer, higher-quality trade setups 0.00 - 1.00
Risk/Reward Target Profit target relative to risk (e.g., 2.0 = risk $1 to make $2) 0.80 - 3.50
Discipline Level Consistency of following trading plan 0.20 - 1.00
Revenge Tendency Likelihood of tilt-trading after losses 0.00 - 1.00
Slippage Sensitivity How much market friction affects fills 0.00 - 1.00
Risk Per Trade Percentage of account risked per trade 0.5% - 4.0%
Commission Transaction cost per trade (USD) $0 - $15

Each strategy archetype starts with unique baseline DNA tuned to its trading style. Expand any strategy card and tweak the sliders to create custom variants.


🌍 Market Regimes

The Monte Carlo engine simulates different market conditions by manipulating volatility, trend strength, chop, and fakeout frequency. Enable/disable any combination:

Regime Characteristics Best For
πŸ“ˆ Trending Bullish Strong upward bias, low chop Momentum, Pullback, Breakout
πŸ“‰ Trending Bearish Strong downward bias SMC/ICT, Momentum (short)
⏸️ Ranging / Choppy Sideways, frequent reversals Mean Reversion
πŸŒͺ️ High Volatility Large price swings, high slippage Breakout, Order Flow
πŸƒ Low Volatility Tight ranges, low friction Scalping, VWAP
πŸ“° News Shock Spike volatility, fake moves Avoid or trade with breakout
πŸ’§ Low Liquidity Poor fills, higher slippage Avoid (VWAP, Scalping suffer)
🎲 Random Mixed Unpredictable, no edge Price Action

πŸ“ˆ Understanding the Results

Leaderboard Columns:

  • Survival – Survivability Score (100 = perfect)
  • WinRate – Average win percentage across all paths
  • Expectancy – Average profit/loss per trade
  • MaxDD% – Average maximum drawdown
  • RiskRuin% – Chance of blowing up the account
  • Best Regime – Which market condition suits this strategy most
  • Verdict – Arena Champion / High Risk / Failed Stress Test / Robust Survivor

Charts & What They Tell You:

  • Who Survived Best? – Horizontal bar chart of survivability scores
  • Risk vs Reward – Scatter plot showing MaxDD vs Return. Top-right = best risk-adjusted returns
  • Regime Survivability Heatmap – See exactly which strategies thrive in which markets. The most powerful chart in the Arena.
  • Champion Equity Curve – Median account growth path of the winning strategy
  • Champion Drawdown Curve – Pain-over-time visualization
  • Champion DNA Radar – How the winner scores across survivability, drawdown resistance, win rate, and ruin safety

🀝 Want to Contribute?

Awesome! Strategy Arena is free and open-source, and contributions are always welcome.

How You Can Help:

πŸ”Ή Submit a Pull Request – Found a bug? Have a feature idea? Let's build together!
πŸ”Ή Add New Strategy Archetypes – Propose new trading styles with baseline DNA.
πŸ”Ή Improve Regime Models – Add mean reversion volatility, correlation shocks, or intraday patterns.
πŸ”Ή Enhance Monte Carlo Engine – Add position sizing models or correlated asset simulations.
πŸ”Ή Spread the Word – Share Strategy Arena with traders, quants, and backtesting enthusiasts.
πŸ”Ή Fork & Experiment – Build your own trading simulator!

Development Guidelines:

  1. All strategy data stored in localStorage key: arena_strats
  2. All regime data stored in localStorage key: arena_regimes
  3. The Alpine component arenaApp() contains all state and methods
  4. Add new strategies by extending DEFAULT_STRATS array with name, shortDesc, bestRegime, worstRegime, dnaBias, and paramsDefault
  5. Add new regimes by extending REGIMES_LIST with volatility, trendCoef, chopFactor, fakeout, and optional slippageMalus
  6. Keep the design mobile-first, dark, and card-based
  7. No external tracking, no accounts, no backend β€” preserve privacy

πŸ’– Support Strategy Arena

If Strategy Arena has been helpful to you, here are some ways you can show support:

ko-fi

β˜• Buy me a coffee: ko-fi.com/michaelsboost
🎨 Grab some of my art prints: DeviantArt Store
πŸ‘• Grab some merch: Merch Store
πŸ“š Check out my Graphic Design Course: Learn Design
πŸ’Έ Send a thank you: Tip what it's worth to you

Your support helps keep Strategy Arena free, open-source, and constantly improving. πŸš€


πŸ“œ License

Strategy Arena is open-source under the MIT License.
See the full license: LICENSE


πŸ“§ Contact

For questions, feature requests, or collaborations, reach out to:
Michael Schwartz – michaelsboost.com

About

Monte Carlo trading strategy stress-testing arena built with Alpine.js + Plotly. Compare survivability, drawdown, expectancy, and regime adaptability across multiple trading strategies using real simulation outputs.

Topics

Resources

License

Stars

Watchers

Forks

Contributors