Join waitlist
Strategies / Breakout / Pivot Trendline Breakout (long and short)

Pivot Trendline Breakout (long and short)

The strategy draws a resistance line through recent pivot highs and a support line through recent pivot lows. It buys 1 contract when the close crosses above resistance, is above the 20 period Hull average and RSI(14) is below 70, and shorts the mirror image.

BreakoutLong & shortSwingUSD/JPYDaily
1.48Profit factor
70,950Net profit USD
38.74%Win rate
1,461Trades
-12,850Max drawdown
48.56Avg trade

Best run of 4. USD/JPY, Daily, spread 1, from run pf:2026-10-05-USDJPY-D.tsv:7.

Entry rules, long

  1. The close is above the 20 period Hull average.
  2. RSI(14) is below 70.
  3. Signals are evaluated only after bar 30, while no position is open.

Entry rules, short

  1. The close is below the 20 period Hull average.
  2. RSI(14) is above 30.
  3. Signals are evaluated only after bar 30, while no position is open.

Exit rules

  1. The short stop sits 1.5 times ATR(14) above the entry price and the target sits 2 times that distance below it.

Test conditions

PeriodUp to 2026-10-05
InstrumentUSD/JPY, Daily
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-05

Every run

Markets and timeframes tested

MarketTimeframePFTradesWin %NetMax DD
USD/JPYBest runDaily1.48 1,46138.7470,950 USD-12,850
Dow JonesDailyn/a 70433.9520,733 EUR-9,925
Brent CrudeDailyn/a 28440.8511,194 EUR-5,950
US Crude Oil4 hoursn/a 1,32233.818,975 EUR-4,866

Charts

Results by run

Net profitMax drawdown

The code

ProBuilder code, as tested

// ==============================================================
// Pivot Trendline Breakout (long and short)
// ProRealAlgos Strategy Library  |  prorealalgos.com
// Type: Breakout
// Direction: Long & short
// Timeframe tested: Daily
// ==============================================================

DEFPARAM CumulateOrders = false

ONCE phone = 0
ONCE phtwo = 0
ONCE phoneidx = 0
ONCE phtwoidx = 0
ONCE plone = 0
ONCE pltwo = 0
ONCE ploneidx = 0
ONCE pltwoidx = 0
ONCE nph = 0
ONCE npl = 0
ONCE res = 0
ONCE sup = 0

hma = WeightedAverage[4](2 * WeightedAverage[10](close) - WeightedAverage[20](close))
myRsi = RSI[14](close)
myAtr = AverageTrueRange[14](close)

41 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

Hull MARSIATR
Longer historyRe-run on up to 1,000,000 barsUSD/JPY · Daily · older data 0.00 USD

USD/JPY had no history beyond the standard run, so both runs used 12,000 bars.

USD/JPY · Daily

Bars available12,000
Net, standard 200,000-bar run70,950.00 USD
Net, long run70,950.00 USD
Net on the older data alone0.00 USD
Read this firstKnown weaknesses2 points
  • Results include the spread only. Commissions and overnight financing are not included.
  • The code is published as it was backtested and has not been compiled again since.

Questions

About this strategy

Can I run Pivot Trendline Breakout (long and short) 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 4 market and timeframe combinations. The best run was USD/JPY, Daily, with a profit factor of 1.48 over 1,461 trades.

How large was the drawdown?

The best run had a maximum drawdown of 12,850 USD at the tested position size, against a net result of 70,950 USD.

Does it trade long, short or both?

It trades both long and short.

Related

Strategies like this one

Trend Surfer

Uses the same indicator.

1.04 PF · 10,813 trades

EMA 8 21 RSI Filtered Bracket

Best run on the same market, USD/JPY.

1.09 PF · 6,194 trades

20 Day Breakout Long Short

Also a breakout strategy.

1.47 PF · 156 trades

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

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