Join today
Strategies / Breakout / Pathfinder

Pathfinder: Breakouts Through Monthly and Weekly Levels

Pathfinder smooths price three times and trades when that line crosses key levels such as the previous month high or low, the previous week high, or the previous day high or low. Moving average filters (50 and 250 SMA) decide which crosses count. Trades exit at a 2% target for longs, 1.75% for shorts, a 5% stop, or after a set number of bars.

BreakoutLong & shortIntradayUS Crude Oil2 min
1.24Profit factor
1,453Net profit EUR
55.58%Win rate
430Trades
-991Max drawdown
3.38Avg trade

Best run of 11. US Crude Oil, 2 min, spread 3, from run pf:2026-09-15-CRUDE-2m.tsv:1.

Entry rules, long

  1. Members only
  2. Or it crosses above the previous day's high while price is below the 250-period SMA
  3. Size is doubled outside the April to September short season
  4. Longs can add to an open long (pyramiding)

Entry rules, short

  1. Members only
  2. Or it crosses below the previous month's low while price is below the 50-period SMA
  3. Or it crosses below the previous day's low while price is above the 250-period SMA
  4. No short is already open
  5. Size is doubled inside the April to September short season

Exit rules

  1. Stop loss at 5% from entry
  2. Members only
  3. Close a winning long after 18 bars and a losing long after 30 bars
  4. Close a winning short after 13 bars and a losing short after 25 bars

Test conditions

PeriodUp to 2026-09-15
InstrumentUS Crude Oil, 2 minutes
Spread3 points
Contracts1
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-09-16

Parameters

positionSize
Base contracts per trade
1
firstSmoothPeriod
Wilder average length for the signal line
5
secondSmoothPeriod
Second smoothing length for the signal line
10
thirdSmoothPeriod
Third smoothing length for the signal line
3
trendPeriod
Long SMA trend filter length
250
filterPeriod
Shorter SMA filter length
50
stopLossPct
Protective stop as percent of entry price
5
takeProfitLongPct
Profit target for longs, percent
2
takeProfitShortPct
Profit target for shorts, percent
1.75
maxBarsLongWinning
Bars before a winning long is closed
18
maxBarsShortWinning
Bars before a winning short is closed
13
maxBarsLongLosing
Bars before a losing long is closed
30
maxBarsShortLosing
Bars before a losing short is closed
25
shortSeasonStart
First month of the short season (April)
4
shortSeasonEnd
Last month of the short season (September)
9
longSizeMultiplier
Long size factor outside the short season
2
shortSizeMultiplier
Short size factor inside the short season
2

Every run

Markets and timeframes tested

MarketTimeframePFTradesWin %NetMax DD
US Crude OilBest run2 min1.24 43055.581,453 EUR-991
Silver2 min1.21 33864.507,847 USD-11,318
DAX 404 hours1.18 1,93860.8934,312 EUR-13,097
Gold4 hours1.16 1,85258.103,921 EUR-1,984
Nikkei 2254 hours1.14 1,52157.9949,301 USD-26,547
FTSE 1004 hours1.12 1,87957.5311,758 EUR-10,943
Dow JonesDaily1.10 2,40955.6230,189 EUR-23,042
US Crude Oil4 hours1.10 1,35164.6912,333 EUR-10,842
Gold1 hour1.10 2,66557.041,970 EUR-1,568
Brent Crude4 hours1.09 1,03765.679,437 EUR-6,084
USD/JPY1 hour1.06 2,95459.88528,140 JPY-528,370

Charts

Results by run

Profit factor by run

Above 1.0 made money, below 1.0 lost money.

0.00.51.01.52.01.0 = break-evenUS Crude Oil · 2 min1.24Silver · 2 min1.21DAX 40 · 4 hours1.18Gold · 4 hours1.16Nikkei 225 · 4 hours1.14FTSE 100 · 4 hours1.12Dow Jones · Daily1.10US Crude Oil · 4 hours1.10Gold · 1 hour1.10Brent Crude · 4 hours1.09USD/JPY · 1 hour1.06

Net profit against max drawdown

Net profitMax drawdown
0-1.0M-500K500K1.0MUSD/JPY · 1 hourNikkei 225 · 4 hoursDAX 40 · 4 hoursDow Jones · DailyUS Crude Oil · 4 hoursFTSE 100 · 4 hoursBrent Crude · 4 hoursSilver · 2 minGold · 4 hoursGold · 1 hourUS Crude Oil · 2 min

Longer history

Re-run on up to 1,000,000 bars

With the full 1,000,000 bars available on US Crude Oil 2 minutes, net profit turned to EUR -4,182.23 from EUR 1,453.23 in the standard run, because the older data alone lost EUR 5,635.46.

US Crude Oil · 2 min

Bars available1,000,000
Net, standard 200,000-bar run1,453.23 EUR
Net, long run-4,182.23 EUR
Net on the older data alone-5,635.46 EUR

The code

ProBuilder, rewritten to house standard

Every file in the library uses the same header, the same section order and the same variable names. The numbers above were produced by the original version before the rewrite, and the rewrite has not yet been compiled in ProRealTime.

// ============================================================
// Pathfinder
// ProRealAlgos Strategy Library  |  prorealalgos.com
// Type: Breakout
// Direction: Long & short
// Timeframe tested: 2 minutes
// ============================================================

// --- Settings ---
DEFPARAM CumulateOrders = true
DEFPARAM PreloadBars = 10000

// --- Parameters ---
positionSize = 1              // base contracts per trade
firstSmoothPeriod = 5         // Wilder average of close
secondSmoothPeriod = 10       // time series average of the first line
thirdSmoothPeriod = 3         // time series average of the second line
trendPeriod = 250             // long SMA trend filter
filterPeriod = 50             // shorter SMA filter
stopLossPct = 5               // protective stop, percent of entry price
takeProfitLongPct = 2         // target for longs, percent
takeProfitShortPct = 1.75     // target for shorts, percent
maxBarsLongWinning = 18       // close a winning long after this many bars
maxBarsShortWinning = 13      // close a winning short after this many bars
maxBarsLongLosing = 30        // close a losing long after this many bars
maxBarsShortLosing = 25       // close a losing short after this many bars
shortSeasonStart = 4          // April, first month of the short season
shortSeasonEnd = 9            // September, last month of the short season
longSizeMultiplier = 2        // long size factor outside the short season
shortSizeMultiplier = 2       // short size factor inside the short season

// State, seeded so every value is defined on the first bar.
ONCE lastWeekBarIndex = 0
ONCE lastMonthBarIndex = 0
ONCE weeklyHigh = 0
ONCE monthlyHigh = 0
ONCE monthlyLow = 0
ONCE takeProfitPct = takeProfitLongPct

// --- Indicators ---
prevDayHigh = DHigh(1)
prevDayLow = DLow(1)

// Previous week's high, taken when a new week starts.
IF DayOfWeek < DayOfWeek[1] THEN
  weeklyHigh = Highest[max(1, BarIndex - lastWeekBarIndex)](prevDayHigh)
  lastWeekBarIndex = BarIndex
ENDIF

// Previous month's high and low, taken when a new month starts.
IF Month <> Month[1] THEN
  monthlyHigh = Highest[max(1, BarIndex - lastMonthBarIndex)](prevDayHigh)
  monthlyLow = Lowest[max(1, BarIndex - lastMonthBarIndex)](prevDayLow)
  lastMonthBarIndex = BarIndex
ENDIF

// Triple-smoothed signal line: Wilder, then two time series averages.
firstLine = WilderAverage[firstSmoothPeriod](close)
secondLine = TimeSeriesAverage[secondSmoothPeriod](firstLine)
signalLine = TimeSeriesAverage[thirdSmoothPeriod](secondLine)

trendMA = Average[trendPeriod](close)
filterMA = Average[filterPeriod](close)

// CurrentMonth is the calendar month the system runs in, not the bar's month.
shortSeason = CurrentMonth >= shortSeasonStart AND CurrentMonth <= shortSeasonEnd

positionProfit = (((close - PositionPrice) * PointValue) * CountOfPosition) / PipSize
barsInTrade = BarIndex - TradeIndex

40 more lines: the entry and exit rules.

Read this first

Known weaknesses

  • The longer history test failed: on 1,000,000 US Crude Oil bars it lost -4,182.23 EUR, with the older part at -5,635.46 EUR.
  • The stop (5%) is much wider than the targets (2% and 1.75%), and longs can pyramid, so losses can stack up.
  • The seasonal size uses the month the system runs in, not the bar month, so in a backtest the size is the same on every bar.
  • USD/JPY 1 hour had a 528,370 JPY drawdown against 528,140.09 JPY of profit.

Indicators used

Wilder AverageTime Series AverageSMA

How to load it

  1. Copy the code with the copy button above 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.

Questions

About this strategy

Can Pathfinder run in ProOrder?

Yes. Note that in live trading the seasonal sizing changes with the calendar month, which the backtest could not reproduce.

Where was it tested?

The headline run was US Crude Oil 2 minutes with 1,453.23 EUR over 430 trades. It was also profitable on DAX 40, Gold, Nikkei 225, FTSE 100, Dow Jones, Brent Crude, Silver and USD/JPY in the runs shown, with profit factors between 1.06 and 1.21.

What was the risk at 1 contract?

At 1 contract with a 3 point spread, US Crude Oil 2 minutes had a max drawdown of 991 EUR. Longs can add positions, so real exposure may exceed 1 contract.

Why test mainly on 4 hour charts?

Monthly and weekly levels are crossed only a few times per chart on slow bars, and 4 hour bars gave most of the positive runs. The 2 minute run is the headline because it had the best profit factor, 1.24.

Related

Strategies like this one

Bollinger Squeeze

Uses the same indicator.

14.30 PF · 86 trades

Vectorial Slope

Best run on the same market, US Crude Oil.

1.76 PF · 268 trades

RSI Stochastic MA Cross

A similar profit factor.

1.25 PF · 1,290 trades

Join the ProRealAlgos waitlist to follow how breakout ideas are stress tested.

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