OPEN-SOURCE SCRIPT

Range Detection [No Repaint]

DETECTS RANGE EARLY

Using Confirmed Data:

All calculations now use [1] to reference the previous completed candle
Signals are only generated based on completed candles
Range state is stored and confirmed before displaying


Key Changes to Prevent Repainting:

ATR calculations use previous candle data
Bollinger Bands calculate from previous closes
Price range checks use previous highs and lows
Range state is confirmed before displaying


How to Verify No Repainting:

Signals will only appear after a candle closes
Historical signals will remain unchanged
Alerts will only trigger on confirmed changes



This means:

The indicator will be slightly delayed (one candle)
But signals will be more reliable
Historical analysis will be accurate
Backtesting results will match real-time performance

Usage Tips with No-Repaint Version:

Wait for candle close before acting on signals
Use the confirmed range state for decision making
Consider the one-candle delay in your strategy timing
Alerts will only trigger on confirmed condition changes

Would you like me to:

Add a parameter to choose between real-time and no-repaint modes?
Add visual indicators for pending vs confirmed signals?
Modify the sensitivity of the range detection?
forecasting

オープンソーススクリプト

TradingViewの精神に則り、このスクリプトの作者は、トレーダーが理解し検証できるようにオープンソースで公開しています。作者に敬意を表します!無料で使用することができますが、このコードを投稿で再利用するには、ハウスルールに準拠する必要があります。 お気に入りに登録してチャート上でご利用頂けます。

チャートでこのスクリプトを利用したいですか?

免責事項