Un mercado estirado se marca cuando el precio cierra fuera de una Bollinger Band, el RSI(9) está en un extremo y la línea de precio del TDI está fuera de su banda. La operación se abre más tarde, cuando la línea de precio del TDI cruza su línea de señal de vuelta en la dirección de la reversión. Después, una línea de stop basada en el ATR gestiona la salida.
Mejor ejecución de 1. FTSE 100, Diario, spread 2, de la ejecución sweeps:2026-09-26-FTSE100-D-opt.tsv:4.
| Periodo | Hasta 2026-09-26 |
| Instrumento | FTSE 100, Diario |
| Spread | 2 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-26 |
| positionSize Contratos por operación | 1 |
| bandPeriod Longitud de las Bollinger Bands | 20 |
| rsiPeriod Longitud del RSI para la lectura extrema | 9 |
| overboughtLevel Nivel de RSI que arma un short | 62 |
| oversoldLevel Nivel de RSI que arma un long | 28 |
| stopAtrPeriod Longitud del ATR y de la media para las bandas de la línea de stop | 14 |
| stopAvgPeriod Media de máximos / mínimos que cambia el lado de la línea de stop | 10 |
| tdiRsiPeriod Longitud del RSI dentro del TDI | 13 |
| tdiBandPeriod Longitud de la banda del TDI | 34 |
| tdiBandWidth Anchura de la banda del TDI en desviaciones estándar | 1.6185 |
| priceLinePeriod Suavizado de la línea de precio del TDI | 2 |
| signalLinePeriod Suavizado de la línea de señal de operación del TDI | 7 |
Todas las ejecuciones
| Mercado | Marco temporal | PF | Operaciones | % de acierto | Neto | Max DD |
|---|---|---|---|---|---|---|
| FTSE 100Mejor ejecución | Diario | n/a | 239 | 38.49 | 3,658 EUR | -2,267 |
Gráficos
El código
// ============================================================ // Bollinger RSI TDI Reversal // ProRealAlgos Strategy Library | prorealalgos.com // Type: Mean reversion // Direction: Long & short // Timeframe tested: Daily // ============================================================ // --- Settings --- DEFPARAM CumulateOrders = false // --- Parameters --- positionSize = 1 // contracts per trade bandPeriod = 20 // Bollinger Bands length rsiPeriod = 9 // RSI length for the extreme reading overboughtLevel = 62 // RSI level that arms a short oversoldLevel = 28 // RSI level that arms a long stopAtrPeriod = 14 // ATR and average length for the stop line bands stopAvgPeriod = 10 // average of highs / lows that flips the stop line side tdiRsiPeriod = 13 // RSI length inside the TDI tdiBandPeriod = 34 // TDI band length tdiBandWidth = 1.6185 // TDI band width in standard deviations priceLinePeriod = 2 // TDI price line smoothing signalLinePeriod = 7 // TDI trade signal line smoothing // --- Indicators --- upperBand = BollingerUp[bandPeriod](close) lowerBand = BollingerDown[bandPeriod](close) rsiValue = RSI[rsiPeriod](close) // Stop line: an ATR band that only moves in the trade's favour atrValue = AverageTrueRange[stopAtrPeriod](close) stopBandHigh = Average[stopAtrPeriod](high + atrValue) stopBandLow = Average[stopAtrPeriod](low - atrValue) avgHigh = Average[stopAvgPeriod](high) avgLow = Average[stopAvgPeriod](low) IF close > avgHigh THEN stopSide = 1 ELSIF close < avgLow THEN stopSide = -1 ENDIF IF stopSide = -1 AND stopBandHigh > stopBandHigh[1] THEN stopBandHigh = stopBandHigh[1] ELSIF stopSide = 1 AND stopBandLow < stopBandLow[1] THEN stopBandLow = stopBandLow[1] ENDIF IF stopSide = 1 THEN stopLine = stopBandLow ELSE stopLine = stopBandHigh ENDIF // Traders Dynamic Index tdiRsi = RSI[tdiRsiPeriod](close) tdiMid = Average[tdiBandPeriod](tdiRsi) tdiOffset = tdiBandWidth * STD[tdiBandPeriod](tdiRsi) tdiUpper = tdiMid + tdiOffset tdiLower = tdiMid - tdiOffset priceLine = Average[priceLinePeriod](tdiRsi) signalLine = Average[signalLinePeriod](tdiRsi) // Two-step setup flags, kept between bars ONCE longSetup = 0 ONCE longTrigger = 0 ONCE shortSetup = 0 ONCE shortTrigger = 0
44 líneas más: las reglas de entrada y salida.
Configuración
Preguntas
Sí. Está programada para el trading automático de ProRealTime con 1 contrato por operación. Las horas del filtro de sesión original no formaban parte del código probado.
En FTSE 100 diario obtuvo EUR 3,658.00 en 239 operaciones, con un max drawdown de EUR 2,266.60. No se probaron otros instrumentos.
La peor caída de máximo a mínimo en las pruebas fue de EUR 2,266.60 con 1 contrato. El margen depende de tu bróker y no se trata aquí.
El setup necesita un cierre fuera de la banda más dos lecturas extremas del oscilador, lo que es raro. Las barras diarias mantienen esos extremos significativos y el número de operaciones manejable, 239 operaciones en la prueba.
Relacionado
La comunidad de ProRealAlgos obtiene las reglas completas, el código completo y la cartera automatizada.