OPEN-SOURCE SCRIPT
My script

//version=6
strategy("Elite Option Signal Strategy", overlay=true, default_qty_type=strategy.percent_of_equity, default_qty_value=10)
// === INPUTS ===
fastLength = input.int(9, title="Fast MA Length")
slowLength = input.int(21, title="Slow MA Length")
trendLength = input.int(50, title="Trend MA Length")
rsiLength = input.int(14, title="RSI Length")
rsiOversold = input.int(30, title="RSI Oversold Level")
rsiOverbought = input.int(70, title="RSI Overbought Level")
useStopLoss = input.bool(true, title="Use Stop Loss?")
stopLossPercent = input.float(2.0, title="Stop Loss %", minval=0.1, maxval=10.0)
// === INDICATORS ===
fastMA = ta.sma(close, fastLength)
slowMA = ta.sma(close, slowLength)
trendMA = ta.sma(close, trendLength)
rsi = ta.rsi(close, rsiLength)
// === CONDITIONS ===
bullishTrend = close > trendMA
bearishTrend = close < trendMA
longCondition = ta.crossover(fastMA, slowMA) and bullishTrend and rsi < rsiOverbought
shortCondition = ta.crossunder(fastMA, slowMA) and bearishTrend and rsi > rsiOversold
// === EXECUTION ===
if longCondition
strategy.entry("Long", strategy.long)
if useStopLoss
strategy.exit("Exit Long", "Long", stop=close * (1 - stopLossPercent / 100))
if shortCondition
strategy.entry("Short", strategy.short)
if useStopLoss
strategy.exit("Exit Short", "Short", stop=close * (1 + stopLossPercent / 100))
// === PLOTS ===
plot(fastMA, color=color.green, title="Fast MA")
plot(slowMA, color=color.red, title="Slow MA")
plot(trendMA, color=color.blue, title="Trend MA")
plotshape(longCondition, title="Buy Signal", location=location.belowbar, color=color.green, style=shape.triangleup)
plotshape(shortCondition, title="Sell Signal", location=location.abovebar, color=color.red, style=shape.triangledown)
strategy("Elite Option Signal Strategy", overlay=true, default_qty_type=strategy.percent_of_equity, default_qty_value=10)
// === INPUTS ===
fastLength = input.int(9, title="Fast MA Length")
slowLength = input.int(21, title="Slow MA Length")
trendLength = input.int(50, title="Trend MA Length")
rsiLength = input.int(14, title="RSI Length")
rsiOversold = input.int(30, title="RSI Oversold Level")
rsiOverbought = input.int(70, title="RSI Overbought Level")
useStopLoss = input.bool(true, title="Use Stop Loss?")
stopLossPercent = input.float(2.0, title="Stop Loss %", minval=0.1, maxval=10.0)
// === INDICATORS ===
fastMA = ta.sma(close, fastLength)
slowMA = ta.sma(close, slowLength)
trendMA = ta.sma(close, trendLength)
rsi = ta.rsi(close, rsiLength)
// === CONDITIONS ===
bullishTrend = close > trendMA
bearishTrend = close < trendMA
longCondition = ta.crossover(fastMA, slowMA) and bullishTrend and rsi < rsiOverbought
shortCondition = ta.crossunder(fastMA, slowMA) and bearishTrend and rsi > rsiOversold
// === EXECUTION ===
if longCondition
strategy.entry("Long", strategy.long)
if useStopLoss
strategy.exit("Exit Long", "Long", stop=close * (1 - stopLossPercent / 100))
if shortCondition
strategy.entry("Short", strategy.short)
if useStopLoss
strategy.exit("Exit Short", "Short", stop=close * (1 + stopLossPercent / 100))
// === PLOTS ===
plot(fastMA, color=color.green, title="Fast MA")
plot(slowMA, color=color.red, title="Slow MA")
plot(trendMA, color=color.blue, title="Trend MA")
plotshape(longCondition, title="Buy Signal", location=location.belowbar, color=color.green, style=shape.triangleup)
plotshape(shortCondition, title="Sell Signal", location=location.abovebar, color=color.red, style=shape.triangledown)
Script de código abierto
Siguiendo fielmente el espíritu de TradingView, el creador de este script lo ha publicado en código abierto, permitiendo que otros traders puedan revisar y verificar su funcionalidad. ¡Enhorabuena al autor! Puede utilizarlo de forma gratuita, pero tenga en cuenta que la publicación de este código está sujeta a nuestras Normas internas.
Exención de responsabilidad
La información y las publicaciones que ofrecemos, no implican ni constituyen un asesoramiento financiero, ni de inversión, trading o cualquier otro tipo de consejo o recomendación emitida o respaldada por TradingView. Puede obtener información adicional en las Condiciones de uso.
Script de código abierto
Siguiendo fielmente el espíritu de TradingView, el creador de este script lo ha publicado en código abierto, permitiendo que otros traders puedan revisar y verificar su funcionalidad. ¡Enhorabuena al autor! Puede utilizarlo de forma gratuita, pero tenga en cuenta que la publicación de este código está sujeta a nuestras Normas internas.
Exención de responsabilidad
La información y las publicaciones que ofrecemos, no implican ni constituyen un asesoramiento financiero, ni de inversión, trading o cualquier otro tipo de consejo o recomendación emitida o respaldada por TradingView. Puede obtener información adicional en las Condiciones de uso.