When the 28-bar linear regression slope was positive on the previous bar, it places a buy limit at the 12-period SMA of lows. A negative slope sets a short limit at the SMA of highs. Once the slope flips, the position exits with a limit at the opposite average.
Best run of 6. EUR/USD, 10 min, spread 1, from run sweeps:2026-09-17-EURUSD-10m-opt.tsv:3.
| Period | Up to 2026-09-17 |
| Instrument | EUR/USD, 10 minutes |
| Spread | 1 points |
| Contracts | 1 |
| Starting capital | 1,000,000 |
| Costs | Spread only. Commissions and overnight financing are not included. |
| Bars | Up to 200,000 bars, fewer where the instrument has less history |
| Last tested | 2026-09-17 |
| positionSize Shares per trade | 1 |
| bandPeriod SMA length of highs and lows | 12 |
| slopePeriod Regression slope length | 28 |
Every run
| Market | Timeframe | PF | Trades | Win % | Net | Max DD |
|---|---|---|---|---|---|---|
| EUR/USDBest run | 10 min | n/a | 7,224 | 46.86 | 93,957 USD | -51,230 |
| EUR/USD | 2 min | n/a | 7,056 | 38.39 | 402,648 USD | -89,492 |
| EUR/USD | 3 min | n/a | 7,072 | 40.75 | 281,741 USD | -66,463 |
| EUR/USD | 5 min | n/a | 7,136 | 43.53 | 120,196 USD | -81,556 |
| Brent Crude | Daily | n/a | 163 | 50.92 | 30,683 EUR | -6,617 |
| US Crude Oil | Daily | n/a | 374 | 46.52 | 12,008 EUR | -10,126 |
Charts
The code
// ============================================================ // X-Bars Regression Slope // ProRealAlgos Strategy Library | prorealalgos.com // Type: Trend // Direction: Long & short // Timeframe tested: 10 minutes // ============================================================ // --- Settings --- DEFPARAM CumulateOrders = false // --- Parameters --- positionSize = 1 // shares per trade bandPeriod = 12 // SMA length of the highs and of the lows slopePeriod = 28 // regression slope length on TotalPrice // --- Indicators --- upperBand = Average[bandPeriod](high) lowerBand = Average[bandPeriod](low) regressionSlope = LinearRegressionSlope[slopePeriod](TotalPrice)
24 more lines: the entry and exit rules.
Setup
Questions
Yes, ProOrder supports limit orders re-placed each bar. The rewritten code was not compile-checked, so backtest it first.
EUR/USD on several intraday charts plus Brent Crude and US Crude Oil daily. All 5 listed runs were positive, with EUR/USD 2 minutes making USD 402,648 in a sweep.
The EUR/USD 10 minute best run had a max drawdown of USD 51,230 at position size 1.
It gave the best recorded run. The shorter EUR/USD charts made more but with drawdowns up to USD 89,492.
Related
The ProRealAlgos community gets the full rules, the complete code and the automated portfolio.