Ads Top

Machine Learning Selling Indicator

Machine Learning Selling Indicator 

Built by Grok

Not working....




//@version=6

indicator("ML-Inspired Sell Indicator", overlay=false)


// Inputs

short_ma_length = input.int(10, "Short MA Length", minval=1)

long_ma_length = input.int(50, "Long MA Length", minval=1)

rsi_length = input.int(14, "RSI Length", minval=1)

rsi_overbought = input.float(70, "RSI Overbought Level", minval=0, maxval=100)

volume_lookback = input.int(20, "Volume Lookback", minval=1)


// Calculate indicators

short_ma = ta.sma(close, short_ma_length)

long_ma = ta.sma(close, long_ma_length)

rsi = ta.rsi(close, rsi_length)

volume_avg = ta.sma(volume, volume_lookback)


// Conditions for sell signal

var float sell_score = 0.0

sell_score := 0.0  // Reset each bar


if short_ma < long_ma

    sell_score := sell_score + 1.5


if rsi > rsi_overbought

    sell_score := sell_score + 1.0


volume_spike = volume > volume_avg * 1.5

if volume_spike

    sell_score := sell_score + 0.8


resistance = ta.highest(high, long_ma_length)

if close < resistance and high >= resistance

    sell_score := sell_score + 1.2


// Threshold and signal

sell_threshold = input.float(2.5, "Sell Threshold", minval=0, maxval=5)

sell_signal = sell_score >= sell_threshold


// Plotting

plot(sell_score, title="Sell Score", color=color.blue, linewidth=2)

plot(sell_threshold, title="Threshold", color=color.red, style=plot.style_dashed)

plotshape(sell_signal, title="Sell Signal", location=location.belowbar, color=color.red, style=shape.triangledown, size=size.tiny)

No comments:

Powered by Blogger.