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が提供または保証する金融、投資、取引、またはその他の種類のアドバイスや推奨を意図したものではなく、またそのようなものでもありません。詳しくは利用規約をご覧ください。