Estrategia de negociación de inversión de tendencia de múltiples indicadores

El autor:¿ Qué pasa?, Fecha: 2024-01-23 15:33:59
Las etiquetas:

img

Resumen general

Esta es una estrategia que combina múltiples indicadores para identificar puntos de inversión de tendencia en los precios. La idea básica es que un solo indicador a menudo no puede identificar perfectamente los giros en las tendencias. Por lo tanto, seleccionamos múltiples indicadores con funciones similares y los combinamos, de modo que cuando múltiples indicadores dan señales de compra / venta simultáneamente, podemos confirmar la alta probabilidad de inversiones de tendencia y tomar decisiones comerciales.

Estrategia lógica

La estrategia selecciona 5 indicadores diferentes para la combinación. Estos 5 indicadores tienen la capacidad de juzgar las tendencias de precios. Son:

  1. Indicador de tendencia de coral: utiliza una combinación de promedios móviles de suavización exponencial de orden triple o superior para determinar las tendencias de precios
  2. Canal SSL: Combina las medias móviles para determinar canales y tendencias de precios
  3. Heikin Ashi RSI: combina el indicador RSI con promedios intradiarios para determinar las tendencias
  4. MACD DEMA: Combina las medias móviles exponenciales dobles y MACD para determinar las tendencias
  5. WaveTrend Oscillator: Determina las tendencias según los canales de precios

La lógica de negociación de la estrategia es que de los 5 indicadores anteriores, se puede seleccionar uno o más para la combinación.

Por ejemplo, si seleccionamos 2 indicadores: Coral Trend y SSL Channel. Solo iremos largo cuando ambos den señales de compra al mismo tiempo; y solo iremos corto cuando ambos den señales de venta al mismo tiempo.

A través de dicha verificación de múltiples indicadores, se puede mejorar en gran medida la fiabilidad de las señales de negociación y evitar que los indicadores individuales induzcan a error.

Ventajas de la estrategia

  1. El uso de una combinación de múltiples indicadores puede identificar situaciones de reversión de tendencia con alta probabilidad y mejorar la tasa de ganancia comercial
  2. Cada indicador utiliza diferentes métodos de cálculo para hacer que las señales sean más completas y precisas
  3. Combinación flexible mediante la selección arbitraria de 1 a 5 indicadores
  4. Se proporcionan configuraciones detalladas de parámetros para cada indicador para su optimización en diferentes mercados
  5. Parámetros de ventana de retroalimentación proporcionados para ajustar la sensibilidad en la identificación de puntos largos/cortos

Riesgos y soluciones

  1. Riesgo de engaño de los indicadores individuales

    • Solución: Verificación mediante una combinación de múltiples indicadores
  2. La configuración incorrecta de los parámetros puede causar demasiada sensibilidad o opacidad

    • Solución: Prueba y optimización repetidas de parámetros basados en diferentes plazos y productos
  3. Cierto retraso entre los indicadores

    • Solución: Establezca las ventanas de tiempo de retroceso apropiadas

Direcciones para la optimización de la estrategia

  1. Probar más tipos de indicadores de evaluación de tendencias y ampliar el conjunto de indicadores para enriquecer las combinaciones
  2. Aumentar los algoritmos de aprendizaje automático para identificar automáticamente las combinaciones óptimas de indicadores
  3. Añadir módulo de optimización adaptativa de parámetros para ajustes de parámetros dinámicos
  4. Combinar indicadores de sentimiento, fundamentales, etc. para identificar las inversiones de tendencia
  5. Desarrollar modelos cuantitativos de gestión de riesgos para controlar los riesgos comerciales

Conclusión

La estrategia ha logrado en general una estrategia comercial de inversión de tendencia relativamente confiable. Su idea de usar verificación de múltiples indicadores tiene una gran versatilidad y una excelente extensibilidad. Con nuevas optimizaciones utilizando tecnologías como aprendizaje automático y optimización de parámetros dinámicos, su rendimiento puede mejorarse aún más y vale la pena una investigación y aplicación en profundidad.


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

//@version=5
//@author=iori86
//Any trade decisions you make are entirely your own responsibility//

strategy('GT 5.1 Strategy', 'GT 5.1 Strategy •', true, default_qty_type=strategy.cash)
string GROUP_6="STRATEGY OPTIONS"
dec1 = input(true,"HARSI", group=GROUP_6)
harsi_back = input.int(6, 'Lookback HARSI', group=GROUP_6, minval=1, maxval=32)
dec2 = input(true,"SSL", group=GROUP_6)
ssl_back = input.int(1, 'Lookback SSL', group=GROUP_6, minval=0, maxval=4)
dec3 = input(true,"CORAL", group=GROUP_6)
coral_back = input.int(4, 'Lookback CORAL', group=GROUP_6, minval=1, maxval=10)
dec4 = input(false,"MACD DEMA", group=GROUP_6)
macd_back =input.int(0, 'Lookback MACD DEMA', group=GROUP_6, minval=0, maxval=10)
dec5 = input(false,"WAVE TREND", group=GROUP_6)
wave_back=input.int(0, 'Lookback WAVE', group=GROUP_6, minval=0, maxval=10)

//================================================================HARSI============================================================================//

string GROUP_1 = 'Config » HARSI'
i_lenHARSI = input.int(14, 'Length', group=GROUP_1, minval=1)
i_smoothing = input.int(7, 'Open Smoothing', group=GROUP_1, minval=1, maxval=100)
f_zrsi(_source, _length) => ta.rsi(_source, _length) - 50
f_zstoch(_source, _length, _smooth, _scale) =>
    float _zstoch = ta.stoch(_source, _source, _source, _length) - 50
    float _smoothed = ta.sma(_zstoch, _smooth)
    float _scaled = (_smoothed / 100 )* _scale
f_rsi(_source, _length, _mode) =>
    float _zrsi = f_zrsi(_source, _length)
    var float _smoothed = na
    _smoothed := na(_smoothed[1]) ? _zrsi : (_smoothed[1] + _zrsi) / 2
    _mode ? _smoothed : _zrsi
f_rsiHeikinAshi(_length) =>
    float _closeRSI = f_zrsi(close, _length)
    float _openRSI = nz(_closeRSI[1], _closeRSI)
    float _highRSI_raw = f_zrsi(high, _length)
    float _lowRSI_raw = f_zrsi(low, _length)
    float _highRSI = math.max(_highRSI_raw, _lowRSI_raw)
    float _lowRSI = math.min(_highRSI_raw, _lowRSI_raw)
    float _close = (_openRSI + _highRSI + _lowRSI + _closeRSI) / 4
    var float _open = na
    _open := na(_open[i_smoothing]) ? (_openRSI + _closeRSI) / 2 : ((_open[1] * i_smoothing) + _close[1]) / (i_smoothing + 1)
    float _high = math.max(_highRSI, math.max(_open, _close))
    float _low = math.min(_lowRSI, math.min(_open, _close))
    [_open, _high, _low, _close]
[O, H, L, C] = f_rsiHeikinAshi(i_lenHARSI)

//=======================================================================SSL=======================================================================//

string GROUP_2 = 'Config » SSL Channel'
int len = input.int(10, 'Period', group=GROUP_2)
float smaHigh = ta.sma(high, len)
float smaLow = ta.sma(low, len)
float Hlv = na
Hlv := close > smaHigh ? 1 : close < smaLow ? -1 : Hlv[1]
float sslDown = Hlv < 0 ? smaHigh : smaLow
float sslUp = Hlv < 0 ? smaLow : smaHigh
plot(sslDown, linewidth=2, color=color.new(color.red, 0))
plot(sslUp, linewidth=2, color=color.new(color.lime, 0))

//=======================================================================CORAL=======================================================================//

string GROUP_3 = 'Config » Coral Trend Candles'
src = close
sm = input.float(9, 'Smoothing Period', group=GROUP_3, minval=1)
cd = input.float(0.4, 'Constant D', group=GROUP_3, minval=0.1)
float di = (sm) / 2.0 + 1.0
float c1 = 2 / (di + 1.0)
float c2 = 1 - c1
float c3 = 3.0 * (cd * cd + cd * cd * cd)
float c4 = -3.0 * (2.0 * cd * cd + cd + cd * cd * cd)
float c5 = 3.0 * cd + 1.0 + cd * cd * cd + 3.0 * cd * cd
var float i1 = na
var float i2 = na
var float i3 = na
var float i4 = na
var float i5 = na
var float i6 = na
i1 := c1 * src + c2 * nz(i1[1])
i2 := c1 * i1 + c2 * nz(i2[1])
i3 := c1 * i2 + c2 * nz(i3[1])
i4 := c1 * i3 + c2 * nz(i4[1])
i5 := c1 * i4 + c2 * nz(i5[1])
i6 := c1 * i5 + c2 * nz(i6[1])
var float bfr = na
bfr := -cd * cd * cd * i6 + c3 * i5 + c4 * i4 + c5 * i3
color bfrC = bfr > nz(bfr[1]) ? color.green : bfr < nz(bfr[1]) ? color.red : color.blue
plot(bfr, title='Trend', linewidth=3, style=plot.style_circles, color=bfrC)

//=======================================================================MACD DEMA=======================================================================//
string GROUP_4 = 'Config » MACD DEMA'
sma = input(12,title='DEMA Short', group=GROUP_4)
lma = input(26,title='DEMA Long', group=GROUP_4)
tsp = input(9,title='Signal', group=GROUP_4)
//dolignes = input(true,title="Lines", group=GROUP_4)

MMEslowa = ta.ema(close,lma)
MMEslowb = ta.ema(MMEslowa,lma)
DEMAslow = ((2 * MMEslowa) - MMEslowb )
MMEfasta = ta.ema(close,sma)
MMEfastb = ta.ema(MMEfasta,sma)
DEMAfast = ((2 * MMEfasta) - MMEfastb)
LigneMACDZeroLag = (DEMAfast - DEMAslow)
MMEsignala = ta.ema(LigneMACDZeroLag, tsp)
MMEsignalb = ta.ema(MMEsignala, tsp)
Lignesignal = ((2 * MMEsignala) - MMEsignalb )
MACDZeroLag = (LigneMACDZeroLag - Lignesignal)
swap1 = MACDZeroLag>0?color.green:color.red

//plot(MACDZeroLag,'Histo',color=swap1,histbase=0)
//p1 = plot(dolignes?LigneMACDZeroLag:na,"LigneMACD",color.blue)
//p2 = plot(dolignes?Lignesignal:na,"Signal",color.red)
//fill(p1, p2, color.blue)
hline(0)

//=======================================================================WAVE TREND=======================================================================//
string GROUP_5 = 'Config » WAVE TREND'

n1 = input(10, "Channel Length", group=GROUP_5)
n2 = input(21, "Average Length", group=GROUP_5)
//obLevel1 = input(60, "Over Bought Level 1", group=GROUP_5)
//obLevel2 = input(53, "Over Bought Level 2", group=GROUP_5)
//osLevel1 = input(-60, "Over Sold Level 1", group=GROUP_5)
//osLevel2 = input(-53, "Over Sold Level 2", group=GROUP_5)
ap = hlc3 
esa = ta.ema(ap, n1)
d = ta.ema(math.abs(ap - esa), n1)
ci = (ap - esa) / (0.015 * d)
tci = ta.ema(ci, n2)
wt1 = tci
wt2 = ta.sma(wt1,4)
//plot(0,"a" ,color.gray)
//plot(obLevel1,"a", color.red)
//plot(osLevel1,"a", color.green)
//plot(obLevel2,"a", color.red)
//plot(osLevel2,"a", color.green)
//plot(wt1,"a", color.green)
//plot(wt2,"a", color.red)
//plot(wt1-wt2,"a",color.blue, 1)

//=======================================================================CONDITIONS=======================================================================//
bool checker_1   = false   // HARSI BUY
bool checker_11  = false   // HARSI lookback BUY
bool checker_2   = false   // HARSI SELL
bool checker_21  = false   // HARSI lookback SELL
bool checker_3   = false   // SSL AL
bool checker_31  = false   // SSL lookback 0 dan büyükse al
bool checker_4   = false   // SSL SAT
bool checker_41  = false   // SSL lookback 0 dan büyükse sat
bool checker_5   = false   // CORAL AL
bool checker_51  = false   // CORAL lookback 1 den büyükse al
bool checker_6   = false   // CORAL SAT
bool checker_61  = false   // CORAL lookback 1 den büyükse sat
bool checker_7   = false   // MACD AL
bool checker_71  = false   // MACD lookback 0 dan büyükse al
bool checker_8   = false   // MACD SAT
bool checker_81  = false   // MACD lookback 0 dan büyükse sat
bool checker_9   = false   // WAVE AL
bool checker_91  = false   // WAVE lookback 0 dan büyükse al
bool checker_10  = false   // WAVE SAT
bool checker_101 = false   // WAVE lookback 0 dan büyükse sat


//=======================================================================HARSI=======================================================================//
if harsi_back==1
    if ( C > O and C[1] < O[1] and C > C[1])
        checker_1 := true
//HARSI SELL                
    if (C < O and C[1] > O[1] )
        checker_2 := true
// HARSI BUY
if harsi_back>1
    int say_1=0
    while harsi_back>say_1 and checker_11 == false
        if ( C[say_1] > O[say_1] and C[say_1+1] < O[say_1+1] and C[say_1] > C[say_1+1])
            checker_11 := true
        say_1:=say_1+1
    int say_2=0   
    while harsi_back>say_2 and checker_21 == false        
        if (C[say_2] < O[say_2] and C[say_2+1] > O[say_2+1])
            checker_21 := true
        say_2:=say_2+1
//=======================================================================SSL=======================================================================//
if ssl_back==0
    if (ta.crossover(sslUp, sslDown))
        checker_3 := true
    if (ta.crossover(sslDown, sslUp))
        checker_4 := true
if ssl_back>0
    int say_3=0
    while ssl_back>=say_3 and checker_31==false
        if (sslUp[say_3]>sslDown[say_3] and sslUp[say_3+1]<sslDown[say_3+1] )
            checker_31 := true
        say_3:=say_3+1
    int say_4=0
    while ssl_back>=say_4 and checker_41==false
        
        if (sslUp[say_4]<sslDown[say_4] and sslUp[say_4+1]>sslDown[say_4+1])
            checker_41 := true
        say_4:=say_4+1    
//======================================================================CORAL=======================================================================//
if coral_back==1
    if(bfrC == color.green and bfrC[1] == color.red)
        checker_5 := true
    if(bfrC == color.red and bfrC[1] == color.green)
        checker_6 := true
if coral_back>1
    int say_5=0
    while coral_back>say_5 and checker_51 == false
        if(bfrC[say_5] == color.green and bfrC[say_5+1] == color.red)
            checker_51 := true
        say_5 := say_5+1
    int say_6=0
    while coral_back>say_6 and checker_61 == false
        if(bfrC[say_6] == color.red and bfrC[say_6+1] == color.green)
            checker_61 := true
        say_6 := say_6+1
            

//=======================================================================MACD=======================================================================//
if macd_back==0 
    if ta.crossover(LigneMACDZeroLag,Lignesignal)
        checker_7 := true
    if ta.crossover(Lignesignal,LigneMACDZeroLag) 
        checker_8 := true
        
        
if macd_back>0
    int say_7=0
    while macd_back>=say_7 and checker_71==false
        if ta.crossover(LigneMACDZeroLag[say_7],Lignesignal[say_7])
            checker_71 := true
        say_7:=say_7+1
    int say_8=0
    while macd_back>=say_8 and checker_81==false
        if ta.crossover(Lignesignal[say_8],LigneMACDZeroLag[say_8])
            checker_81 := true
        say_8:=say_8+1   
//=======================================================================WAVE TREND=======================================================================//
if wave_back ==0
    if ta.crossover(wt1,wt2)
        checker_9  := true
    if ta.crossover(wt2,wt1)
        checker_10 :=true
if wave_back>0
    int say_9 =0
    while wave_back>=say_9 and checker_91==false
        if (ta.crossover(wt1[say_9],wt2[say_9]))
            checker_91 := true
        say_9:=say_9+1
    int say_10=0
    while wave_back>=say_10 and checker_101==false
        if (ta.crossover(wt2[say_10],wt1[say_10]))
            checker_101 := true
        say_10:=say_10+1   
//=======================================================================BUY=======================================================================//
var buy  = false
var sell = true
//=======================================================================TEK SEÇENEK=======================================================================//
if buy == false and sell==true
//dec1
    if dec1 == true and dec2==false and dec3== false and dec4==false and dec5==false
        if checker_1 or checker_11
            label.new(bar_index, low-ta.tr, color=color.green,style= label.style_label_up, size=size.small, text="HARSI")
            strategy.entry("long", strategy.long)
            sell:= false
            buy:=true
//dec2
    if dec2 == true and dec1==false and dec3== false and dec4==false and dec5==false
        if checker_3 or checker_31
            label.new(bar_index, low-ta.tr, color=color.green,style= label.style_label_up,textcolor= color.white, size=size.small, text="SSL")
            strategy.entry("long", strategy.long)
            sell:= false
            buy:=true   
//dec3
    if dec3 == true and dec2==false and dec1== false and dec4==false and dec5==false
        if checker_5 or checker_51
            label.new(bar_index, low-ta.tr, color=color.green,style= label.style_label_up,textcolor= color.white, size=size.small, text="CORAL")
            strategy.entry("long", strategy.long)
            sell:= false
            buy:=true  
//dec4    
    if dec4 == true and dec2==false and dec3== false and dec1==false and dec5==false
        if checker_7 or checker_71
            label.new(bar_index, low-ta.tr, color=color.green,style= label.style_label_up, size=size.small, text="MACD")
            strategy.entry("long", strategy.long)
            sell:= false
            buy:=true      
//dec5    
    if dec5 == true and dec1==false and dec2== false and dec3==false and dec4==false
        if checker_9 or checker_91
            label.new(bar_index, low-ta.tr, color=color.green,style= label.style_label_up, size=size.small, text="WAVE")
            strategy.entry("long", strategy.long)
            sell:= false
            buy:=true   
//=======================================================================2 SEÇENEK=======================================================================// 
//dec1-dec2
    if dec1 == true and dec2==true and dec3== false and dec4== false and dec5== false
        if (checker_1== true or checker_11==true) and (checker_3 == true or checker_31 == true)
            label.new(bar_index, low-ta.tr, color=color.green,style= label.style_label_up, size=size.small, text="HARSI\n SSL")
            strategy.entry("long", strategy.long)
            sell:= false
            buy:=true
//dec1 dec3
    if dec1 == true and dec2==false and dec3== true and dec4== false and dec5== false
        if (checker_1 == true or checker_11==true) and (checker_5 == true or checker_51 == true)
            label.new(bar_index, low-ta.tr, color=color.green,style= label.style_label_up, size=size.small, text="HARSI\n CORAL")
            strategy.entry("long", strategy.long)
            sell:= false
            buy:=true
//dec1 dec4
    if dec1 == true and dec2==false and dec3== false and dec4== true and dec5== false
        if (checker_1 == true or checker_11==true) and (checker_7 == true or checker_71 == true)
            label.new(bar_index, low-ta.tr, color=color.green,style= label.style_label_up, size=size.small, text="HARSI\n MACD")
            strategy.entry("long", strategy.long)
            sell:= false
            buy:=true
//dec1 dec5
    if dec1 == true and dec2==false and dec3== false and dec4== false and dec5== true
        if (checker_1 == true or checker_11==true) and (checker_9 == true or checker_91 == true)
            label.new(bar_index, low-ta.tr, color=color.green,style= label.style_label_up, size=size.small, text="HARSI\n WAVE")
            strategy.entry("long", strategy.long)
            sell:= false
            buy:=true
//dec2 dec3
    if dec1 == false and dec2==true and dec3== true and dec4== false and dec5== false
        if (checker_3 == true or checker_31==true) and (checker_5 == true or checker_51 == true)
            label.new(bar_index, low-ta.tr, color=color.green,style= label.style_label_up, size=size.small, text="SSL\n CORAL")
            strategy.entry("long", strategy.long)
            sell:= false
            buy:=true
//dec2 dec4
    if dec1 == false and dec2==true and dec3== false and dec4== true and dec5== false
        if (checker_3 == true or checker_31==true) and (checker_7 == true or checker_71 == true)
            label.new(bar_index, low-ta.tr, color=color.green,style= label.style_label_up, size=size.small, text="SSL\n MACD")
            strategy.entry("long", strategy.long)
            sell:= false
            buy:=true
//dec2 dec5
    if dec1 == false and dec2==true and dec3== false and dec4== false and dec5== true
        if (checker_3 == true or checker_31==true) and (checker_9 == true or checker_91 == true)
            label.new(bar_index, low-ta.tr, color=color.green,style= label.style_label_up, size=size.small, text="SSL\n WAVE")
            strategy.entry("long", strategy.long)
            sell:= false
            buy:=true
//dec3 dec4
    if dec1 == false and dec2==false and dec3== true and dec4== true and dec5== false
        if (checker_5 == true or checker_51==true) and (checker_7 == true or checker_71 == true)
            label.new(bar_index, low-ta.tr, color=color.green,style= label.style_label_up, size=size.small, text="CORAL\n MACD")
            strategy.entry("long", strategy.long)
            sell:= false
            buy:=true               
//dec3 dec5
    if dec1 == false and dec2==false and dec3== true and dec4== false and dec5== true
        if (checker_5 == true or checker_51==true) and (checker_9 == true or checker_91 == true)
            label.new(bar_index, low-ta.tr, color=color.green,style= label.style_label_up, size=size.small, text="CORAL\n WAVE")
            strategy.entry("long", strategy.long)
            sell:= false
            buy:=true            
//dec4 dec5
    if dec1 == false and dec2==false and dec3== false and dec4== true and dec5== true
        if (checker_7 == true or checker_71==true) and (checker_9 == true or checker_91 == true)
            label.new(bar_index, low-ta.tr, color=color.green,style= label.style_label_up, size=size.small, text="MACD\n WAVE")
            strategy.entry("long", strategy.long)
            sell:= false
            buy:=true               
//=======================================================================3 SEÇENEK=======================================================================//
// dec 1 dec2 dec3
    if dec1 == true and dec2==true and dec3 == true and dec4 ==false and dec5== false
        if (checker_1 == true or checker_11==true) and (checker_3 == true or checker_31 == true) and (checker_5 == true or checker_51 == true)
            label.new(bar_index, low-ta.tr, color=color.green,style= label.style_label_up, size=size.small, text="HARSI\n SSL\n\n CORAL")
            strategy.entry("long", strategy.long)
            sell:= false
            buy:=true
// dec1 dec2 dec4
    if dec1 == true and dec2==true and dec3 == false and dec4 ==true and dec5== false
        if (checker_1 == true or checker_11==true) and (checker_3 == true or checker_31 == true) and (checker_7 == true or checker_71 == true)
            label.new(bar_index, low-ta.tr, color=color.green,style= label.style_label_up, size=size.small, text="HARSI\n SSL\n\n MACD ")
            strategy.entry("long", strategy.long)
            sell:= false
            buy:=true
// dec1 dec2 dec5
    if dec1 == true and dec2==true and dec3 == false and dec4 ==false and dec5== true
        if (checker_1 == true or checker_11==true) and (checker_3 == true or checker_31 == true) and (checker_9 == true or checker_91 == true)
            label.new(bar_index, low-ta.tr, color=color.green,style= label.style_label_up, size=size.small, text="HARSI\n SSL\n\n WAVE ")
            strategy.entry("long", strategy.long)
            sell:= false
            buy:=true
// dec1 dec3 dec4
    if dec1 == true and dec2==false and dec3 == true and dec4 ==true and dec5== false
        if (checker_1 == true or checker_11==true) and (checker_5 == true or checker_51 == true) and (checker_7 == true or checker_71 == true)
            label.new(bar_index, low-ta.tr, color=color.green,style= label.style_label_up, size=size.small, text="HARSI\n CORAL\n\n MACD ")
            strategy.entry("long", strategy.long)
            sell:= false
            buy:=true
// dec1 dec3 dec5
    if dec1 == true and dec2==false and dec3 == true and dec4 ==false and dec5== true
        if (checker_1 == true or checker_11==true) and (checker_5 == true or checker_51 == true) and (checker_9 == true or checker_91 == true)
            label.new(bar_index, low-ta.tr, color=color.green,style= label.style_label_up, size=size.small, text="HARSI\n CORAL\n\n WAVE ")
            strategy.entry("long", strategy.long)
            sell:= false
            buy:=true
// dec1 dec4 dec5
    if dec1 == true and dec2==false and dec3 == false and dec4 ==true and dec5== true
        if (checker_1 == true or checker_11==true) and (checker_7 == true or checker_71 == true) and (checker_9 == true or checker_91 == true)
            label.new(bar_index, low-ta.tr, color=color.green,style= label.style_label_up, size=size.small, text="HARSI\n MACD\n\n WAVE ")
            strategy.entry("long", strategy.long)
            sell:= false
            buy:=true
// dec2 dec3 dec4
    if dec1 == false and dec2==true and dec3 == true and dec4==true and dec5== false
        if (checker_3 == true or checker_31==true) and (checker_5 == true or checker_51 == true) and (checker_7 == true or checker_71 == true) 
            label.new(bar_index, low-ta.tr, color=color.green,style= label.style_label_up, size=size.small, text="SSL\n CORAL\n\n MACD")
            strategy.entry("long", strategy.long)
            sell:= false
            buy:=true
// dec2 dec3 dec5
    if dec1 == false and dec2==true and dec3== true and dec4== false and dec5== true
        if (checker_3 == true or checker_31==true) and (checker_5 == true or checker_51 == true) and (checker_9 == true or checker_91==true)
            label.new(bar_index, low-ta.tr, color=color.green,style= label.style_label_up, size=size.small, text="SSL\n CORAL\n\n  WAVE")
            strategy.entry("long", strategy.long)
            sell:= false
            buy:=true
// dec2 dec4 dec5
    if dec1 == false and dec2==true and dec3== false and dec4== true and dec5== true
        if (checker_3 == true or checker_31==true) and (checker_7 == true or checker_71 == true) and (checker_9 == true or checker_91==true)
            label.new(bar_index, low-ta.tr, color=color.green,style= label.style_label_up, size=size.small, text="SSL\n MACD\n\n WAVE")
            strategy.entry("long", strategy.long)
            sell:= false
            buy:=true            
// dec3 dec4 dec5
    if dec1 == false and dec2==false and dec3 == true and dec4 ==true and dec5== true
        if (checker_5 == true or checker_51==true) and (checker_7 == true or checker_71 == true) and (checker_9 == true or checker_91 == true)
            label.new(bar_index, low-ta.tr, color=color.green,style= label.style_label_up, size=size.small, text="CORAL\n MACD\n\n WAVE")
            strategy.entry("long", strategy.long)
            sell:= false
            buy:=true
//=======================================================================4 SEÇENEK=======================================================================//
//dec1 dec2 dec3 dec4
    if dec1 == true and dec2==true and dec3 == true and dec4==true and dec5== false
        if (checker_1 == true or checker_11==true) and (checker_3 == true or checker_31 == true) and (checker_5 == true or checker_51 == true) and (checker_7 == true or checker_71 ==true)
            label.new(bar_index, low-ta.tr, color=color.green,style= label.style_label_up, size=size.small, text="HARSI\n CORAL\n\n CORAL\n\n\n MACD")
            strategy.entry("long", strategy.long)
            sell:= false
            buy:=true        
//dec1 dec3 dec4 dec5
    if dec1 == true and dec2==false and dec3 == true and dec4==true and dec5== true
        if (checker_1 == true or checker_11==true) and (checker_5 == true or checker_51 == true) and (checker_7 == true or checker_71 == true) and (checker_9 == true or checker_91 ==true)
            label.new(bar_index, low-ta.tr, color=color.green,style= label.style_label_up, size=size.small, text="HARSI\n CORAL\n\n MACD\n\n\n WAVE")
            strategy.entry("long", strategy.long)
            sell:= false
            buy:=true 
//dec1 dec2 dec4 dec5
    if dec1 == true and dec2==true and dec3 == false and dec4==true and dec5== true
        if (checker_1 == true or checker_11==true) and (checker_3 == true or checker_31 == true) and (checker_7 == true or checker_71 == true) and (checker_9 == true or checker_91 ==true)
            label.new(bar_index, low-ta.tr, color=color.green,style= label.style_label_up, size=size.small, text="HARSI\n SSL\n\n MACD\n\n\n WAVE")
            strategy.entry("long", strategy.long)
            sell:= false
            buy:=true 
//dec1 dec2 dec3 dec5
    if dec1 == true and dec2==true and dec3 == true and dec4==false and dec5== true
        if (checker_1 == true or checker_11==true) and (checker_3 == true or checker_31 == true) and (checker_5 == true or checker_51 == true) and (checker_9 == true or checker_91 ==true)
            label.new(bar_index, low-ta.tr, color=color.green,style= label.style_label_up, size=size.small, text="HARSI\n SSL\n\n CORAL\n\n\n WAVE")
            strategy.entry("long", strategy.long)
            sell:= false
            buy:=true 
//dec2 dec3 dec4 dec5
    if dec1 == false and dec2==true and dec3 == true and dec4==true and dec5== true 
        if (checker_3 == true or checker_31 == true) and (checker_5 == true or checker_51 == true) and (checker_7 == true or checker_71 ==true) and (checker_9 == true or checker_91==true)
            label.new(bar_index, low-ta.tr, color=color.green,style= label.style_label_up, size=size.small, text="SSL\n CORAL\n\n MACD\n\n\n WAVE")
            strategy.entry("long", strategy.long)
            sell:= false
            buy:=true 
//=======================================================================5 SEÇENEK=======================================================================//
//dec1 dec2 dec3 dec4 dec5
    if dec1 == true and dec2==true and dec3 == true and dec4==true and dec5== true 
        if (checker_1 == true or checker_11) and (checker_3 == true or checker_31 == true) and (checker_5 == true or checker_51 == true) and (checker_7 == true or checker_71 ==true) and (checker_9 == true or checker_91==true) 
            label.new(bar_index, low-ta.tr, color=color.green,style= label.style_label_up, size=size.small, text="SUPER BUY")
            strategy.entry("long", strategy.long)
            sell:= false
            buy:=true 
               
//=======================================================================SELL=======================================================================//
//=======================================================================TEK SEÇENEK=======================================================================//
if buy == true and sell==false
//dec1
    if dec1 == true and dec2==false and dec3== false and dec4==false and dec5==false
        if checker_2 or checker_21
            label.new(bar_index, high+ta.tr, color=color.red,style= label.style_label_down, size=size.small, text="HARSI")
            strategy.entry("short", strategy.short)
            sell:= true
            buy:=false
//dec2
    if dec2 == true and dec1==false and dec3== false and dec4==false and dec5==false
        if checker_4 or checker_41
            label.new(bar_index, high+ta.tr, color=color.red,style= label.style_label_down, size=size.small, text="SSL")
            strategy.entry("short", strategy.short)
            sell:= true
            buy:=false   
//dec3
    if dec3 == true and dec2==false and dec1== false and dec4==false and dec5==false
        if checker_6 or checker_61
            label.new(bar_index, high+ta.tr, color=color.red,style= label.style_label_down, size=size.small, text="CORAL")
            strategy.entry("short", strategy.short)
            sell:= true
            buy:=false 
//dec4    
    if dec4 == true and dec2==false and dec3== false and dec1==false and dec5==false
        if checker_8 or checker_81
            label.new(bar_index, high+ta.tr, color=color.red,style= label.style_label_down, size=size.small, text="MACD")
            strategy.entry("short", strategy.short)
            sell:= true
            buy:=false     
//dec5    
    if dec5 == true and dec1==false and dec2== false and dec3==false and dec4==false
        if checker_10 or checker_101
            label.new(bar_index, high+ta.tr, color=color.red,style= label.style_label_down, size=size.small, text="WAVE")
            strategy.entry("short", strategy.short)
            sell:= true
            buy:=false   
//=======================================================================2 SEÇENEK=======================================================================//
//dec1-dec2
    if dec1 == true and dec2==true and dec3== false and dec4== false and dec5== false
        if (checker_2==true or checker_21==true) and (checker_4 or checker_41 == true)
            label.new(bar_index, high+ta.tr, color=color.red,style= label.style_label_down, size=size.small, text="HARSI\n SSL")
            strategy.entry("short", strategy.short)
            sell:= true
            buy:=false 
//dec1 dec3
    if dec1 == true and dec2==false and dec3== true and dec4== false and dec5== false
        if (checker_2 == true or checker_21==true) and (checker_6 == true or checker_61 == true)
            label.new(bar_index, high+ta.tr, color=color.red,style= label.style_label_down, size=size.small, text="HARSI\n CORAL")
            strategy.entry("short", strategy.short)
            sell:= true
            buy:=false 
//dec1 dec4
    if dec1 == true and dec2==false and dec3== false and dec4== true and dec5== false
        if (checker_2 == true or checker_21==true) and (checker_8 == true or checker_81 == true)
            label.new(bar_index, high+ta.tr, color=color.red,style= label.style_label_down, size=size.small, text="HARSI\n MACD")
            strategy.entry("short", strategy.short)
            sell:= true
            buy:=false 
//dec1 dec5
    if dec1 == true and dec2==false and dec3== false and dec4== false and dec5== true
        if (checker_2 == true or checker_21==true) and (checker_10 == true or checker_101 == true)
            label.new(bar_index, high+ta.tr, color=color.red,style= label.style_label_down, size=size.small, text="HARSI\n WAVE")
            strategy.entry("short", strategy.short)
            sell:= true
            buy:=false 
//dec2 dec3
    if dec1 == false and dec2==true and dec3== true and dec4== false and dec5== false
        if (checker_4 == true or checker_41==true) and (checker_6 == true or checker_61 == true)
            label.new(bar_index, high+ta.tr, color=color.red,style= label.style_label_down, size=size.small, text="SSL\n CORAL")
            strategy.entry("short", strategy.short)
            sell:= true
            buy:=false 
//dec2 dec4
    if dec1 == false and dec2==true and dec3== false and dec4== true and dec5== false
        if (checker_4 == true or checker_41==true) and (checker_8 == true or checker_81 == true)
            label.new(bar_index, high+ta.tr, color=color.red,style= label.style_label_down, size=size.small, text="SSL\n MACD")
            strategy.entry("short", strategy.short)
            sell:= true
            buy:=false 
//dec2 dec5
    if dec1 == false and dec2==true and dec3== false and dec4== false and dec5== true
        if (checker_4 == true or checker_41==true) and (checker_10 == true or checker_101 == true)
            label.new(bar_index, high+ta.tr, color=color.red,style= label.style_label_down, size=size.small, text="SSL\n WAVE")
            strategy.entry("short", strategy.short)
            sell:= true
            buy:=false 
 //dec3 dec4
    if dec1 == false and dec2==false and dec3== true and dec4== true and dec5== false
        if (checker_6 == true or checker_61==true) and (checker_8 == true or checker_81 == true)
            label.new(bar_index, high+ta.tr, color=color.red,style= label.style_label_down, size=size.small, text="CORAL\n MACD")
            strategy.entry("short", strategy.short)
            sell:= true
            buy:=false   
//dec3 dec5
    if dec1 == false and dec2==false and dec3== true and dec4== false and dec5== true
        if (checker_6 == true or checker_61==true) and (checker_10 == true or checker_101 == true)
            label.new(bar_index, high+ta.tr, color=color.red,style= label.style_label_down, size=size.small, text="CORAL\n WAVE")
            strategy.entry("short", strategy.short)
            sell:= true
            buy:=false             
//dec4 dec5
    if dec1 == false and dec2==false and dec3== false and dec4== true and dec5== true
        if (checker_8 == true or checker_81==true) and (checker_10 == true or checker_101 == true)
            label.new(bar_index, high+ta.tr, color=color.red,style= label.style_label_down, size=size.small, text="MACD\n WAVE")
            strategy.entry("short", strategy.short)
            sell:= true
            buy:=false             
//=======================================================================3 SEÇENEK=======================================================================//
// dec1 dec2 dec3
    if dec1 == true and dec2==true and dec3 == true and dec4 ==false and dec5== false
        if (checker_2 == true or checker_21==true) and (checker_4 == true or checker_41 == true) and (checker_6 == true or checker_61 == true)
            label.new(bar_index, high+ta.tr/2, color=color.red,style= label.style_label_down, size=size.small, text="HARSI\n SSL\n\n CORAL")
            strategy.entry("short", strategy.short)
            sell:= true
            buy := false
// dec1 dec2 dec4
    if dec1 == true and dec2==true and dec3 == false and dec4 ==true and dec5== false
        if (checker_2 == true or checker_21==true) and (checker_4 == true or checker_41 == true) and (checker_8 == true or checker_81 == true)
            label.new(bar_index, high+ta.tr/2, color=color.red,style= label.style_label_down, size=size.small, text="HARSI\n SSL\n\n MACD")
            strategy.entry("short", strategy.short)
            sell:= true
            buy := false
// dec1 dec2 dec5
    if dec1 == true and dec2==true and dec3 == false and dec4 ==false and dec5== true
        if (checker_2 == true or checker_21==true) and (checker_4 == true or checker_41 == true) and (checker_10 == true or checker_101 == true)
            label.new(bar_index, high+ta.tr/2, color=color.red,style= label.style_label_down, size=size.small, text="HARSI\n SSL\n\n MACD ")
            strategy.entry("short", strategy.short)
            sell:= true
            buy:=false
// dec1 dec3 dec4
    if dec1 == true and dec2==false and dec3 == true and dec4 ==true and dec5== false
        if (checker_2 == true or checker_21==true) and (checker_6 == true or checker_61 == true) and (checker_8 == true or checker_81 == true)
            label.new(bar_index, high+ta.tr, color=color.red,style= label.style_label_down, size=size.small, text="HARSI\n CORAL\n\n MACD ")
            strategy.entry("short", strategy.short)
            sell:= true
            buy:=false  
// dec1 dec3 dec5
    if dec1 == true and dec2==false and dec3 == true and dec4 ==false and dec5== true
        if (checker_2 == true or checker_21==true) and (checker_6 == true or checker_61 == true) and (checker_10 == true or checker_101 == true)
            label.new(bar_index, high+ta.tr, color=color.red,style= label.style_label_down, size=size.small, text="HARSI\n SSL\n\n MACD ")
            strategy.entry("short", strategy.short)
            sell:= true
            buy:=false
// dec1 dec4 dec5
    if dec1 == true and dec2==false and dec3 == false and dec4 ==true and dec5== true
        if (checker_2 == true or checker_21==true) and (checker_8 == true or checker_81 == true) and (checker_10 == true or checker_101 == true)
            label.new(bar_index, high+ta.tr, color=color.red,style= label.style_label_down, size=size.small, text="HARSI\n MACD\n\n WAVE ")
            strategy.entry("short", strategy.short)
            sell:= true
            buy:=false
// dec2 dec3 dec4
    if dec1 == false and dec2==true and dec3 == true and dec4==true and dec5== false
        if (checker_4 == true or checker_41==true) and (checker_6 == true or checker_61 == true) and (checker_8 == true or checker_81 == true)
            label.new(bar_index, high+ta.tr, color=color.red,style= label.style_label_down, size=size.small, text="SSL\n CORAL\n\n MACD")
            strategy.entry("short", strategy.short)
            sell:= true
            buy:=false
// dec2 dec3 dec5
    if dec1 == false and dec2==true and dec3== true and dec4== false and dec5== true
        if (checker_4 == true or checker_41==true) and (checker_6 == true or checker_61 == true) and (checker_10 == true or checker_101==true)
            label.new(bar_index, high+ta.tr, color=color.red,style= label.style_label_down, size=size.small, text="SSL\n CORAL\n\n WAVE")
            strategy.entry("short", strategy.short)
            sell:= true
            buy:=false
// dec2 dec4 dec5
    if dec1 == false and dec2==true and dec3== false and dec4== true and dec5== true
        if (checker_4 == true or checker_41==true) and (checker_8 == true or checker_81 == true) and (checker_10 == true or checker_101==true)
            label.new(bar_index, high+ta.tr, color=color.red,style= label.style_label_down, size=size.small, text="SSL\n CORAL\n\n WAVE")
            strategy.entry("short", strategy.short)
            sell:= true
            buy:=false
// dec3 dec4 dec5
    if dec1 == false and dec2==false and dec3 == true and dec4 ==true and dec5== true
        if (checker_6 == true or checker_61==true) and (checker_8 == true or checker_81 == true) and (checker_10 == true or checker_101 == true)
            label.new(bar_index, high+ta.tr, color=color.red,style= label.style_label_down, size=size.small, text="CORAL\n MACD\n\n WAVE")
            strategy.entry("short", strategy.short)
            sell:= true
            buy:=false
//=======================================================================4 SEÇENEK=======================================================================//
//dec1 dec2 dec3 dec4
    if dec1 == true and dec2==true and dec3 == true and dec4==true and dec5== false
        if (checker_2 == true or checker_21==true) and (checker_4 == true or checker_41 == true) and (checker_6 == true or checker_61 == true) and (checker_8 == true or checker_81 ==true)
            label.new(bar_index, high+ta.tr, color=color.red,style= label.style_label_down, size=size.small, text="HARSI\n SSL\n\n CORAL\n\n\n MACD")
            strategy.entry("short", strategy.short)
            sell:= true
            buy:=false        
//dec1 dec3 dec4 dec5
    if dec1 == true and dec2==false and dec3 == true and dec4==true and dec5== true
        if (checker_2 == true or checker_21==true) and (checker_6 == true or checker_61 == true) and (checker_8 == true or checker_81 == true) and (checker_10 == true or checker_101 ==true)
            label.new(bar_index, high+ta.tr, color=color.red,style= label.style_label_down, size=size.small, text="HARSI\n CORAL\n\n MACD\n\n\n WAVE")
            strategy.entry("short", strategy.short)
            sell:= true
            buy:=false
//dec1 dec2 dec4 dec5
    if dec1 == true and dec2==true and dec3 == false and dec4==true and dec5== true
        if (checker_2 == true or checker_21==true) and (checker_4 == true or checker_41 == true) and (checker_8 == true or checker_81 == true) and (checker_10 == true or checker_101 ==true)
            label.new(bar_index, high+ta.tr, color=color.red,style= label.style_label_down, size=size.small, text="HARSI\n SSL\n\n MACD\n\n\n WAVE")
            strategy.entry("short", strategy.short)
            sell:= true
            buy:=false
//dec1 dec2 dec3 dec5
    if dec1 == true and dec2==true and dec3 == true and dec4==false and dec5== true
        if (checker_2 == true or checker_21==true) and (checker_4 == true or checker_41 == true) and (checker_6 == true or checker_61 == true) and (checker_8 == true or checker_81 ==true)
            label.new(bar_index, high+ta.tr, color=color.red,style= label.style_label_down, size=size.small, text="HARSI\n SSL\n\n CORAL\n\n\n WAVE")
            strategy.entry("short", strategy.short)
            sell:= true
            buy:=false 
//dec2 dec3 dec4 dec5
    if dec1 == false and dec2==true and dec3 == true and dec4==true and dec5== true 
        if (checker_4 == true or checker_41 == true) and (checker_6 == true or checker_61 == true) and (checker_8 == true or checker_81 ==true) and (checker_10 == true or checker_101==true) 
            label.new(bar_index, high+ta.tr, color=color.red,style= label.style_label_down, size=size.small, text="SSL\n CORAL\n\n MACD\n\n\n WAVE")
            strategy.entry("short", strategy.short)
            sell:= true
            buy:=false
//=======================================================================5 SEÇENEK=======================================================================//
//dec1 dec2 dec3 dec4 dec5
    if dec1 == true and dec2==true and dec3 == true and dec4==true and dec5== true 
        if (checker_2 == true or checker_21) and (checker_4 == true or checker_41 == true) and (checker_6 == true or checker_61 == true) and (checker_8 == true or checker_81 ==true) and (checker_10 == true or checker_101==true) 
            label.new(bar_index, high+ta.tr, color=color.red,style= label.style_label_down, size=size.small, text="SUPER SELL")
            strategy.entry("short", strategy.short)            
            sell:= true
            buy:=false

Más.