OPEN-SOURCE SCRIPT
GENESIS

//version=5
indicator("SMAs + Confirmação 2ª Vela + ALERTA", overlay=true)
// Médias
len1 = input.int(8, title="SMA Rápida")
len2 = input.int(21, title="SMA Lenta")
sma1 = ta.sma(close, len1)
sma2 = ta.sma(close, len2)
// Plot
plot(sma1, color=color.green, linewidth=2)
plot(sma2, color=color.blue, linewidth=2)
// Cruzamentos
crossUp = ta.crossover(sma1, sma2)
crossDown = ta.crossunder(sma1, sma2)
// Contadores
var int countUp = 0
var int countDown = 0
if (crossUp)
countUp := 1
else if (countUp > 0)
countUp += 1
if (crossDown)
countDown := 1
else if (countDown > 0)
countDown += 1
// Reset
if (crossDown)
countUp := 0
if (crossUp)
countDown := 0
// Sinais na 2ª vela
buySignal = countUp == 2
sellSignal = countDown == 2
// Plot sinais
plotshape(buySignal, title="COMPRA", location=location.belowbar, color=color.green, style=shape.labelup, text="BUY")
plotshape(sellSignal, title="VENDA", location=location.abovebar, color=color.red, style=shape.labeldown, text="SELL")
// ALERTAS 🚨
alertcondition(buySignal, title="ALERTA COMPRA", message="📈 COMPRA confirmada após 2ª vela!")
alertcondition(sellSignal, title="ALERTA VENDA", message="📉 VENDA confirmada após 2ª vela!")
indicator("SMAs + Confirmação 2ª Vela + ALERTA", overlay=true)
// Médias
len1 = input.int(8, title="SMA Rápida")
len2 = input.int(21, title="SMA Lenta")
sma1 = ta.sma(close, len1)
sma2 = ta.sma(close, len2)
// Plot
plot(sma1, color=color.green, linewidth=2)
plot(sma2, color=color.blue, linewidth=2)
// Cruzamentos
crossUp = ta.crossover(sma1, sma2)
crossDown = ta.crossunder(sma1, sma2)
// Contadores
var int countUp = 0
var int countDown = 0
if (crossUp)
countUp := 1
else if (countUp > 0)
countUp += 1
if (crossDown)
countDown := 1
else if (countDown > 0)
countDown += 1
// Reset
if (crossDown)
countUp := 0
if (crossUp)
countDown := 0
// Sinais na 2ª vela
buySignal = countUp == 2
sellSignal = countDown == 2
// Plot sinais
plotshape(buySignal, title="COMPRA", location=location.belowbar, color=color.green, style=shape.labelup, text="BUY")
plotshape(sellSignal, title="VENDA", location=location.abovebar, color=color.red, style=shape.labeldown, text="SELL")
// ALERTAS 🚨
alertcondition(buySignal, title="ALERTA COMPRA", message="📈 COMPRA confirmada após 2ª vela!")
alertcondition(sellSignal, title="ALERTA VENDA", message="📉 VENDA confirmada após 2ª vela!")
Open-source Skript
Ganz im Sinne von TradingView hat dieser Autor sein/ihr Script als Open-Source veröffentlicht. Auf diese Weise können nun auch andere Trader das Script rezensieren und die Funktionalität überprüfen. Vielen Dank an den Autor! Sie können das Script kostenlos verwenden, aber eine Wiederveröffentlichung des Codes unterliegt unseren Hausregeln.
Haftungsausschluss
Die Informationen und Veröffentlichungen sind nicht als Finanz-, Anlage-, Handels- oder andere Arten von Ratschlägen oder Empfehlungen gedacht, die von TradingView bereitgestellt oder gebilligt werden, und stellen diese nicht dar. Lesen Sie mehr in den Nutzungsbedingungen.
Open-source Skript
Ganz im Sinne von TradingView hat dieser Autor sein/ihr Script als Open-Source veröffentlicht. Auf diese Weise können nun auch andere Trader das Script rezensieren und die Funktionalität überprüfen. Vielen Dank an den Autor! Sie können das Script kostenlos verwenden, aber eine Wiederveröffentlichung des Codes unterliegt unseren Hausregeln.
Haftungsausschluss
Die Informationen und Veröffentlichungen sind nicht als Finanz-, Anlage-, Handels- oder andere Arten von Ratschlägen oder Empfehlungen gedacht, die von TradingView bereitgestellt oder gebilligt werden, und stellen diese nicht dar. Lesen Sie mehr in den Nutzungsbedingungen.