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.
Best run of 11. US Crude Oil, 2 min, spread 3, from run pf:2026-09-15-CRUDE-2m.tsv:1.
| Period | Up to 2026-09-15 |
| Instrument | US Crude Oil, 2 minutes |
| Spread | 3 points |
| Contracts | 1 |
| 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-09-16 |
| 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
| Market | Timeframe | PF | Trades | Win % | Net | Max DD |
|---|---|---|---|---|---|---|
| US Crude OilBest run | 2 min | 1.24 | 430 | 55.58 | 1,453 EUR | -991 |
| Silver | 2 min | 1.21 | 338 | 64.50 | 7,847 USD | -11,318 |
| DAX 40 | 4 hours | 1.18 | 1,938 | 60.89 | 34,312 EUR | -13,097 |
| Gold | 4 hours | 1.16 | 1,852 | 58.10 | 3,921 EUR | -1,984 |
| Nikkei 225 | 4 hours | 1.14 | 1,521 | 57.99 | 49,301 USD | -26,547 |
| FTSE 100 | 4 hours | 1.12 | 1,879 | 57.53 | 11,758 EUR | -10,943 |
| Dow Jones | Daily | 1.10 | 2,409 | 55.62 | 30,189 EUR | -23,042 |
| US Crude Oil | 4 hours | 1.10 | 1,351 | 64.69 | 12,333 EUR | -10,842 |
| Gold | 1 hour | 1.10 | 2,665 | 57.04 | 1,970 EUR | -1,568 |
| Brent Crude | 4 hours | 1.09 | 1,037 | 65.67 | 9,437 EUR | -6,084 |
| USD/JPY | 1 hour | 1.06 | 2,954 | 59.88 | 528,140 JPY | -528,370 |
Charts
Above 1.0 made money, below 1.0 lost money.
Longer history
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.
| Bars available | 1,000,000 |
| Net, standard 200,000-bar run | 1,453.23 EUR |
| Net, long run | -4,182.23 EUR |
| Net on the older data alone | -5,635.46 EUR |
The code
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
Questions
Yes. Note that in live trading the seasonal sizing changes with the calendar month, which the backtest could not reproduce.
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.
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.
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
The ProRealAlgos community gets the full rules, the complete code and the automated portfolio.