OPEN-SOURCE SCRIPT
moh

//version=5
indicator("Test - Clean Base (Fixed Line 95)", overlay=true)
// إعداد بسيط
pivotLen = input.int(5, "Pivot lookback", minval=2)
// نحدد القمم والقيعان
ph = ta.pivothigh(high, pivotLen, pivotLen)
pl = ta.pivotlow(low, pivotLen, pivotLen)
// نرسم القمم والقيعان
if not na(ph)
label.new(bar_index - pivotLen, ph, "Top", yloc=yloc.abovebar, style=label.style_label_down, color=color.new(color.red,0))
if not na(pl)
label.new(bar_index - pivotLen, pl, "Bottom", yloc=yloc.belowbar, style=label.style_label_up, color=color.new(color.green,0))
// نرسم خطين ترند من آخر قمتين وآخر قاعين
lastPH1 = ta.valuewhen(not na(ph), ph, 0)
lastPH2 = ta.valuewhen(not na(ph), ph, 1)
lastPH1_x = ta.valuewhen(not na(ph), bar_index - pivotLen, 0)
lastPH2_x = ta.valuewhen(not na(ph), bar_index - pivotLen, 1)
lastPL1 = ta.valuewhen(not na(pl), pl, 0)
lastPL2 = ta.valuewhen(not na(pl), pl, 1)
lastPL1_x = ta.valuewhen(not na(pl), bar_index - pivotLen, 0)
lastPL2_x = ta.valuewhen(not na(pl), bar_index - pivotLen, 1)
// الخطأ كان هنا (سطر 95) بسبب تنسيق أو محرف غير ظاهر
if not na(lastPH1) and not na(lastPH2)
line.new(x1=lastPH2_x, y1=lastPH2, x2=lastPH1_x, y2=lastPH1, extend=extend.right, color=color.red, width=2)
if not na(lastPL1) and not na(lastPL2)
line.new(x1=lastPL2_x, y1=lastPL2, x2=lastPL1_x, y2=lastPL1, extend=extend.right, color=color.green, width=2)
indicator("Test - Clean Base (Fixed Line 95)", overlay=true)
// إعداد بسيط
pivotLen = input.int(5, "Pivot lookback", minval=2)
// نحدد القمم والقيعان
ph = ta.pivothigh(high, pivotLen, pivotLen)
pl = ta.pivotlow(low, pivotLen, pivotLen)
// نرسم القمم والقيعان
if not na(ph)
label.new(bar_index - pivotLen, ph, "Top", yloc=yloc.abovebar, style=label.style_label_down, color=color.new(color.red,0))
if not na(pl)
label.new(bar_index - pivotLen, pl, "Bottom", yloc=yloc.belowbar, style=label.style_label_up, color=color.new(color.green,0))
// نرسم خطين ترند من آخر قمتين وآخر قاعين
lastPH1 = ta.valuewhen(not na(ph), ph, 0)
lastPH2 = ta.valuewhen(not na(ph), ph, 1)
lastPH1_x = ta.valuewhen(not na(ph), bar_index - pivotLen, 0)
lastPH2_x = ta.valuewhen(not na(ph), bar_index - pivotLen, 1)
lastPL1 = ta.valuewhen(not na(pl), pl, 0)
lastPL2 = ta.valuewhen(not na(pl), pl, 1)
lastPL1_x = ta.valuewhen(not na(pl), bar_index - pivotLen, 0)
lastPL2_x = ta.valuewhen(not na(pl), bar_index - pivotLen, 1)
// الخطأ كان هنا (سطر 95) بسبب تنسيق أو محرف غير ظاهر
if not na(lastPH1) and not na(lastPH2)
line.new(x1=lastPH2_x, y1=lastPH2, x2=lastPH1_x, y2=lastPH1, extend=extend.right, color=color.red, width=2)
if not na(lastPL1) and not na(lastPL2)
line.new(x1=lastPL2_x, y1=lastPL2, x2=lastPL1_x, y2=lastPL1, extend=extend.right, color=color.green, width=2)
開源腳本
本著TradingView的真正精神,此腳本的創建者將其開源,以便交易者可以查看和驗證其功能。向作者致敬!雖然您可以免費使用它,但請記住,重新發佈程式碼必須遵守我們的網站規則。
免責聲明
這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。
開源腳本
本著TradingView的真正精神,此腳本的創建者將其開源,以便交易者可以查看和驗證其功能。向作者致敬!雖然您可以免費使用它,但請記住,重新發佈程式碼必須遵守我們的網站規則。
免責聲明
這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。