Arch Public
Market Wave Optimizer
Equities · backtest & tune
Engine connection
{{ connExplain }}
Re-downloads {{ contextLine }} (cache auto-refreshes when stale).
Start the engine
pip install fastapi uvicorn cp server.py ~/arch-algo-optimizer/ cd ~/arch-algo-optimizer uvicorn server:app --port 8787
server.py ships with this project. Until the engine is up, everything runs on simulated demo data so you can explore the workflow.

Tune it. Run it. See if it beats the market.

Pick a ticker, adjust the Market Wave settings on the left, and run a backtest. You'll get the full picture — equity curve, drawdown, and how the strategy stacks up against buy & hold and DCA.

{{ emptyModeNote }}

{{ rTitle }}

{{ rMeta }} {{ srcLabel }}
{{ k.label }}
{{ k.value }}
{{ k.sub }}
Portfolio value
Strategy Buy & hold DCA Buy Sell
{{ gl.label }} {{ xt.label }}
{{ eqTipDate }}
{{ tr.k }}{{ tr.v }}
Drawdown
how far the portfolio fell from its peak
{{ ddMinLabel }}
{{ gl.label }}
Strategy vs. benchmarks
Total return over the period
{{ b.label }} {{ b.disp }}
Market regimes
Episodes from the Regimes tab · strategy vs. DCA in each
Detecting regimes…
Sensitivity{{ regSensDisp }}
{{ regThetaLine }}
{{ rg.name }} {{ rg.bars }}
Strategy {{ rg.sPct }} DCA {{ rg.bPct }}
Trade activity
{{ ts.k }} {{ ts.v }}
TradingView settings
Paste these into the strategy's settings panel
{{ tv.label }} {{ tv.value }}
{{ tvDateNote }}

Find the settings you'd never try by hand.

Pick a goal — best risk-adjusted return, smallest drawdown, beating buy & hold — and the optimizer tests hundreds of configurations to find what works for this ticker and period.

1 · Choose a goal
What "best" means to you
2 · Run the search
Bayesian learns as it goes
3 · Apply the winner
Back to Backtest, or straight into TradingView
{{ optProgTitle }}
{{ optProgSub }}
{{ optProgCount }} Best so far: {{ optProgBest }}

{{ optTitle }}

{{ optMeta }} {{ srcLabel }}
Best configuration · {{ optObjLabel }}
{{ optHeroValue }}
{{ optHeroSub }}
{{ hk.label }}
{{ hk.value }}
What mattered most
Influence of each setting on the goal
Importance couldn't be computed for this run — usually too few varied trials. Re-run with more trials.
{{ im.label }} {{ im.disp }}
Leaderboard
Top configurations by {{ optObjLabelLower }}
#{{ optObjCol }}ReturnSharpeMax DDWin rateP. factorTrades
{{ lr.rank }} {{ lr.value }} {{ lr.ret }} {{ lr.sharpe }} {{ lr.dd }} {{ lr.wr }} {{ lr.pf }} {{ lr.trades }}
Search progress
each dot is one tested configuration · the line tracks the best found
{{ gl.label }} trial →

{{ roTitle }}

{{ roMeta }} {{ srcLabel }}
Composite configuration · {{ roObjLabel }}
{{ roHeroValue }}
{{ roHeroSub }}
{{ hk.label }}
{{ hk.value }}
Parameter consistency
Composite value · spread of the per-window winners
{{ ps.label }} {{ ps.value }} {{ ps.sub }}
Consistency across market regimes
each window is one slice of history
Best found per window Composite settings
{{ gl.label }} {{ xt.label }}
Windows
How the composite compares to each window's own best
#PeriodBarsWindow bestCompositeGap
{{ wr.rank }} {{ wr.period }} {{ wr.bars }} {{ wr.best }} {{ wr.comp }} {{ wr.gap }}

{{ allTitle }}

{{ allMeta }} {{ srcLabel }}
{{ allSkippedText }}
No timeframe had data covering this range — widen the range or pick a different ticker.
One optimization per timeframe
Same date window, same goal — only the timeframe differs. Best value highlighted.
TimeframeScoreReturnSharpeMax DDWin rateTradesNote
{{ ar.tf }}Best {{ ar.value }} {{ ar.ret }} {{ ar.sharpe }} {{ ar.dd }} {{ ar.wr }} {{ ar.trades }} {{ ar.warmup }}

Same strategy, six lenses.

A configuration that shines on daily bars can fall apart on hourly ones. Run your current settings across every timeframe and see where they hold up.

{{ tfTitle }}

current strategy settings {{ srcLabel }}
TimeframeBarsReturnvs B&HSharpeMax DDWin rateTrades
{{ fr.tf }}Best {{ fr.bars }} {{ fr.ret }} {{ fr.vs }} {{ fr.sharpe }} {{ fr.dd }} {{ fr.wr }} {{ fr.trades }}
Return by timeframe
Strategy Buy & hold
{{ tb.sDisp }}
{{ tb.bDisp }}
{{ tb.tf }}

Optimize for the market you expect.

Pick bull, bear, or sideways and the tool finds every historical episode of that regime in your date range, then searches for one configuration that performs across all of those episodes jointly — robust across many samples, not curve-fit to one lucky stretch.

Detection labels history with hindsight — it finds the true past episodes; it does not predict when the next one starts.

Detecting regimes…
Detection failed
{{ regDetectError }}

{{ regDetTitle }}

{{ regDetMeta }} {{ srcLabel }}
{{ ch.label }} auto-coarsened to cap episode count
{{ regZeroText }}
Detected episodes
Bull Bear Sideways
{{ gl.label }} {{ xt.label }} {{ bx.label }}
{{ regTipTitle }}
{{ tr.k }}{{ tr.v }}
Detection labels history with hindsight — it finds the true past episodes; it does not predict when the next one starts.
Episodes
Rows in your selected regime are highlighted — these are the samples the optimizer will use
RegimePeriodBarsReturnAnn.Max DD
{{ er.name }}{{ er.prov }} {{ er.period }} {{ er.bars }} {{ er.ret }} {{ er.ann }} {{ er.dd }}
{{ regProgTitle }}
{{ regProgSub }}
{{ regProgCount }} Best so far: {{ regProgBest }}

{{ regResTitle }}

{{ regResMeta }} {{ srcLabel }}
{{ w.text }}
{{ regHeroLabel }}
{{ regHeroValue }}
{{ regHeroSub }}
{{ hk.label }}
{{ hk.value }}
What mattered most
Influence of each setting on the composite score
Importance couldn't be computed for this run — usually too few varied trials. Re-run with more trials.
{{ im.label }} {{ im.disp }}
Per-episode results
The same best settings, backtested independently on each episode
{{ ec.name }}
worst warmup
{{ ec.period }}
{{ ec.ret }} {{ ec.obj }}
{{ ec.ann }}
Leaderboard
Top configurations · spread shows fragile-but-lucky settings
#ScoreMeanStd
{{ lr.rank }} {{ lr.value }} {{ lr.mean }} {{ lr.std }}
TradingView settings
Paste these into the strategy's settings panel
{{ tv.label }} {{ tv.value }}
{{ tvDateNote }}
{{ toastMsg }}