OPEN-SOURCE SCRIPT
Elliott Wave Helper

//version=5
indicator("Elliott Wave Helper", overlay=true)
// Settings
pivotLength = input.int(5, "Pivot Length")
showLabels = input.bool(true, "Show Wave Labels")
zigzagColor = input.color(color.orange, "Zigzag Line Color")
// Find Pivot Highs and Lows
pivotHigh = ta.pivothigh(high, pivotLength, pivotLength)
pivotLow = ta.pivotlow(low, pivotLength, pivotLength)
// Store pivots
var float[] pivotPrices = array.new_float()
var int[] pivotBars = array.new_int()
if not na(pivotHigh)
array.push(pivotPrices, pivotHigh)
array.push(pivotBars, bar_index - pivotLength)
if not na(pivotLow)
array.push(pivotPrices, pivotLow)
array.push(pivotBars, bar_index - pivotLength)
// Draw zigzag line between pivots
for i = 1 to array.size(pivotBars) - 1
x1 = array.get(pivotBars, i - 1)
y1 = array.get(pivotPrices, i - 1)
x2 = array.get(pivotBars, i)
y2 = array.get(pivotPrices, i)
line.new(x1, y1, x2, y2, width=2, color=zigzagColor)
// Label waves as 1-5 or A-C (manual cycling)
if showLabels
waveLabels = array.from("1", "2", "3", "4", "5", "A", "B", "C")
labelText = array.get(waveLabels, (i - 1) % array.size(waveLabels))
label.new(x2, y2, text=labelText, style=label.style_label_up, textcolor=color.white, size=size.small, color=color.blue)
indicator("Elliott Wave Helper", overlay=true)
// Settings
pivotLength = input.int(5, "Pivot Length")
showLabels = input.bool(true, "Show Wave Labels")
zigzagColor = input.color(color.orange, "Zigzag Line Color")
// Find Pivot Highs and Lows
pivotHigh = ta.pivothigh(high, pivotLength, pivotLength)
pivotLow = ta.pivotlow(low, pivotLength, pivotLength)
// Store pivots
var float[] pivotPrices = array.new_float()
var int[] pivotBars = array.new_int()
if not na(pivotHigh)
array.push(pivotPrices, pivotHigh)
array.push(pivotBars, bar_index - pivotLength)
if not na(pivotLow)
array.push(pivotPrices, pivotLow)
array.push(pivotBars, bar_index - pivotLength)
// Draw zigzag line between pivots
for i = 1 to array.size(pivotBars) - 1
x1 = array.get(pivotBars, i - 1)
y1 = array.get(pivotPrices, i - 1)
x2 = array.get(pivotBars, i)
y2 = array.get(pivotPrices, i)
line.new(x1, y1, x2, y2, width=2, color=zigzagColor)
// Label waves as 1-5 or A-C (manual cycling)
if showLabels
waveLabels = array.from("1", "2", "3", "4", "5", "A", "B", "C")
labelText = array.get(waveLabels, (i - 1) % array.size(waveLabels))
label.new(x2, y2, text=labelText, style=label.style_label_up, textcolor=color.white, size=size.small, color=color.blue)
開源腳本
本著TradingView的真正精神,此腳本的創建者將其開源,以便交易者可以查看和驗證其功能。向作者致敬!雖然您可以免費使用它,但請記住,重新發佈程式碼必須遵守我們的網站規則。
免責聲明
這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。
開源腳本
本著TradingView的真正精神,此腳本的創建者將其開源,以便交易者可以查看和驗證其功能。向作者致敬!雖然您可以免費使用它,但請記住,重新發佈程式碼必須遵守我們的網站規則。
免責聲明
這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。