OPEN-SOURCE SCRIPT

Scalping - 8/13/21 EMA with Volume

235
//version=5
// Indicator: Scalping Trend Reversal with 8/13/21 EMA and Volume
indicator("Scalping - 8/13/21 EMA with Volume", overlay=true)

// Define EMAs
ema8 = ta.ema(close, 8)
ema13 = ta.ema(close, 13)
ema21 = ta.ema(close, 21)

// Plot EMAs
plot(ema8, color=color.yellow, title="EMA 8", linewidth=2)
plot(ema13, color=color.blue, title="EMA 13", linewidth=2)
plot(ema21, color=color.red, title="EMA 21", linewidth=2)

// Volume Moving Average (short-term, e.g., 10-period)
volMA = ta.sma(volume, 10)

// Define Volume Surge (volume > 1.5x its 10-period average)
volSurge = volume > volMA * 1.5

// Bullish Reversal: EMA 8 crosses above EMA 13, price above EMA 21, with volume surge
bullishReversal = ta.crossover(ema8, ema13) and close > ema21 and volSurge

// Bearish Reversal: EMA 8 crosses below EMA 13, price below EMA 21, with volume surge
bearishReversal = ta.crossunder(ema8, ema13) and close < ema21 and volSurge

// Plot Signals
plotshape(bullishReversal, title="Bullish Entry", location=location.belowbar, color=color.green, style=shape.triangleup, size=size.tiny)
plotshape(bearishReversal, title="Bearish Entry", location=location.abovebar, color=color.red, style=shape.triangledown, size=size.tiny)

// Optional: Highlight Volume Surge (non-overlay) - Comment out if not needed
// plot(volume, color=color.gray, title="Volume", style=plot.style_histogram)

Clause de non-responsabilité

Les informations et les publications ne sont pas destinées à être, et ne constituent pas, des conseils ou des recommandations en matière de finance, d'investissement, de trading ou d'autres types de conseils fournis ou approuvés par TradingView. Pour en savoir plus, consultez les Conditions d'utilisation.