Pathfinder suaviza el precio tres veces y opera cuando esa línea cruza niveles clave como el máximo o el mínimo del mes anterior, el máximo de la semana anterior o el máximo o el mínimo del día anterior. Los filtros de medias móviles (SMA de 50 y 250) deciden qué cruces cuentan. Las operaciones salen en un objetivo del 2% para los longs, del 1.75% para los shorts, un stop del 5%, o tras un número determinado de barras.
Mejor ejecución de 11. US Crude Oil, 2 min, spread 3, de la ejecución pf:2026-09-15-CRUDE-2m.tsv:1.
| Periodo | Hasta 2026-09-15 |
| Instrumento | US Crude Oil, 2 minutos |
| Spread | 3 puntos |
| Contratos | 1 |
| Capital inicial | 1,000,000 |
| Costes | Solo spread. No se incluyen comisiones ni financiación overnight. |
| Barras | Hasta 200,000 barras, menos cuando el instrumento tiene menos historial |
| Última prueba | 2026-09-16 |
| positionSize Contratos base por operación | 1 |
| firstSmoothPeriod Longitud de la media de Wilder para la línea de señal | 5 |
| secondSmoothPeriod Segunda longitud de suavizado de la línea de señal | 10 |
| thirdSmoothPeriod Tercera longitud de suavizado de la línea de señal | 3 |
| trendPeriod Longitud del filtro de tendencia SMA largo | 250 |
| filterPeriod Longitud del filtro SMA más corto | 50 |
| stopLossPct Stop de protección como porcentaje del precio de entrada | 5 |
| takeProfitLongPct Objetivo de beneficio para longs, porcentaje | 2 |
| takeProfitShortPct Objetivo de beneficio para shorts, porcentaje | 1.75 |
| maxBarsLongWinning Barras antes de cerrar un long ganador | 18 |
| maxBarsShortWinning Barras antes de cerrar un short ganador | 13 |
| maxBarsLongLosing Barras antes de cerrar un long perdedor | 30 |
| maxBarsShortLosing Barras antes de cerrar un short perdedor | 25 |
| shortSeasonStart Primer mes de la temporada de shorts (abril) | 4 |
| shortSeasonEnd Último mes de la temporada de shorts (septiembre) | 9 |
| longSizeMultiplier Factor de tamaño long fuera de la temporada de shorts | 2 |
| shortSizeMultiplier Factor de tamaño short dentro de la temporada de shorts | 2 |
Todas las ejecuciones
| Mercado | Marco temporal | PF | Operaciones | % de acierto | Neto | Max DD |
|---|---|---|---|---|---|---|
| Petróleo crudo de EE. UU.Mejor ejecución | 2 min | 1.24 | 430 | 55.58 | 1,453 EUR | -991 |
| Plata | 2 min | 1.21 | 338 | 64.50 | 7,847 USD | -11,318 |
| DAX 40 | 4 horas | 1.18 | 1,938 | 60.89 | 34,312 EUR | -13,097 |
| Oro | 4 horas | 1.16 | 1,852 | 58.10 | 3,921 EUR | -1,984 |
| Nikkei 225 | 4 horas | 1.14 | 1,521 | 57.99 | 49,301 USD | -26,547 |
| FTSE 100 | 4 horas | 1.12 | 1,879 | 57.53 | 11,758 EUR | -10,943 |
| Dow Jones | Diario | 1.10 | 2,409 | 55.62 | 30,189 EUR | -23,042 |
| Petróleo crudo de EE. UU. | 4 horas | 1.10 | 1,351 | 64.69 | 12,333 EUR | -10,842 |
| Oro | 1 hora | 1.10 | 2,665 | 57.04 | 1,970 EUR | -1,568 |
| Petróleo Brent | 4 horas | 1.09 | 1,037 | 65.67 | 9,437 EUR | -6,084 |
| USD/JPY | 1 hora | 1.06 | 2,954 | 59.88 | 528,140 JPY | -528,370 |
Gráficos
Las 10 mejores de 11 ejecuciones. La lista completa está en la tabla de arriba.
Por encima de 1.0 ganó dinero, por debajo de 1.0 perdió dinero.
El código
// ============================================================ // 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 líneas más: las reglas de entrada y salida.
Configuración
Con las 1,000,000 barras completas disponibles en US Crude Oil 2 minutos, el beneficio neto pasó a EUR -4,182.23 desde EUR 1,453.23 de la ejecución estándar, porque los datos más antiguos por sí solos perdieron EUR 5,635.46.
| Barras disponibles | 1,000,000 |
| Neto, ejecución estándar de 200,000 barras | 1,453.23 EUR |
| Neto, ejecución larga | -4,182.23 EUR |
| Neto solo en los datos más antiguos | -5,635.46 EUR |
Preguntas
Sí. Ten en cuenta que en el trading real el dimensionamiento estacional cambia con el mes del calendario, algo que el backtest no pudo reproducir.
La ejecución destacada fue US Crude Oil 2 minutos con 1,453.23 EUR en 430 operaciones. También fue rentable en DAX 40, Gold, Nikkei 225, FTSE 100, Dow Jones, Brent Crude, Silver y USD/JPY en las ejecuciones mostradas, con profit factors entre 1.06 y 1.21.
Con 1 contrato y un spread de 3 puntos, US Crude Oil 2 minutos tuvo un max drawdown de 991 EUR. Los longs pueden añadir posiciones, así que la exposición real puede superar 1 contrato.
Los niveles mensuales y semanales se cruzan solo unas pocas veces por gráfico en barras lentas, y las barras de 4 horas dieron la mayoría de las ejecuciones positivas. La ejecución de 2 minutos es la destacada porque tuvo el mejor profit factor, 1.24.
Relacionado
La comunidad de ProRealAlgos obtiene las reglas completas, el código completo y la cartera automatizada.