Una vez que el precio se ha movido más de 45 pips desde su último toque de la EMA de 8, el sistema coloca una orden limitada de vuelta cerca de esa media. Compra los pullbacks después de swings al alza fuertes y vende los rebotes después de swings a la baja fuertes. Cada operación lleva un stop de 30 puntos y un objetivo de 25 puntos.
Mejor ejecución de 5. Gold, 3 min, spread 0.6, de la ejecución pf:2026-09-15-GOLD-3m.tsv:1.
| Periodo | Hasta 2026-09-15 |
| Instrumento | Gold, 3 minutos |
| Spread | 0.6 puntos |
| 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-15 |
| swingPeriod Longitud de la EMA desde la que se mide el swing | 8 |
| seedPeriod Barras usadas para inicializar el swing high / low en la primera barra | 8 |
| swingTargetPips Tamaño del swing en pips que activa una entrada | 45 |
| baseCapital Importe añadido al beneficio de la estrategia antes de dimensionar | 3000 |
| riskFraction Porción del capital usada en la fórmula de dimensionamiento | 0.02 |
| capitalPerContract Dinero por contrato en la fórmula de dimensionamiento | 30 |
| minPositionSize Contratos mínimos por operación | 1 |
| stopLossPoints Stop de protección en puntos | 30 |
| takeProfitPoints Objetivo de beneficio en puntos | 25 |
Todas las ejecuciones
| Mercado | Marco temporal | PF | Operaciones | % de acierto | Neto | Max DD |
|---|---|---|---|---|---|---|
| OroMejor ejecución | 3 min | 1.26 | 253 | 60.08 | 1,894 EUR | -596 |
| Oro | 2 min | 1.23 | 209 | 59.81 | 1,350 EUR | -708 |
| Oro | 5 min | 1.19 | 285 | 58.60 | 1,516 EUR | -774 |
| Oro | 1 hora | 1.13 | 389 | 58.35 | 1,644 EUR | -1,199 |
| Oro | 1 min | n/a | 63 | 63.49 | 620 EUR | -350 |
Gráficos
Por encima de 1.0 ganó dinero, por debajo de 1.0 perdió dinero.
El código
// ============================================================ // EMA Swing Limit Entry // ProRealAlgos Strategy Library | prorealalgos.com // Type: Momentum // Direction: Long & short // Timeframe tested: 3 minutes // ============================================================ // --- Settings --- DEFPARAM CumulateOrders = true DEFPARAM PreloadBars = 10000 // --- Parameters --- swingPeriod = 8 // EMA the swing is measured from seedPeriod = 8 // bars used to seed the swing high / low on the first bar swingTargetPips = 45 // swing size that arms an entry baseCapital = 3000 // added to strategy profit before sizing riskFraction = 0.02 // share of that capital put at risk capitalPerContract = 30 // money per contract in the sizing formula minPositionSize = 1 // never trade fewer contracts than this stopLossPoints = 30 // protective stop takeProfitPoints = 25 // profit target // --- Indicators --- ONCE swingHigh = Highest[seedPeriod](high) ONCE swingLow = Lowest[seedPeriod](low) swingMA = ExponentialAverage[swingPeriod](close) swingTarget = swingTargetPips * PipSize // Each touch of the EMA restarts the swing measurement. IF high > swingMA AND low < swingMA THEN touchBar = BarIndex touchPrice = swingMA swingHigh = swingMA swingLow = swingMA ENDIF IF low > swingMA THEN barsSinceTouch = max(1, BarIndex - touchBar) swingHigh = Highest[barsSinceTouch](high) swingLow = swingMA ENDIF IF high < swingMA THEN barsSinceTouch = max(1, BarIndex - touchBar) swingLow = Lowest[barsSinceTouch](low) swingHigh = swingMA ENDIF IF (swingHigh - touchPrice) > swingTarget AND swingHigh > swingMA THEN buySetup = 1 ENDIF IF (swingHigh - touchPrice) <= swingTarget THEN buySetup = 0 ENDIF IF (touchPrice - swingLow) > swingTarget AND swingLow < swingMA THEN sellSetup = -1 ENDIF IF (touchPrice - swingLow) <= swingTarget THEN sellSetup = 0 ENDIF // Limit orders sit one EMA slope beyond the EMA. slopeOffset = abs(round(swingMA - swingMA[1])) positionSize = max(minPositionSize, round(((StrategyProfit + baseCapital) * riskFraction) / capitalPerContract))
16 líneas más: las reglas de entrada y salida.
Configuración
Preguntas
Sí. Las entradas son órdenes limitadas y el stop y el objetivo están codificados, así que funciona sin supervisión una vez cargada.
Gold 3 minutos ganó 1,893.8 EUR en 253 operaciones. Los gráficos de 2 minutos, 5 minutos y 1 hora también fueron positivos, con profit factors entre 1.13 y 1.23.
El peor drawdown en Gold 3 minutos fue de 596.1 EUR. Como el tamaño crece con el beneficio, un drawdown al final de una ejecución puede ser mayor que al principio.
El swing de 45 pips y el objetivo de 25 puntos se adaptan a los movimientos intraday rápidos de Gold. El gráfico de 3 minutos tuvo el mejor profit factor de los marcos temporales probados.
Relacionado
La comunidad de ProRealAlgos obtiene las reglas completas, el código completo y la cartera automatizada.