OPEN-SOURCE SCRIPT
ที่อัปเดต:

Double Top/Bottom Screener with ATR

43
otential Issues in the Latest Script
Based on the code and your previous feedback, here are possible mistakes:

Syntax or Compilation Error:

The script might have a typo or incomplete logic, especially with the new nearestDoubleLevel and distanceNormalizedATR additions.
Check: The table definition in the if barstate.islast block has 4 columns defined but tries to access a 5th with table.cell(infoTable, 0, 4, ...), which causes an "index out of bounds" error. This is a clear mistake.


Distance or Level Calculation:

If "Dist: NaN%" or "Level: NaN" appears, it might indicate that doubleTopLevel or doubleBottomLevel isn’t being set correctly, possibly due to the tolerance or array logic.
Check: The ATR-normalized distance (distanceNormalizedATR) might fail if atr is na due to insufficient bars.


Screener Column Issue:

The new columns ("Nearest Double Level Price" and "Normalized Distance (ATR)") might not display or sort correctly in the Pine Screener due to plotting or naming conflicts.

เอกสารเผยแพร่
Save and Apply:

Click "Save" in the Pine Editor (name it "Double Top/Bottom Screener" if prompted).
Click "Add to Chart" to apply it to your current chart.


Check the Chart:

Verify that lines and levels start from 04:00 AM ET today (e.g., no lines from yesterday, September 25, 2025).
Set maxPeaks to 3 in the indicator settings and check if "Pattern: 1" triggers with 3 identical peaks.
Ensure "ATR Dist" shows a value (e.g., 0.5) when a pattern is active.


Update and Run Pine Screener:

Go to Pine Screener (Products > Screeners > Pine).
Select your watchlist, set timeframe to 1min, choose the updated indicator.
Add filter: "Pattern Signal >= 1".
Click "Scan". Check if "Nearest Double Level Price" and "Normalized Distance (ATR)" columns are populated.

คำจำกัดสิทธิ์ความรับผิดชอบ

ข้อมูลและบทความไม่ได้มีวัตถุประสงค์เพื่อก่อให้เกิดกิจกรรมทางการเงิน, การลงทุน, การซื้อขาย, ข้อเสนอแนะ หรือคำแนะนำประเภทอื่น ๆ ที่ให้หรือรับรองโดย TradingView อ่านเพิ่มเติมที่ ข้อกำหนดการใช้งาน