Join waitlist
Strategies / Trend / Trailing Line Crossover With Stop

Trailing Line Crossover With Stop

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.

TrendLong onlySwingNasdaq 1004 hours
n/aProfit factor
9,354Net profit EUR
25.98%Win rate
1,255Trades
-2,491Max drawdown
7.45Avg trade

Best run of 6. Nasdaq 100, 4 hours, spread 3, from run sweeps:2026-10-04-NAS100-4h-opt.tsv:108.

Entry rules, long

  1. The trailing line sits 2 times the true range below the close and ratchets upward while price stays above it.
  2. The stop level is the 10-bar average of an 11-bar linear regression of close, fixed at the signal bar.
  3. An entry is skipped unless the close is above that stop level.

Exit rules

  1. A stop-loss at the fixed stop level is active from the fill bar.

Test conditions

PeriodUp to 2026-10-04
InstrumentNasdaq 100, 4 hours
Spread3 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-07

Every run

Markets and timeframes tested

MarketTimeframePFTradesWin %NetMax DD
Nasdaq 100Best run4 hoursn/a 1,25525.989,354 EUR-2,491
USD/JPYDailyn/a 5050.99148,240 USD-125,640
Nikkei 2254 hoursn/a 91930.0314,869 USD-8,440
SilverDailyn/a 45123.2813,581 USD-9,227
Dow JonesDailyn/a 49132.5910,683 EUR-7,076
S&P 5004 hoursn/a 1,23027.561,513 EUR-838

Charts

Results by run

Net profitMax drawdown

The code

ProBuilder code, as tested

// ==============================================================
// 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

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

True RangeLinear RegressionSMA
Read this firstKnown weaknesses2 points
  • No profit factor is available, because only sweep results exist for this strategy.
  • Results include the spread only. Commissions and overnight financing are not included.

Questions

About this strategy

Can I run Trailing Line Crossover With Stop 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 6 market and timeframe combinations. The best run by trade count was Nasdaq 100, 4 hours, with 1,255 trades.

How large was the drawdown?

The best run had a maximum drawdown of 2,491 EUR at the tested position size, against a net result of 9,354 EUR.

Does it trade long, short or both?

It only takes long trades.

Related

Strategies like this one

Trend Surfer

Uses the same indicator.

1.04 PF · 10,813 trades

Volatility Spike Regression Long

Best run on the same market, Nasdaq 100.

1.22 PF · 1,850 trades

ADX Filtered EMA Cross

Also a trend strategy.

1.15 PF · 607 trades

Get the full rules, the complete code and the ProRealAlgos portfolio as a member.

Copy trading on US indices is available to ProRealAlgos members as spots open.

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