OPEN-SOURCE SCRIPT
Aktualisiert Double Top/Bottom Screener with ATR

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.
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.
Versionshinweise
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.
Open-source Skript
Ganz im Sinne von TradingView hat dieser Autor sein/ihr Script als Open-Source veröffentlicht. Auf diese Weise können nun auch andere Trader das Script rezensieren und die Funktionalität überprüfen. Vielen Dank an den Autor! Sie können das Script kostenlos verwenden, aber eine Wiederveröffentlichung des Codes unterliegt unseren Hausregeln.
Haftungsausschluss
Die Informationen und Veröffentlichungen sind nicht als Finanz-, Anlage-, Handels- oder andere Arten von Ratschlägen oder Empfehlungen gedacht, die von TradingView bereitgestellt oder gebilligt werden, und stellen diese nicht dar. Lesen Sie mehr in den Nutzungsbedingungen.
Open-source Skript
Ganz im Sinne von TradingView hat dieser Autor sein/ihr Script als Open-Source veröffentlicht. Auf diese Weise können nun auch andere Trader das Script rezensieren und die Funktionalität überprüfen. Vielen Dank an den Autor! Sie können das Script kostenlos verwenden, aber eine Wiederveröffentlichung des Codes unterliegt unseren Hausregeln.
Haftungsausschluss
Die Informationen und Veröffentlichungen sind nicht als Finanz-, Anlage-, Handels- oder andere Arten von Ratschlägen oder Empfehlungen gedacht, die von TradingView bereitgestellt oder gebilligt werden, und stellen diese nicht dar. Lesen Sie mehr in den Nutzungsbedingungen.