trade_bot: The Trading System That Tries to Disprove Itself First
A PowerShell-driven multi-strategy framework that allocates capital by risk, stress-tests edges with PSR and DSR, and keeps itself alive with crash-only automation.
- trade_bot treats strategy selection as a capital allocation problem, not a signal-chasing problem.
- Its core edge is skepticism, because live sizing is gated by volatility, robustness tests, and mode-switch safeguards.
- The repository is built as a fleet of isolated Tracks supervised by a central portfolio brain.
- PowerShell is not incidental here, because it serves as the orchestration layer for trading, validation, and recovery.
Most open-source trading bots want to prove they can enter. `trade_bot` wants to prove a strategy deserves to survive. That difference changes everything: how the code is organized, how capital is sized, how the system is tested, and how it recovers when something goes wrong.
The bot that treats every strategy like a suspect
The repository is built around a simple but unusual idea: a strategy is not trusted just because it backtests well once. It has to survive statistical skepticism, compete for capital against other tracks, and stay within operational guardrails once it goes live.
That makes `trade_bot` feel closer to a risk committee than a retail bot. The system is not asking, Can this strategy make money? It is asking, Does this edge survive stress, and if so, how much capital should it get?
That posture shows up everywhere. The codebase keeps strategy logic isolated, pushes portfolio judgment into the allocator, and treats uptime as a first-class feature instead of an afterthought.
A fleet of Tracks, not one monster script
The repository is structured as a set of Tracks. Each `track-*` folder holds a separate strategy, while `multibot/` acts like the portfolio brain. `server/` handles supervision, and `dashboard/` provides a local control surface.
The important thing is not just that the tracks are separate. It is that they are supervised as a portfolio. Strategy code can fail without taking the whole system down, and the allocator can keep reshaping capital exposure without rewriting the underlying strategy engines.
| Typical open-source bot | trade_bot |
|---|---|
| A few strategies glued together | Isolated Tracks with a central allocator |
| Entry and exit logic get most of the attention | Validation, allocation, and supervision get equal weight |
| Signals map directly to orders | Portfolio statistics compile into live config |
| Runtime recovery is often manual | Crash-only recovery is part of the design |
Why PowerShell is the weirdly right choice
PowerShell is the most surprising part of the stack, but it is not a gimmick. It works because the project is as much about orchestration as it is about trading. The code has to pull API data, manage JSON, spawn processes, supervise logs, and rewrite runtime config without much ceremony.
That is exactly the kind of problem PowerShell is good at. It handles structured objects cleanly, fits system-style automation, and makes local process control feel native rather than bolted on. For a long-running trading system, that matters more than language fashion.
There is also a practical advantage: the repo reads like infrastructure code with a financial model embedded in it. That makes the project easier to reason about than a monolithic strategy script, even when the strategy logic itself is sophisticated.
The live allocator is the real brain
`multibot-live.ps1` is where the project becomes a portfolio system. It reads track return streams, estimates volatility, and assigns capital with inverse-volatility weighting so lower-volatility tracks get more exposure and higher-volatility tracks get less.
That is a risk-parity instinct, translated into deployment logic. The allocator is not predicting the future. It is trying to make sure no single track dominates the portfolio just because it recently looked lucky.
The script also uses hysteresis. That matters because live systems can flap when equity hovers near a threshold. Hysteresis gives the bot a buffer, so it does not keep bouncing between real and dry-run behavior every time the numbers wobble.
| Allocator step | What it does | Why it matters |
|---|---|---|
| Volatility estimate | Measures how noisy each track has been | Noisy tracks deserve less capital |
| Inverse-volatility weighting | Allocates more to steadier tracks | Turns risk into sizing |
| Hysteresis gate | Adds a switching buffer near thresholds | Prevents mode flapping |
| Config emission | Writes the live strategy config | Converts portfolio judgment into execution |
Seen plainly, the allocator is a compiler. It takes portfolio data as input, runs a rule set over it, and emits a config file that the execution engine can consume. That is a more interesting abstraction than a bot that simply sprays orders.
The robustness battery that keeps the bot honest
`mb-tests.ps1` is the project’s anti-hype layer. It does not just report backtest returns. It asks how fragile those returns might be once you account for luck, overfitting, and sample noise.
That is where PSR, DSR, and block bootstrap enter the picture. PSR adjusts for the shape of returns. DSR tries to discount data mining bias. Block bootstrap resamples chunks of history so the test respects streaks and serial dependence instead of pretending every day is independent.
The big idea is simple: a strategy is not impressive because it won one backtest. It is impressive if it still looks viable after the code has tried hard to break its confidence.
# Metric names that matter in the robustness battery
$metrics = @(
'PSR', # Probabilistic Sharpe Ratio
'DSR', # Deflated Sharpe Ratio
'BootstrapCI',
'MaxDD',
'WinRate',
'TailRisk'
)
Track C and the anatomy of a fade
Track C, in `track-C/newcomers.ps1`, gives the abstraction a concrete shape. It is built around fresh listings, wick filtering, and post-only execution. The edge lives in a narrow age window, and the code treats that window as something measurable rather than mystical.
That is a good example of the repo’s temperament. It looks for a very specific market condition, tests it aggressively, and then tries to express it with execution discipline instead of brute force.
The result is a strategy that feels surgical. It does not want every move. It wants the right kind of exhaustion, in the right kind of market, with the right kind of order placement.
| Track C design choice | What it signals |
|---|---|
| Fresh listings only | The edge is time-sensitive |
| Wick filtering | Not every spike is worth fading |
| Post-only orders | Execution quality matters |
| Narrow age window | The strategy depends on market microstructure |
The self-healing layer nobody brags about
The `server/` scripts are easy to overlook, but they are central to the story. `watchdog.sh` monitors heartbeats, kills stuck processes, and lets the supervisor restart them. That is crash-only thinking applied to trading infrastructure.
This is the kind of plumbing that separates a demo from a system you can leave alone. Hanging processes, stale sessions, and silent failures are treated as normal failure modes, not rare disasters.
The design is blunt, which is a compliment. If the process is unhealthy, kill it. If it can restart cleanly, the system can recover without drama.
Why this is not a beginner bot
This repository is mature, but it is not friendly in the plug-and-play sense. It expects a disciplined environment, a fixed directory layout, and a willingness to think in terms of logs, config files, supervisors, and risk budgets.
That makes it a better fit for a serious hobbyist, a small team, or a builder who wants a production-flavored framework rather than a toy example. The code is opinionated because the problem is opinionated.
| If you want... | trade_bot is a fit if... |
|---|---|
| A quick starter bot | You want architecture more than convenience |
| A signal toy | You do not need portfolio-level risk control |
| A production-style framework | You are comfortable with orchestration and monitoring |
| A black-box strategy | You prefer transparent, testable components |





