I set out to build a trading bot that made money. I ended up building something more useful: a machine that could tell me, without flinching, that my idea didn’t work.
That sounds like a consolation prize. It isn’t. In a field where almost every public backtest is a lie by omission, the rare thing is a result you can actually believe. This is the story of how I got one, and what it cost the idea I was rooting for.
The setup
The bot was a real system, not a toy. It ran live on MetaTrader 5 against a demo account, in two modes: FX majors during the London and New York sessions, and crypto around the clock. It read the daily trend as the directional law, used the hourly and 15-minute charts for timing, sized every position off ATR-based stops, and trailed winners with a high-water lock. There was an AI layer on top (Groq and Anthropic) that reviewed each mechanical setup, boxed in by code so it could never trade against the trend rule. Telegram alerts, an SQLite ledger of every decision, a live terminal UI. The engineering was solid.
The results were not. All-time, it was down about $537, roughly −0.20R per trade. The win rate was fine, somewhere between 47 and 55 percent depending on the window. The problem was payoff: the losers were bigger than the winners. That is a specific, diagnosable failure, and it’s where most people start tuning.
The trap I refused to walk into
Here is how a retail bot usually “gets profitable.” You take the same slice of history you’ve been losing on, and you tune. Tighter stop here, wider target there, flip the trail trigger. Eventually the equity curve points up and you feel like a genius.
You are not a genius. You have memorized one lucky window. The moment the market regime changes, that memory costs you real money. The previous version of this bot had been tuned exactly this way, its trail trigger flipped between two, one, and one-and-a-half times ATR on samples of maybe ten trades each. Pure noise, dressed up as decisions.
I didn’t want a bot that felt profitable. I wanted to know if mechanical price prediction on liquid markets has a durable edge or not. So I built the research engine to be hard to fool, including by me, and I gave it three rules I wasn’t allowed to break.
No look-ahead. The backtest could only ever know what the live bot knew. Entries were decided at bar close and filled at the next bar’s open. Stops resolved against the level as it stood entering each bar. No peeking at the future.
Out-of-sample, or it’s noise. Any improvement had to survive data it had never touched, and it had to hold across both halves of the test window. One good number over one period doesn’t count.
Pre-register the bar. I wrote down the pass/fail threshold before I looked at a single result. To count as a real edge, a strategy had to clear +0.10R of expectancy out-of-sample, on at least 200 trades, positive on held-out data, positive across a majority of folds. No moving the goalposts after the fact.
To check that the framework itself wasn’t leaking a phantom edge, I ran a deliberately edgeless baseline through it. It scored −0.039R, right at the cost of spread. Good. The machine wasn’t lying to me. Now I could trust whatever it said next.
Killing my best idea
First I attacked the exits, since that’s where the bleed looked like it lived. I tested 18 combinations of stop, target, and trail. The configuration already running live turned out to be the best of them. Tightening the stop made it worse. No exit tuning anywhere reached positive expectancy. The bleed wasn’t in the stops.
Then the entries. I ablated each gate in turn and found what looked like gold. Cutting one filter added +0.030R. Trading against the daily trend on pullbacks only added +0.049R, the single positive-expectancy setup in the whole search. For an afternoon, I thought I had it.
Then I split it in half by time. The result is the whole essay in one picture.
The only thing that held steady across both halves was that the live strategy lost in both. I deleted the idea I’d been excited about that morning, because the evidence told me to.
The honest search, and the honest answer
At that point I stopped tinkering with my own strategy and asked the bigger question: is there any mechanical edge here, or is the whole category empty?
I built a walk-forward framework over five years of hourly data, six pairs, 2021 through 2026, spanning several market regimes. Expanding train-and-test folds, plus a final held-out slice nobody got to tune against. Then I ran four standard hypotheses that had nothing to do with my original bot: session and time-of-day breakouts, low-volatility mean-reversion, ADX regime-matching, opening-range breakout. Plus a plain EMA-cross trend follower for good measure.
Every single one landed in the same place.
One lead did light up. An intermarket signal, oil leading the Canadian dollar, printed +0.234R in-sample. That’s a big number. So I ran the confirmation test I’d built for exactly this moment: if oil really drives the loonie, the effect should show up across the whole CAD complex, not just one pair. It didn’t. The purer CAD pairs came back negative. It was a multiple-testing mirage, the kind of false positive you get when you check enough combinations. The system caught it and killed it.
Crypto was the last hope, on the theory that a less efficient market might hide an edge. It didn’t help. Every hypothesis failed there too. The best one squeaked to +0.012R under idealized costs, then collapsed to −0.102R once I modeled a realistic $15 spread on Bitcoin. Crypto’s inefficiency is real, but the costs that come with it are worse, so the trade gets harder, not easier.
Nine-plus distinct approaches, tested end to end with no look-ahead. Zero cleared the bar.
Predicting direction on a handful of the most liquid instruments in the world, using indicators anyone can pull up for free, has no durable edge.
What this actually taught me
The lesson isn’t “trading is impossible.” Plenty of people make money in markets. The lesson is narrower and more useful than that.
Those markets are too efficient. Whatever pattern you think you see, thousands of better-capitalized people saw it first and arbitraged it away. The real edges in this business come from somewhere else entirely: speed and infrastructure (the HFT and market-making game), scale and diversification (trend-following funds spread across dozens of markets), or genuine structural arbitrage. None of that is chart-reading, and none of it is what a retail bot on MetaTrader is doing.
My bot did the one thing a rigorous system is supposed to do. It proved its own hypothesis false before I ever risked real money on it. It sits on a demo account today, and that’s not a failure, it’s the finding.
The part that transfers
Here’s what I keep coming back to. The bot was never the valuable thing I built. The valuable thing was the ability to direct AI to build a complete quantitative stack: the live execution engine, the broker abstraction, the AI review layer, and above all the research framework with the statistical discipline to tell me I was wrong.
Most retail systems skip that last part on purpose, because the truth is bad for sales. I built it first, and then I listened to it. If you’re going to trust a machine with a decision, that’s the machine you want: the one that will look you in the eye and say the trade isn’t there.
The repo is public, research engine and all. If you’re building something similar, I’d rather you find your negative result in a backtest than in your account balance.