OPEN-SOURCE SCRIPT
Diupdate 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.
Catatan Rilis
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.
Skrip open-source
Dengan semangat TradingView yang sesungguhnya, penulis skrip ini telah menjadikannya sumber terbuka, sehingga para trader dapat meninjau dan memverifikasi fungsinya. Hormat untuk penulisnya! Meskipun anda dapat menggunakannya secara gratis, ingatlah bahwa penerbitan ulang kode tersebut tunduk pada Tata Tertib kami.
Pernyataan Penyangkalan
Informasi dan publikasi tidak dimaksudkan untuk menjadi, dan bukan merupakan saran keuangan, investasi, perdagangan, atau rekomendasi lainnya yang diberikan atau didukung oleh TradingView. Baca selengkapnya di Persyaratan Penggunaan.
Skrip open-source
Dengan semangat TradingView yang sesungguhnya, penulis skrip ini telah menjadikannya sumber terbuka, sehingga para trader dapat meninjau dan memverifikasi fungsinya. Hormat untuk penulisnya! Meskipun anda dapat menggunakannya secara gratis, ingatlah bahwa penerbitan ulang kode tersebut tunduk pada Tata Tertib kami.
Pernyataan Penyangkalan
Informasi dan publikasi tidak dimaksudkan untuk menjadi, dan bukan merupakan saran keuangan, investasi, perdagangan, atau rekomendasi lainnya yang diberikan atau didukung oleh TradingView. Baca selengkapnya di Persyaratan Penggunaan.