The linear regression channel looks like the perfect tool: a “fair” middle line is drawn through the latest candles, two boundaries are placed two standard deviations around it, and anything that leaves a boundary looks overbought or oversold. Sell at the upper boundary, buy at the lower one, and wait for the return. I wrote a robot with these rules and ran it on seven markets over 72 months. Here is what came out, where this idea breaks, and which robot is better to use instead.
- The classic is negative on 5 of 7 markets. 100-candle regression, ±2σ boundaries on D1 over 72 months: EURUSD +4.8%, GBPUSD +3.2%, and on USDJPY, USDCHF and bitcoin from −18% to −20%.
- The cause: leaving the boundary is more often the start of a trend than its end. The channel treats past movement as “normal”. When the market accelerates, price rides along the boundary, and the robot enters against it again and again.
- Optimization didn’t save it. The best set on USDJPY H4 made +38.3% over 72 months, but with a 28.9% drawdown. It never got back above the November 2023 balance high before the end of the test: almost three years under water.
- What works on the same USDJPY H4: the “Williams Fractals” robot, +203% over 72 months with a 7.3% drawdown and +47.3% in the forward test.
📊 Download the “Williams Fractals” robot for free, the one that does work

The strategy rules
The regression channel was brought to trading by Gilbert Raff, which is why this version is called the Raff Regression Channel. A straight line is fitted through the closes of the last N candles with the least squares method: the regression line, the “fair” price for that stretch. Boundaries are built around it. In the popular version, the one I tested, they sit two standard deviations of price away from the line. The rules:
- Channel: recalculated on every new candle from the last 100 closes: regression line and ±2σ boundaries.
- Buy when a candle closes below the lower boundary. Sell when it closes above the upper one. Entry at the open of the next candle.
- Exit when price returns to the regression line. Protective stop at 2 ATR(14) from the entry.
- Position size: based on a risk of 1% of the balance per trade.
The logic is the same as with Bollinger Bands and envelopes: price has moved far from its average, so it will come back. The difference is that here the average is not flat but sloped: the channel takes the direction of the move into account. The classic timeframe is D1.
What it looks like on the chart
Below are two real trades from the best set the optimizer found on USDJPY H4. Both come from the forward period, which the optimizer never saw. In this set the channel is built on 200 candles, the boundaries are the same ±2σ, the exit is at the opposite boundary or after 20 candles, and the stop is 1.5 ATR. The yellow line is the regression line, the blue ones are the channel boundaries, and the yellow circle marks the signal candle.

The trade that makes people love the channel. On June 23, 2025, the dollar/yen jumped and an H4 candle closed above the upper boundary. The robot sold at 147.610 with the stop at 148.285. The jump turned out to be an overshoot: price came back to the regression line, and after 20 candles the robot closed the trade on time: +$536. That is exactly how the system is meant to work: catch the overshoot and collect the return.

The trade that shows the weakness. On February 25, 2026, a candle again closed above the upper boundary: a sell signal. The robot sold at 156.694 with the stop at 157.573. But this was not an overshoot, it was the start of a rally: price moved along the upper boundary, the channel began to bend upward after it, and on March 2 the stop was hit: −$112. The chart shows the main point: in a trend, the boundary doesn’t stop price, it follows it.
Manually it looks like this: MetaTrader 5 has a “Standard Deviation Channel” object. Stretch it over the last 100 D1 candles (in the best set, 200 H4 candles) with a deviation of 2. A candle closes above the upper boundary: sell; below the lower one: buy; exit at the middle line. The channel has to be redrawn on every new candle; the robot does it on its own.
How I ran the test
MetaTrader 5 Strategy Tester, a demo account from FxPro with its quotes, spreads, commissions and swaps, $10,000 deposit, 1:500 leverage, “1 minute OHLC” mode, 72 months (10/2020–09/2026). Risk: 1% of the balance per trade.

| Instrument (D1) | Result | Profit factor | Max drawdown | Trades |
|---|---|---|---|---|
| EURUSD | +4.8% | 1.20 | 8.5% | 50 |
| GBPUSD | +3.2% | 1.14 | 5.7% | 52 |
| GOLD | −1.6% | 0.95 | 11.4% | 43 |
| WTI (oil) | −3.7% | 0.77 | 8.6% | 34 |
| USDCHF | −18.4% | 0.41 | 22.1% | 52 |
| USDJPY | −19.2% | 0.42 | 22.2% | 51 |
| BITCOIN | −19.9% | 0.53 | 21.9% | 86 |
The two “positives” on the euro and the pound are +4.8% and +3.2% in six years, less than 1% a year. On the markets with strong trends (dollar/yen, dollar/franc, bitcoin), about −20%. The reasons:
- The boundary is not a wall. The two standard deviations are calculated from past candles. When the market accelerates, the new volatility is larger than the old one, and price happily lives beyond the boundary for weeks. On USDJPY the classic won only one trade in four.
- The channel chases price. The regression line tilts after the move, but with a delay. While it “catches up”, the robot is already positioned against the trend.
- Swaps work against the position. Mean-reversion trades are held for days, and on USDJPY the sells pay swap every night. On D1 alone, swaps took $464 from the classic on USDJPY.
What if optimization saves it?
I gave the optimizer everything that could help: channel length from 40 to 200 candles, boundary width from 1.5 to 3σ, a slope filter (trade only with the channel slope or only in a range), three exit variants, stop, take profit and time exit. Parameters were chosen only on 10/2020–09/2024 and then checked on 10/2024–09/2026, data the optimizer never saw. I tested H4 on four markets: EURUSD, GBPUSD, USDJPY and GOLD.
On EURUSD, of 72 profitable sets in training, only 10 stayed positive in the forward test. On GBPUSD, 27 of 92, and on gold only 9 sets were profitable in training at all. The best result came on USDJPY H4: there 18 sets of 30 made money in the forward test. Here is the best of them:

| Best set (USDJPY H4) | Return | Profit factor | Max drawdown | Trades |
|---|---|---|---|---|
| Training, 10/2020–09/2024 | +14.0% | 1.09 | 25.5% | 205 |
| Forward, 10/2024–09/2026 | +23.3% | 1.55 | 12.2% | 76 |
| All 72 months, 1% risk | +38.3% | 1.19 | 28.9% | 281 |
| Longest stretch without a new high | almost 3 years (11/2023 to the end of the test) |
The forward test is positive, and on its own that doesn’t look bad. But look at the curve. By year: 2021, +15.8%; 2022, −8.0%; 2023, +24.3%; 2024, −19.8%; 2025, +5.0%; 2026 through September, +18.2%. A year of profit, a year of loss: that’s not an edge, it’s a seesaw. In March 2022, when the yen began its big fall, the robot took 14 losing trades in a row, about −$1,683. A 28.9% drawdown for +38% in six years: for every dollar earned, the account lost almost another dollar along the way. And one more detail: over 72 months swaps took $1,522 and commissions $484. That’s a third of all profit before costs.

The honest conclusion: even the best set gives about 6% a year with a drawdown of almost 30% and a three-year wait for a new high. There is no point keeping a robot like that on your account when the same USDJPY H4 has robots that passed the test far more convincingly.
What to use instead of the regression channel: robots that passed the test
The first two robots trade the same USDJPY H4, but not against the move, with it: they enter once the trend is already confirmed. The third is for those who like the mean-reversion idea itself: on EURUSD H4 it works if you trade only pullbacks in the direction of the trend.
| Robot | Market | 72 months, 1% risk | Max drawdown | Forward 10/2024–09/2026 |
|---|---|---|---|---|
| “Williams Fractals” | USDJPY H4 | +203% | 7.3% | +47.3% |
| Lambert’s CCI | USDJPY H4 | +111% | 10.7% | +22% |
| “Envelopes” | EURUSD H4 | +30% | 6.0% | +9.9% |
“Fractals” and CCI trade the same USDJPY H4, and their losing streaks can overlap. If you put both on one account, split the risk between them.
📊 Download the “Williams Fractals” robot for USDJPY H4
📊 Download the Lambert CCI robot for USDJPY H4
📊 Download the “Envelopes” robot for EURUSD H4
Where to run them and how to download them
The robots work in MetaTrader 5 with any broker that offers USDJPY and EURUSD. My test was done at FxPro. The other brokers in my ranking also work: RoboForex and Tickmill. Before putting a robot on your account, run it in your broker’s tester, and keep the platform on a VPS so it works without pauses.
The robots are free for clients of the brokers in my ranking:
- Open a MetaTrader 5 account with one of the brokers above (or use the one you already have).
- Go to the Telegram bot with the button of the robot you need and send your account number.
- After verification, the bot sends you the file: the robot, the parameters and the instructions.
The regression channel robot is also in the bot, for your own experiments in the tester (regression channel robot), but I don’t recommend putting it on a real account.
My conclusion
The linear regression channel describes the past well and predicts the future poorly. For it, price leaving the boundary means “too far”, but in the live market that is just as often the start of a new move. In its classic form on D1, over 72 months the channel lost about 20% on three trending markets and made almost nothing on the rest. Optimization found a set on USDJPY H4 with a positive forward test, but with a drawdown of almost 30% and three years without a new high. That’s not a robot, it’s a seesaw. Protect your deposit: on the same USDJPY H4, “Williams Fractals” made +203% over the same six years with a 7.3% drawdown. They wait for the trend to be confirmed and go with it, not against it.
I tested mean reversion before as well, with Connors’ RSI-2, Bollinger Bands and envelopes. The conclusion is the same every time: trading the return against the trend is expensive, while pullbacks with the trend do work.
Why 72 months?
The market changes fundamentally every 3–5 years: the participants and the volatility change, and trends give way to ranges. That’s why I don’t run 10–20 year tests: they blend different markets into a single average figure, and when the market changes, you have to change the strategy anyway. The regression channel shows this especially clearly: in a range it makes money, in a trend it gives it all back, and over six years of USDJPY these regimes switched several times. A robot that doesn’t notice the market changing is doomed to the seesaw.
That’s why I built my app “Take the Strategy”, in the browser or in Telegram. There you can test any idea on a history of up to 72 months, and every 2 weeks the app automatically runs tens of thousands of strategies and shows you the ones that work over the last 6, 12 and 36 months. It doesn’t promise profits: it helps you notice in time that the market has changed.
Backtest results do not guarantee future results. Everything I write is my personal experience and opinion, not investment advice.
Sources
- Gilbert Raff: the Raff Regression Channel; description in the StockCharts ChartSchool guide: the linear regression line and the parallel channel boundaries.
- MetaTrader 5 help: the “Standard Deviation Channel” graphical object, the regression line and boundaries at a given number of standard deviations.
- Own tests in MetaTrader 5 on the FxPro demo server, November 2026.
Where to trade
These are the brokers and exchanges I use that work with clients from Latin America. Always check that the service is available in your country, and start small.
Risk warning: CFDs, Forex and crypto derivatives carry a high risk of losing money due to leverage. This article is not investment advice.


