Join waitlist
Strategies / Trend / Zero Lag Trend Flip Cross

Zero Lag Trend Flip Cross

Buys when the trailing stop direction flips up as the average price crosses above its zero-lag linear regression line, and sells short on the mirror setup. Longs exit when the average price crosses below that line, and shorts exit when it crosses above.

TrendLong & shortSwingUSD/JPY1 hour
n/aProfit factor
142,210Net profit USD
38.81%Win rate
1,113Trades
-94,500Max drawdown
128Avg trade

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

Entry rules, long

  1. The trailing direction flips up, meaning the average price rises above the prior short trailing stop.
  2. The average price is the mean of open, high, low and close.

Entry rules, short

  1. The trailing direction flips down, meaning the average price falls below the prior long trailing stop.
  2. The average price is the mean of open, high, low and close.

Exit rules

  1. A short closes when the average price crosses above the zero-lag line.
  2. An opposite entry on the same bar as an exit is deferred to the next bar.
  3. Trailing stops are set 2 times the 1-bar average true range from the average price.

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 1,11338.81142,210 USD-94,500
Brent Crude4 hoursn/a 22443.753,726 EUR-1,676
Nasdaq 1004 hoursn/a 45636.183,428 EUR-3,315
FTSE 100Dailyn/a 16040.622,198 EUR-1,408
GBP/USD4 hoursn/a 48143.042,091 USD-1,404

Charts

Results by run

Net profitMax drawdown

The code

ProBuilder code, as tested

// ==============================================================
// Zero Lag Trend Flip Cross
// ProRealAlgos Strategy Library  |  prorealalgos.com
// Type: Trend
// Direction: Long & short
// Timeframe tested: 1 hour
// ==============================================================

DEFPARAM CumulateOrders = false

ONCE longstop = 0
ONCE shortstop = 0
ONCE dir = 1
ONCE tradeopen = 0
ONCE cache = 0

ha = (open + high + low + close) / 4
myAtr = 2 * AverageTrueRange[1](close)

lsprev = longstop
ssprev = shortstop

102 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

ATRLinear Regression
Read this firstKnown weaknesses2 points
  • No profit factor is available, because only sweep results exist for this strategy.
  • The maximum drawdown of 94,500 USD is large next to the net profit of 142,210 USD.

Questions

About this strategy

Can I run Zero Lag Trend Flip Cross 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 5 market and timeframe combinations. The best run by trade count was USD/JPY, 1 hour, with 1,113 trades.

How large was the drawdown?

The best run had a maximum drawdown of 94,500 USD at the tested position size, against a net result of 142,210 USD.

Does it trade long, short or both?

It trades both long and short.

Related

Strategies like this one

KDJ J Line Momentum Long

Uses the same indicator.

4.17 PF · 6,135 trades

Trend Surfer

Best run on the same market, USD/JPY.

1.04 PF · 10,813 trades

ADX Filtered EMA Cross

Also a trend strategy.

1.15 PF · 607 trades

Want strategies that are already part of a live portfolio? Join the ProRealAlgos waitlist.

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