La Comisión concluyó que la medida no constituía una ayuda estatal.

El autor:¿ Qué pasa?, Fecha: 2023-11-01 16:20:45
Las etiquetas:

img

Resumen general

Esta estrategia está diseñada como un sistema de negociación de tendencia flexible basado en el indicador CCI. Puede generar señales de negociación basadas en cruces de línea cero CCI o cruces de banda superior / inferior personalizados. La estrategia permite establecer índices de stop loss y take profit fijos, negociar en plazos específicos, y más.

Estrategia lógica

  1. Los indicadores de mercado de los mercados de divisas y de divisas de divisas y de divisas de divisas y de divisas de divisas y de divisas de divisas y de divisas de divisas y de divisas de divisas y de divisas son los indicadores de mercado de divisas y de divisas.

  2. Establece bandas CCI superiores e inferiores personalizadas. El cruce CCI por encima de la banda superior es alcista y el cruce por debajo de la banda inferior es bajista. Los cruces de banda actúan como paradas.

  3. Opción para operar únicamente en plazos específicos y cerrar todas las posiciones fuera de esos plazos.

  4. Establezca un stop loss fijo y tome porcentajes de ganancias.

  5. Mensajes de alerta personalizables para señales de entrada y salida.

  6. Estrategia altamente personalizable con parámetros, bandas, paradas, etc. de CCI ajustables.

Análisis de ventajas

  1. El CCI es sensible a los cambios de precios, bueno para detectar inversiones de tendencia.

  2. Las bandas personalizadas se pueden ajustar para diferentes mercados.

  3. Apoyar el comercio en diferentes plazos con parámetros optimizados basados en las características.

  4. Las tasas de riesgo/recompensación fijas y las tasas de riesgo límite.

  5. Los parámetros totalmente personalizables optimizan la estrategia para diferentes productos y condiciones del mercado.

Análisis de riesgos

  1. El CCI es propenso a señales falsas, debe verificar las señales con indicadores de marcos de tiempo más largos.

  2. Los porcentajes fijos de stop/take no pueden adaptarse a las condiciones cambiantes del mercado.

  3. Las operaciones en plazos fijos corren el riesgo de perder oportunidades durante los períodos de intervalo.

  4. Las optimizaciones frecuentes de los parámetros pueden dar lugar a operaciones excesivas o faltantes.

  5. Hay que tener en cuenta factores macro, ya que la optimización por sí sola no es suficiente para eliminar los riesgos.

Direcciones de optimización

  1. Añadir indicadores de marcos de tiempo más largos para verificar las señales CCI.

  2. Incorporar paradas/salidas dinámicas como el ATR.

  3. Prueba los parámetros en diferentes plazos y encuentra períodos de alta eficiencia.

  4. Optimizar los parámetros y las bandas de CCI para los mercados cambiantes.

  5. Considere incorporar otros factores como la volatilidad y el volumen.

  6. Seleccionar los plazos adecuados para los productos objeto de comercio.

  7. Considere el aprendizaje automático para automatizar las optimizaciones de estrategias.

Resumen de las actividades

En general, este es un sistema de seguimiento de tendencias muy flexible y personalizable. Las principales ventajas son el uso de CCI para tendencias, bandas personalizadas para limitar el riesgo, paradas / tomas fijas y selección de marcos de tiempo. Es necesario vigilar señales CCI falsas y paradas inflexibles. Las mejoras futuras podrían provenir de la optimización de parámetros, filtrar señales, seleccionar marcos de tiempo eficientes e incorporar aprendizaje automático para adaptaciones automáticas a los cambios del mercado, con el fin de lograr rendimientos excedentes más consistentes.


/*backtest
start: 2023-10-01 00:00:00
end: 2023-10-31 00:00:00
period: 1h
basePeriod: 15m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/

// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © REV0LUTI0N

//@version=4

strategy(title="CCI Strategy", overlay=true, initial_capital = 10000, default_qty_value = 10000, default_qty_type = strategy.cash)


//CCI Code

length = input(20, minval=1, title="CCI Length")
src = input(close, title="Source")
ma = sma(src, length)
cci = (src - ma) / (0.015 * dev(src, length))


// Strategy Backtesting
startDate  = input(timestamp("2099-10-01T00:00:00"), type = input.time, title='Backtesting Start Date')
finishDate = input(timestamp("9999-12-31T00:00:00"), type = input.time, title='Backtesting End Date')

time_cond  = true


//Time Restriction Settings
startendtime = input("", title='Time Frame To Enter Trades')
enableclose = input(false, title='Enable Close Trade At End Of Time Frame')
timetobuy = true
timetoclose = true


//Strategy Settings

//Strategy Settings - Enable Check Boxes
enableentry = input(true, title="Enter First Trade ASAP")
enableconfirmation = input(false, title="Wait For Cross To Enter First Trade")
enablezero =input(true, title="Use CCI Simple Cross Line For Entries & Exits")
enablebands = input(false, title="Use Upper & Lower Bands For Entries & Exits")

//Strategy Settings - Band Sources
ccisource = input(0, title="CCI Simple Cross")
upperbandsource =input(100, title="CCI Enter Long Band")
upperbandexitsource =input(100, title="CCI Exit Long Band")
lowerbandsource =input(-100, title="CCI Enter Short Band")
lowerbandexitsource =input(-100, title="CCI Exit Short Band")

//Strategy Settings - Crosses
simplecrossup = crossover(cci, ccisource)
simplecrossdown = crossunder(cci, ccisource)
uppercrossup = crossover(cci, upperbandsource)
lowercrossdown = crossunder(cci, lowerbandsource)
uppercrossdown = crossunder(cci, upperbandexitsource)
lowercrossup = crossover(cci, lowerbandexitsource)
upperstop = crossunder(cci, upperbandsource)
lowerstop = crossover(cci, lowerbandsource)


// Stop Loss & Take Profit % Based
enablesl = input(false, title='Enable Stop Loss')
enabletp = input(false, title='Enable Take Profit')
stopTick = input(5.0, title='Stop Loss %', type=input.float, step=0.1) / 100
takeTick = input(10.0, title='Take Profit %', type=input.float, step=0.1) / 100

longStop = strategy.position_avg_price * (1 - stopTick)
shortStop = strategy.position_avg_price * (1 + stopTick)
shortTake = strategy.position_avg_price * (1 - takeTick)
longTake = strategy.position_avg_price * (1 + takeTick)

plot(strategy.position_size > 0 and enablesl ? longStop : na, style=plot.style_linebr, color=color.red, linewidth=1, title="Long Fixed SL")
plot(strategy.position_size < 0 and enablesl ? shortStop : na, style=plot.style_linebr, color=color.red, linewidth=1, title="Short Fixed SL")
plot(strategy.position_size > 0 and enabletp ? longTake : na, style=plot.style_linebr, color=color.green, linewidth=1, title="Long Take Profit")
plot(strategy.position_size < 0 and enabletp ? shortTake : na, style=plot.style_linebr, color=color.green, linewidth=1, title="Short Take Profit")


// Alert messages
message_enterlong  = input("", title="Long Entry message")
message_entershort = input("", title="Short Entry message")
message_closelong = input("", title="Close Long message")
message_closeshort = input("", title="Close Short message")
    

//Strategy Execution

//Strategy Execution - Simple Line Cross
if (cci > ccisource and enablezero and enableentry and time_cond and timetobuy)
    strategy.entry("Long", strategy.long, alert_message = message_enterlong)
if (cci < ccisource and enablezero and enableentry and time_cond and timetobuy)
    strategy.entry("Short", strategy.short, alert_message = message_entershort)

if (simplecrossup and enablezero and enableconfirmation and time_cond and timetobuy)
    strategy.entry("Long", strategy.long, alert_message = message_enterlong)
if (simplecrossdown and enablezero and enableconfirmation and time_cond and timetobuy)
    strategy.entry("Short", strategy.short, alert_message = message_entershort)

//Strategy Execution - Upper and Lower Band Entry
if (uppercrossup and enablebands and time_cond and timetobuy)
    strategy.entry("Long", strategy.long, alert_message = message_enterlong)
if (lowercrossdown and enablebands and time_cond and timetobuy)
    strategy.entry("Short", strategy.short, alert_message = message_entershort)

//Strategy Execution - Upper and Lower Band Exit
if strategy.position_size > 0 and uppercrossdown and enablebands and time_cond and timetobuy
    strategy.close_all(alert_message = message_closelong)
if strategy.position_size < 0 and lowercrossup and enablebands and time_cond and timetobuy
    strategy.close_all(alert_message = message_closeshort)

//Strategy Execution - Upper and Lower Band Stops
if strategy.position_size > 0 and upperstop and enablebands and time_cond and timetobuy
    strategy.close_all(alert_message = message_closelong)
if strategy.position_size < 0 and lowerstop and enablebands and time_cond and timetobuy
    strategy.close_all(alert_message = message_closeshort)

//Strategy Execution - Close Trade At End Of Time Frame    
if strategy.position_size > 0 and timetoclose and enableclose and time_cond
    strategy.close_all(alert_message = message_closelong)
if strategy.position_size < 0 and timetoclose and enableclose and time_cond
    strategy.close_all(alert_message = message_closeshort)

//Strategy Execution - Stop Loss and Take Profit
if strategy.position_size > 0 and enablesl and time_cond
    strategy.exit(id="Close Long", stop=longStop, limit=longTake, alert_message = message_closelong)
if strategy.position_size < 0 and enablesl and time_cond
    strategy.exit(id="Close Short", stop=shortStop, limit=shortTake, alert_message = message_closeshort)
    
if strategy.position_size > 0 and enabletp and time_cond
    strategy.exit(id="Close Long", stop=longStop, limit=longTake, alert_message = message_closelong)
if strategy.position_size < 0 and enabletp and time_cond
    strategy.exit(id="Close Short", stop=shortStop, limit=shortTake, alert_message = message_closeshort)



Más.