Join waitlist
Strategies / Momentum / MACD Linear Regression Band Long

MACD Linear Regression Band Long

Buys when MACD crosses above its signal line or the close crosses above a lower regression band. Sells when MACD crosses below its signal line or the close crosses below an upper band.

MomentumLong onlySwingUSD/JPY1 hour
n/aProfit factor
331,130Net profit USD
36.65%Win rate
5,291Trades
-305,370Max drawdown
62.58Avg trade

Best run of 17. USD/JPY, 1 hour, spread 1, from run sweeps:2026-10-11-USDJPY-1h-opt.tsv:6.

Entry rules, long

  1. The lower band is the 2646 bar linear regression of close minus one standard deviation over 2646 bars.

Exit rules

  1. The upper band is the 2646 bar linear regression of close plus one standard deviation.

Test conditions

PeriodUp to 2026-10-11
InstrumentUSD/JPY, 1 hour
Spread1 points
Starting capital1,000,000
CostsSpread only. Commissions and overnight financing are not included.
BarsUp to 200,000 bars, fewer where the instrument has less history
Last tested2026-10-11

Every run

Markets and timeframes tested

MarketTimeframePFTradesWin %NetMax DD
USD/JPYBest run1 hourn/a 5,29136.65331,130 USD-305,370
USD/JPY4 hoursn/a 1,26739.78569,960 USD-240,860
Nikkei 2254 hoursn/a 90338.5428,572 USD-9,172
SilverDailyn/a 40734.4028,129 USD-24,488
Nikkei 225Dailyn/a 35840.5018,989 USD-9,235
Dow JonesDailyn/a 48544.9518,244 EUR-6,472
Nasdaq 1004 hoursn/a 1,17738.2311,948 EUR-4,953
DAX 404 hoursn/a 1,11739.3011,734 EUR-3,258
DAX 40Dailyn/a 53641.0410,239 EUR-4,530
DAX 401 hourn/a 4,20237.399,253 EUR-4,557
Nasdaq 100Dailyn/a 36641.538,666 EUR-5,131
Brent Crude4 hoursn/a 59640.445,864 EUR-4,802
Gold4 hoursn/a 1,13438.622,520 EUR-744
S&P 500Dailyn/a 51440.862,164 EUR-1,016
GoldDailyn/a 45435.902,081 EUR-1,305
S&P 5004 hoursn/a 1,17938.421,588 EUR-1,033
Gold1 hourn/a 4,55334.941,541 EUR-1,254

Charts

Results by run

Top 10 of 17 runs. The full list is in the table above.

Net profitMax drawdown

The code

ProBuilder code, as tested

// ==============================================================
// MACD Linear Regression Band Long
// ProRealAlgos Strategy Library  |  prorealalgos.com
// Type: Momentum
// Direction: Long only
// Timeframe tested: 1 hour
// ==============================================================

DEFPARAM CumulateOrders = false

myMacd = MACDline[12,26,9](close)
signal = ExponentialAverage[9](myMacd)
lin = LinearRegression[2646](close)
sd = STD[2646](close)
upper = lin + sd
lower = lin - sd

13 more lines: the entry and exit rules.

Setup

How to load it

  1. Copy the code with the copy button on the code block.
  2. In ProRealTime, open a chart of the instrument and timeframe you want to test, then open ProOrder > New trading system and choose "Create with programming".
  3. Paste the code, give the system a name and save it.
  4. Click "Backtest", set your own spread and position size, and run it before you consider trading it live.

Indicators used

MACDEMALinear RegressionStandard Deviation
Read this firstKnown weaknesses3 points
  • No profit factor is available, because only sweep results exist for this strategy.
  • The maximum drawdown of 305,370 USD is large next to the net profit of 331,130 USD.
  • The code sets no stop loss, so a losing trade stays open until an exit signal arrives.

Questions

About this strategy

Can I run MACD Linear Regression Band Long in ProOrder?

Yes. The code is ProBuilder and runs as an automated ProOrder system. Backtest it on your own account with your own spread and position size before trading it live.

Which markets was it tested on?

It was tested on 17 market and timeframe combinations. The best run by trade count was USD/JPY, 1 hour, with 5,291 trades.

How large was the drawdown?

The best run had a maximum drawdown of 305,370 USD at the tested position size, against a net result of 331,130 USD.

Does it trade long, short or both?

It only takes long trades.

Related

Strategies like this one

Slow MACD Slope

Uses the same indicator.

6.80 PF · 7,305 trades

Trend Surfer

Best run on the same market, USD/JPY.

1.04 PF · 10,813 trades

ATR Momentum

Also a momentum strategy.

n/a PF · 15,021 trades

See how ProRealAlgos combines strategies like this into one automated portfolio.

The ProRealAlgos community gets the full rules, the complete code and the automated portfolio.

Past backtest results do not guarantee future results. This is not financial advice. Curated and maintained by ProRealAlgos. ProRealTime™ is a trademark of ProRealTime SAS. prorealalgos.comStatsDocs