Create scriptIQOption #365
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
//@Version=5
indicator("SniperTrader_Binary v1", overlay=true)
// 🎯 Inputs da estratégia
emaCurta = input.int(9, "EMA Curta", minval=1)
emaLonga = input.int(21, "EMA Longa", minval=1)
rsiLen = input.int(14, "RSI Período", minval=1)
rsiOB = input.int(70, "RSI Sobrecomprado")
rsiOS = input.int(30, "RSI Sobrevendido")
bbLen = input.int(20, "BB Período", minval=1)
bbMult = input.float(2.0, "BB Multiplicador", minval=0.1)
// 📈 Indicadores
ema1 = ta.ema(close, emaCurta)
ema2 = ta.ema(close, emaLonga)
rsi = ta.rsi(close, rsiLen)
basis = ta.sma(close, bbLen)
dev = bbMult * ta.stdev(close, bbLen)
bbUpper = basis + dev
bbLower = basis - dev
// 📌 Condições de entrada
callSignal = ta.crossover(ema1, ema2) and rsi < rsiOS and close < bbLower putSignal = ta.crossunder(ema1, ema2) and rsi > rsiOB and close > bbUpper
// 📍 Sinais visuais
plotshape(callSignal, title="CALL", location=location.belowbar, color=color.green, style=shape.labelup, text="CALL") plotshape(putSignal, title="PUT", location=location.abovebar, color=color.red, style=shape.labeldown, text="PUT")
// 📢 Alertas
alertcondition(callSignal, title="Alerta CALL", message="SniperTrader_Binary: Sinal de CALL!") alertcondition(putSignal, title="Alerta PUT", message="SniperTrader_Binary: Sinal de PUT!")
// 🔵 Visualização das EMAs e BB
plot(ema1, title="EMA Curta", color=color.aqua)
plot(ema2, title="EMA Longa", color=color.orange)
plot(bbUpper, title="BB Superior", color=color.gray) plot(bbLower, title="BB Inferior", color=color.gray)