Al inicio de cada día el sistema coloca un buy limit por debajo del cierre de la primera barra y un sell limit por encima, cada uno a 0.5 veces el rango de 12 barras de distancia. Toda posición abierta se cierra en la primera barra del día siguiente. Todavía no se le ha hecho backtest.
| positionSize Acciones por operación | 1 |
| entryRatio Distancia del limit como fracción del rango reciente; más alto significa menos operaciones | 0.5 |
| stopLossPct Stop de protección, porcentaje del precio de entrada | 1 |
| takeProfitPct Objetivo de beneficio, porcentaje del precio de entrada | 0.8 |
| rangePeriod Barras usadas para el rango reciente | 12 |
| fridayNumber Sin nuevas órdenes en este día de la semana | 5 |
El código
// ============================================================ // Yen End-of-Day Straddle // ProRealAlgos Strategy Library | prorealalgos.com // Type: Mean reversion // Direction: Long & short // Timeframe tested: Not yet tested // ============================================================ // --- Settings --- DEFPARAM CumulateOrders = false DEFPARAM PreloadBars = 1000 // --- Parameters --- // Defaults are the USD/JPY set. Other pairs from the published table: // AUD/JPY ratio 0.5, stop 0.8, target 1.2, period 12 // EUR/JPY ratio 0.6, stop 1, target 0.8, period 8 // GBP/JPY ratio 0.5, stop 0.6, target 1, period 8 positionSize = 1 // shares per trade entryRatio = 0.5 // limit distance as a fraction of the recent range; higher means fewer trades stopLossPct = 1 // protective stop, percent of entry price takeProfitPct = 0.8 // profit target, percent of entry price rangePeriod = 12 // bars used for the recent range fridayNumber = 5 // no new orders on this day of the week // --- Indicators --- newDay = Day <> Day[1]
19 líneas más: las reglas de entrada y salida.
Configuración
Preguntas
Está escrito para ProOrder con órdenes limitadas, un stop del 1% y un objetivo del 0.8%. Todavía no se ha comprobado en compilación ni se le ha hecho backtest.
Ninguna todavía. Los valores por defecto están fijados para un par del yen, pero no existen resultados para ningún mercado.
Usa un tamaño de 1 acción por operación. Todavía no hay cifra de drawdown, así que opérala en papel antes de comprometer dinero.
Relacionado
La comunidad de ProRealAlgos obtiene las reglas completas, el código completo y la cartera automatizada.