OPEN-SOURCE SCRIPT

gfg

102
//version=5
indicator("Lux Gainz Style Algo", overlay=true)

// User Inputs
fastLen = input.int(12, "Fast MA Length", minval=1)
slowLen = input.int(26, "Slow MA Length", minval=1)
rsiLen = input.int(14, "RSI Length", minval=1)
rsiOverbought = input.float(70, "RSI Overbought Level")
rsiOversold = input.float(30, "RSI Oversold Level")
sensitivity = input.float(1.5, "Signal Sensitivity", minval=0.1, step=0.1)

// Moving Averages for Trend
fastMA = ta.ema(close, fastLen)
slowMA = ta.ema(close, slowLen)

// RSI for Momentum
rsi = ta.rsi(close, rsiLen)

// Trend Conditions
bullTrend = fastMA > slowMA
bearTrend = fastMA < slowMA

// Confirmation Signals
longSignal = ta.crossover(fastMA, slowMA) and rsi < rsiOversold * sensitivity
shortSignal = ta.crossunder(fastMA, slowMA) and rsi > rsiOverbought / sensitivity

// Plot Moving Averages
plot(fastMA, color=color.new(color.green, 0), title="Fast EMA")
plot(slowMA, color=color.new(color.red, 0), title="Slow EMA")

// Candle Coloring for Trend Strength
barcolor(bullTrend ? color.new(color.green, 70) : bearTrend ? color.new(color.red, 70) : color.gray)

// Plot Buy/Sell Signals
plotshape(longSignal, title="Buy Signal", location=location.belowbar, color=color.green, style=shape.labelup, size=size.small)
plotshape(shortSignal, title="Sell Signal", location=location.abovebar, color=color.red, style=shape.labeldown, size=size.small)

// Alerts
alertcondition(longSignal, title="Long Entry", message="Lux Gainz Algo: Long Entry Signal")
alertcondition(shortSignal, title="Short Entry", message="Lux Gainz Algo: Short Entry Signal")

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.