OPEN-SOURCE SCRIPT

IndicadorGH EVC v1 [Bielhpp]

//version=6
//Desenvolvido por Bielhpp Indicador Ponto de Entrada em tendencia

indicator(title='IndicadorGH EVC v1 [Bielhpp]', overlay=true)

Bars = input.int(defval=8, title="Bars", minval=1, maxval=21, step=1)
MaxPercStop = input.int(defval=20, title="Max Percentual Stop", minval=1)

highValue = ta.highest(high, Bars + 1)
lowValue = ta.lowest(low, Bars + 1)

ColorUP = input.color(#66D8D8, "Buy")
ColorDown = input.color(#F2CC0D, "Sell")

ema9 = ta.ema(close, 9)
sma10 = ta.sma(close, 10)
ema27 = ta.ema(close, 27)
ema57 = ta.ema(close, 57)
ema200 = ta.ema(close, 200)
ema400 = ta.ema(close, 400)

plot(ema9, color=#fffeb4, title="9", linewidth=1)
plot(ema27, color=#1927bf, title="27", linewidth=2)
plot(ema200, color=#2CFFFE, title="200", linewidth=3)
plot(ema400, color=#FC28FC, title="400", linewidth=3)

crossUP = ta.crossover(ema27, ema57)
crossDOWN = ta.crossunder(ema27, ema57)

plotshape(series=crossUP ? ema27 : na, location=location.belowbar, color=#43f16c, style=shape.triangleup, text="BUY")
plotshape(series=crossDOWN ? ema27 : na, location=location.abovebar, color=color.rgb(241, 50, 50), style=shape.triangledown, text="SELL")

plot(ema27, color=color.blue)
plot(ema57, color=color.orange)

crossUPMAX = ta.crossover(ema9, ema400)
crossDOWNMAX = ta.crossunder(ema9, ema400)

plotshape(series=crossUPMAX ? ema9 : na, location=location.belowbar, color=#43f16c, style=shape.triangleup, text="MAX_BUY")
plotshape(series=crossDOWNMAX ? ema9 : na, location=location.abovebar, color=color.rgb(241, 50, 50), style=shape.triangledown, text="MAX_SELL")

// Configurar alertas para os cruzamentos
if (crossUPMAX)
alert("Alerta: Condição MAX_BUY foi ativada! Verifique o gráfico.", alert.freq_once_per_bar)

if (crossDOWNMAX)
alert("Alerta: Condição MAX_SELL foi ativada! Verifique o gráfico.", alert.freq_once_per_bar)


bUP = false
bDown = false
bDestaque = false

fTexto(vMsg, vTrigger, vStop, percStop) =>
syminfo.tickerid + ' ' + timeframe.period + vMsg + str.tostring(vTrigger) + ' Stop: ' + str.tostring(vStop + syminfo.mintick) + ' (' + str.tostring(percStop, format.percent) + ')'

if (sma10 >= sma10[1]) and (open < sma10[1]) and ((close > sma10) and (ema27 > ema57))
vStop = high - lowValue
pStop = vStop / high * 100
bUP := true

if pStop <= MaxPercStop
alert(fTexto((bDestaque ? ': *** DESTAQUE COMPRA *** ' : ': Compra: '), high, lowValue, pStop), alert.freq_once_per_bar_close)

if (sma10 <= sma10[1]) and (open > sma10[1]) and ((close < sma10) and (ema27 < ema57))
vStop = highValue - low
pStop = vStop / low * 100
bDown := true

if pStop <= MaxPercStop
alert(fTexto((bDestaque ? ': *** DESTAQUE VENDA *** ' : ': Venda: '), low, highValue, pStop), alert.freq_once_per_bar_close)

barcolor(bUP ? ColorUP : bDown ? ColorDown : na)

כתב ויתור