PROTECTED SOURCE SCRIPT
OTP - 1HR ZONES v3

OTP - 1HR ZONES v3
My understanding of the changes you want (without breaking what’s already working)
You’re saying the current “BASE” logic is correctly finding your winning-trade zones, so we must not change the core displacement definition (body vs avg * multiplier + prior candle wick-to-wick). The tweaks you want are:
Stop the “candle after” problem
When a displacement candle prints, the zone must be drawn on the PRIOR candle (the origin candle), not shifted onto the next candle/bar.
Practically: the box needs to be anchored to the prior 1H candle’s time window, not the current bar_index.
Reduce “too many zones” without changing the core detection
You want fewer boxes, but without tightening the displacement logic (since it’s already catching winners).
Best non-disruptive filter: only create zones once per 1H candle close (prevents duplicates/spam on 5m/15m charts), and optionally filter by a session window (like your trading hours).
Make it work cleanly on 5m/15m
Right now on lower timeframes it can “spam” because the HTF values repeat on each LTF candle.
Fix: only fire on the moment the 1H candle closes, and draw the zone using bar_time of the prior 1H candle, so it’s always placed correctly.
That’s what the script below does.
READ BELOW:
What you should set first (so you don’t disrupt winners)
Leave displacementMult = 1.5 and Avg Body Length = 20 as-is.
Turn Filter zones by session? ON only if you want to cut noise fast.
If your true window is 9–11am, set Session to 0900-1100.
If it’s 6–10, leave 0600-1000.
My understanding of the changes you want (without breaking what’s already working)
You’re saying the current “BASE” logic is correctly finding your winning-trade zones, so we must not change the core displacement definition (body vs avg * multiplier + prior candle wick-to-wick). The tweaks you want are:
Stop the “candle after” problem
When a displacement candle prints, the zone must be drawn on the PRIOR candle (the origin candle), not shifted onto the next candle/bar.
Practically: the box needs to be anchored to the prior 1H candle’s time window, not the current bar_index.
Reduce “too many zones” without changing the core detection
You want fewer boxes, but without tightening the displacement logic (since it’s already catching winners).
Best non-disruptive filter: only create zones once per 1H candle close (prevents duplicates/spam on 5m/15m charts), and optionally filter by a session window (like your trading hours).
Make it work cleanly on 5m/15m
Right now on lower timeframes it can “spam” because the HTF values repeat on each LTF candle.
Fix: only fire on the moment the 1H candle closes, and draw the zone using bar_time of the prior 1H candle, so it’s always placed correctly.
That’s what the script below does.
READ BELOW:
What you should set first (so you don’t disrupt winners)
Leave displacementMult = 1.5 and Avg Body Length = 20 as-is.
Turn Filter zones by session? ON only if you want to cut noise fast.
If your true window is 9–11am, set Session to 0900-1100.
If it’s 6–10, leave 0600-1000.
保護スクリプト
このスクリプトのソースコードは非公開で投稿されています。 ただし、制限なく自由に使用できます – 詳細はこちらでご確認ください。
免責事項
この情報および投稿は、TradingViewが提供または推奨する金融、投資、トレード、その他のアドバイスや推奨を意図するものではなく、それらを構成するものでもありません。詳細は利用規約をご覧ください。
保護スクリプト
このスクリプトのソースコードは非公開で投稿されています。 ただし、制限なく自由に使用できます – 詳細はこちらでご確認ください。
免責事項
この情報および投稿は、TradingViewが提供または推奨する金融、投資、トレード、その他のアドバイスや推奨を意図するものではなく、それらを構成するものでもありません。詳細は利用規約をご覧ください。