A long-only trailing-line system that buys when price crosses above a volatility-based trailing line. The stop uses the value of a 10-bar average of an 11-bar linear regression of close, fixed at the signal bar.
Best run of 6. Nasdaq 100, 4 hours, spread 3, from run sweeps:2026-10-04-NAS100-4h-opt.tsv:108.
| Period | Up to 2026-10-04 |
| Instrument | Nasdaq 100, 4 hours |
| Spread | 3 points |
| 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-10-07 |
Every run
| Market | Timeframe | PF | Trades | Win % | Net | Max DD |
|---|---|---|---|---|---|---|
| Nasdaq 100Best run | 4 hours | n/a | 1,255 | 25.98 | 9,354 EUR | -2,491 |
| USD/JPY | Daily | n/a | 505 | 0.99 | 148,240 USD | -125,640 |
| Nikkei 225 | 4 hours | n/a | 919 | 30.03 | 14,869 USD | -8,440 |
| Silver | Daily | n/a | 451 | 23.28 | 13,581 USD | -9,227 |
| Dow Jones | Daily | n/a | 491 | 32.59 | 10,683 EUR | -7,076 |
| S&P 500 | 4 hours | n/a | 1,230 | 27.56 | 1,513 EUR | -838 |
Charts
The code
// ============================================================== // Trailing Line Crossover With Stop // ProRealAlgos Strategy Library | prorealalgos.com // Type: Trend // Direction: Long only // Timeframe tested: 4 hours // ============================================================== DEFPARAM CumulateOrders = false ONCE ts = 0 lrclose = LinearRegression[11](close) signal = Average[10](lrclose) nloss = 2.0 * TR(close) prevts = ts IF BarIndex = 0 THEN prevts = close ENDIF
28 more lines: the entry and exit rules.
Setup
Questions
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.
It was tested on 6 market and timeframe combinations. The best run by trade count was Nasdaq 100, 4 hours, with 1,255 trades.
The best run had a maximum drawdown of 2,491 EUR at the tested position size, against a net result of 9,354 EUR.
It only takes long trades.
Related
Copy trading on US indices is available to ProRealAlgos members as spots open.