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.
보호된 스크립트입니다
이 스크립트는 비공개 소스로 게시됩니다. 하지만 이를 자유롭게 제한 없이 사용할 수 있습니다 – 자세한 내용은 여기에서 확인하세요.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.
보호된 스크립트입니다
이 스크립트는 비공개 소스로 게시됩니다. 하지만 이를 자유롭게 제한 없이 사용할 수 있습니다 – 자세한 내용은 여기에서 확인하세요.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.