Skip to content

Montréal Times

A Trading Bot That Has to Earn Permission to Trade: Bicheng (Kenneth) Wang's financial-agent Puts Eight Statistical Tests Between a Backtest and Real Money

Cover Image for A Trading Bot That Has to Earn Permission to Trade: Bicheng (Kenneth) Wang's financial-agent Puts Eight Statistical Tests Between a Backtest and Real Money
Share:

PALO ALTO, Calif., Nov. 5, 2026 — Most trading software makes it easy to go from a promising backtest to a live order. A few lines of configuration, an API key, and a strategy that looked good on twenty years of history is suddenly trading real money. The history of quantitative finance is full of strategies that looked excellent in that history and lost money the day they met the market.

Bicheng (Kenneth) Wang, a Bay Area engineer who builds machine-learning decision systems, built an open-source platform around the opposite assumption: a strategy has not earned the right to trade until it proves itself several times over, and the software, not the trader's enthusiasm, decides when that has happened.

His project, financial-agent, is a Python platform for systematic research on exchange-traded funds. It runs cost-aware portfolio backtests, certifies strategies against a fixed set of statistical tests, paper-trades them, and only then allows execution through the brokers Alpaca or Interactive Brokers, behind a series of explicit gates. The package was published on the Python Package Index as fa-quant under the MIT license, first as version 1.2.1 on Oct. 21, 2026; the current version, 1.3.0, followed on Oct. 28. As of Nov. 5 the repository had 48 stars and 9 forks on GitHub.

The README opens with a sentence few trading tools put on the front page: the platform is beta, "live performance is unproven," and neither a historical pass nor paper results guarantee profit.

From research to live, one gate at a time

The pipeline has five stages: research, backtest, validation and certification, paper trading, and live trading. A risk layer with a persistent kill switch sits alongside the last two.

The financial-agent pipeline, from research to live trading

Backtests fill orders at the next bar's open price, include trading costs, buy whole shares and keep a 2 percent cash buffer. The example portfolio draws on eleven widely traded ETFs covering U.S. and international stocks, Treasury and corporate bonds, gold, commodities and real estate.

Certification is where the project is strictest. The packaged policy requires a strategy to pass all eight of these checks, and any value that cannot be computed counts as a failure:

Check Required value
Walk-forward out-of-sample sessions at least 2,520 (about ten years)
Out-of-sample net Sharpe ratio at least 0.5
Deflated Sharpe Ratio probability at least 0.95
CSCV probability of out-of-sample loss at most 0.10
Out-of-sample maximum drawdown at most 25%
Net Sharpe with trading costs doubled at least 0.3
Net Sharpe with orders delayed one extra session at least 0.3
Block-bootstrap Sharpe, 5th percentile above zero

Several of these tests come from academic work on backtest overfitting. The Deflated Sharpe Ratio, introduced by David H. Bailey and Marcos López de Prado, discounts a strategy's Sharpe ratio for the number of variants tried before it was chosen. Combinatorially symmetric cross-validation (CSCV) and the probability of backtest overfitting (PBO), from the same research line, ask whether the parameters that looked best in-sample keep their edge out-of-sample. The two stress checks, doubled costs and a one-day delay, ask whether a result survives the frictions every live trader meets.

Passing on paper history is still not enough. Before the software will connect to a live broker, it requires a passing certificate no older than 90 days for exactly the same strategy and parameters, at least 20 separate successful paper-trading sessions on the same broker, no risk halts or reconciliation breaks in the most recent 20 sessions, and observed paper slippage no worse than twice what the model assumed. The trader must also set an environment variable to allow live mode, and the resulting authorization expires after 15 minutes. Configuration cannot loosen the runtime risk limits. The project's own strategy is at the start of that clock: Alpaca paper sessions were scheduled to start Oct. 29, with first paper orders on Nov. 2, and the earliest possible live decision is Nov. 25, provided no paper session halts. Live trading is not authorized.

Publishing the scores, including the failures

The repository includes a committed evidence report on real market data from Feb. 6, 2006, the earliest date all eleven ETFs share, through Oct. 12, 2026, with costs left at their defaults. It compares the platform's two strategies with two familiar benchmarks:

Strategy Annual return Net Sharpe Max drawdown
Trend, volatility-targeted 5.6% 0.74 16.5%
Dual momentum 11.1% 0.75 26.4%
SPY buy-and-hold 11.1% 0.65 54.3%
60/40 SPY/IEF 8.2% 0.79 32.0%

The trend strategy passes all eight checks, with an out-of-sample Sharpe of 0.729 and a Deflated Sharpe probability of 0.996. The report then adds a qualification that most strategy pages would leave out: a PBO of 0.650 warns that choosing among the trend strategy's parameter variants adds no reliable value. So on Oct. 28 Wang froze the variant the search had chosen, a 12 percent volatility target with at most 25 percent in any one fund, so that a re-certification can no longer switch parameters and restart the paper-trading clock. Re-certified on data through Oct. 27, with all four variants tried still counted against it, the frozen strategy passes again, with an out-of-sample Sharpe of 0.704 and a Deflated Sharpe probability of 0.994. The report cautions that the freeze stabilizes the strategy; it does not strengthen the statistical case. Dual momentum and the 60/40 benchmark also pass as single, untuned variants, though dual momentum's three 33.3 percent positions exceed the platform's 30 percent per-name cap. Buying and holding the S&P 500 fund fails the drawdown limit. The README states that no parameters or thresholds were tuned to pass.

The platform also keeps a negative result on the record. Its equity "research forecast" strategy, which uses a dated research signal produced with a large language model, fails its real-ledger gate because there is not yet enough history to support promoting it. A few months of forecasts cannot fill a single out-of-sample test window, and the report concludes: "do not promote this strategy or relax the gate to accommodate the available sample."

A limitations section is equally specific. Yahoo's adjusted price data can change retroactively. A fixed ETF list carries selection bias. The simulations leave out taxes, interest on cash, market impact and some corporate-action details. The kill switch stops new orders but does not cancel open ones or sell positions.

A consistent method across his projects

financial-agent is one of four open-source projects Wang maintains, and the same habit runs through all of them: make a claim checkable before relying on it. His ai-decision-system produces replayable records for AI-assisted decisions. His RL-pricing lab re-tests published claims about trading AI, beginning with a result from his own paper, which it found does not hold under stricter rules. His multi-agents project benchmarks teams of AI coding agents against a single agent and prices every call.

financial-agent also carries the research lineage behind that work. Alongside the ETF platform, the repository keeps an equity-research harness with dated forecast packages and audits, and separate reinforcement-learning and deep-learning research stacks. The README marks those stacks experimental and states that they cannot reach real capital unless adapted to the platform's strategy interface and passed through the same gates.

Why it matters

Retail investors and small funds now have easy access to broker APIs and to AI tools that can write a trading strategy in minutes. That combination makes the step from idea to live order shorter than ever, and the evidence needed to justify it easier to skip. financial-agent makes that evidence a requirement the code enforces.

The platform is free to install, and its offline demo runs a full backtest, certification and 25 simulated paper sessions on synthetic data in under a minute. Its contribution is a standard anyone can inspect: fixed tests, published thresholds, results that include failures, and a live switch that stays off until the evidence is in.

About Bicheng (Kenneth) Wang

Bicheng (Kenneth) Wang is a Bay Area engineer who builds machine-learning decision systems for digital commerce, and the methods used to evaluate and control them. His independent open-source work includes financial-agent, a research and paper-trading platform with gated execution; RL-pricing, a reproducibility lab for trading AI; ai-decision-system, replayable records for AI-assisted decisions; and multi-agents, a runner and benchmark for teams of coding agents. He is the co-author, with Xinyi Zhang, of "Deep Reinforcement Learning for Equity Trading: Benchmarking Actor-Critic Methods with Forward Retraining" (arXiv:2609.31870).

Learn more: bichengwang.github.io/kw.github.io · github.com/BichengWang/financial-agent · Documentation: bichengwang.github.io/financial-agent