//version=5
indicator("Wyckoff Trend Indicator", overlay=true)
// Input Parameters
ma_length = input.int(50, title="Moving Average Length", minval=1)
volume_threshold = input.float(1.5, title="Volume Threshold Multiplier", minval=0.1)
// Calculate Moving Average
ma = ta.sma(close, ma_length)
// Volume Analysis
avg_volume = ta.sma(volume, ma_length)
high_volume = volume > (volume_threshold * avg_volume)
// Price and Volume Conditions
uptrend = close > ma and high_volume
downtrend = close < ma and high_volume
accumulation = close > ma and volume < avg_volume
distribution = close < ma and volume < avg_volume
// Plotting Signals
plot(ma, color=color.blue, linewidth=2, title="Moving Average")
bgcolor(uptrend ? color.new(color.green, 80) : na, title="Uptrend Background")
bgcolor(downtrend ? color.new(color.red, 80) : na, title="Downtrend Background")
// Adding Labels
if uptrend
label.new(bar_index, high, "Uptrend", style=label.style_circle, color=color.new(color.green, 20))
if downtrend
label.new(bar_index, low, "Downtrend", style=label.style_circle, color=color.new(color.red, 20))
if accumulation
label.new(bar_index, low, "Accumulation", style=label.style_label_up, color=color.new(color.yellow, 20))
if distribution
label.new(bar_index, high, "Distribution", style=label.style_label_down, color=color.new(color.purple, 20))
indicator("Wyckoff Trend Indicator", overlay=true)
// Input Parameters
ma_length = input.int(50, title="Moving Average Length", minval=1)
volume_threshold = input.float(1.5, title="Volume Threshold Multiplier", minval=0.1)
// Calculate Moving Average
ma = ta.sma(close, ma_length)
// Volume Analysis
avg_volume = ta.sma(volume, ma_length)
high_volume = volume > (volume_threshold * avg_volume)
// Price and Volume Conditions
uptrend = close > ma and high_volume
downtrend = close < ma and high_volume
accumulation = close > ma and volume < avg_volume
distribution = close < ma and volume < avg_volume
// Plotting Signals
plot(ma, color=color.blue, linewidth=2, title="Moving Average")
bgcolor(uptrend ? color.new(color.green, 80) : na, title="Uptrend Background")
bgcolor(downtrend ? color.new(color.red, 80) : na, title="Downtrend Background")
// Adding Labels
if uptrend
label.new(bar_index, high, "Uptrend", style=label.style_circle, color=color.new(color.green, 20))
if downtrend
label.new(bar_index, low, "Downtrend", style=label.style_circle, color=color.new(color.red, 20))
if accumulation
label.new(bar_index, low, "Accumulation", style=label.style_label_up, color=color.new(color.yellow, 20))
if distribution
label.new(bar_index, high, "Distribution", style=label.style_label_down, color=color.new(color.purple, 20))
Thông báo miễn trừ trách nhiệm
Thông tin và các ấn phẩm này không nhằm mục đích, và không cấu thành, lời khuyên hoặc khuyến nghị về tài chính, đầu tư, giao dịch hay các loại khác do TradingView cung cấp hoặc xác nhận. Đọc thêm tại Điều khoản Sử dụng.
Thông báo miễn trừ trách nhiệm
Thông tin và các ấn phẩm này không nhằm mục đích, và không cấu thành, lời khuyên hoặc khuyến nghị về tài chính, đầu tư, giao dịch hay các loại khác do TradingView cung cấp hoặc xác nhận. Đọc thêm tại Điều khoản Sử dụng.
