OPEN-SOURCE SCRIPT

Smart Trend Predictor (EMA + Vol + Volatility)

90
//version=5
indicator("Smart Trend Predictor (EMA + Vol + Volatility)", overlay=true)

// === Inputs ===
emaFastLength = input.int(20, title="Fast EMA")
emaSlowLength = input.int(50, title="Slow EMA")
volatilityLength = input.int(14, title="Volatility Period")
volumeLength = input.int(20, title="Volume MA Length")

// === Indicators ===
emaFast = ta.ema(close, emaFastLength)
emaSlow = ta.ema(close, emaSlowLength)
volatility = ta.stdev(close - close[1], volatilityLength)
volumeMA = ta.sma(volume, volumeLength)

// === Signal Conditions ===
buySignal = ta.crossover(emaFast, emaSlow) and volatility > ta.sma(volatility, 14) and volume > volumeMA
sellSignal = ta.crossunder(emaFast, emaSlow) and volatility > ta.sma(volatility, 14) and volume > volumeMA

// === Plot EMAs ===
plot(emaFast, title="Fast EMA", color=color.lime)
plot(emaSlow, title="Slow EMA", color=color.orange)

// === Plot Signals ===
plotshape(buySignal, title="Buy Signal", location=location.belowbar, color=color.green, style=shape.arrowup, size=size.small)
plotshape(sellSignal, title="Sell Signal", location=location.abovebar, color=color.red, style=shape.arrowdown, size=size.small)

Feragatname

Bilgiler ve yayınlar, TradingView tarafından sağlanan veya onaylanan finansal, yatırım, işlem veya diğer türden tavsiye veya tavsiyeler anlamına gelmez ve teşkil etmez. Kullanım Şartları'nda daha fazlasını okuyun.