OPEN-SOURCE SCRIPT
Hardwaybets' Protected Highs / Protected Lows Trading

Protected Highs & Lows – Multi-Condition Structural Marker
This indicator identifies specific candle formations where price breaks a previous candle’s high or low, fails to maintain that break, and confirms the rejection with an additional condition involving prior candles. These marked locations offer a visual reference for areas where price attempted directional expansion but did not sustain it. All levels remain visible until later invalidated by price movement.
Protected High – Detection Logic
A Protected High is marked only when all three of the following conditions occur:
1. Break of Previous High
The current candle trades above the prior candle’s high.
2. Close Back Inside Range
The current candle closes within the high-to-low range of the previous candle, indicating the upward expansion was not sustained.
3. Reversal Through Prior Bullish Structure
After forming the high, price closes below the opening price of one or more bullish candles that were part of the upward movement into that high.
This reflects a shift away from the prior upward structure.
When all three conditions are met, the high of the candle that created the event is marked on the chart.
Protected Low – Detection Logic
A Protected Low is marked only when all three of the following conditions occur:
1. Break of Previous Low
The current candle trades below the prior candle’s low.
2. Close Back Inside Range
The current candle closes within the high-to-low range of the previous candle, indicating the downward expansion was not sustained.
3. Reversal Through Prior Bearish Structure
After forming the low, price closes above the opening price of one or more bearish candles that were part of the downward movement into that low.
This reflects a shift away from the prior downward structure.
When all three conditions are met, the low of the candle that created the event is marked on the chart.
Level Management
* Marked highs and lows remain active as long as price does not trade beyond them.
* If price moves past a marked level, that level is removed.
* Only active, unviolated structural reference points remain displayed.
Market Structure Context (Strictly Non-Signaling)
Protected highs and lows can help traders observe areas where:
* Price briefly exceeded a previous high or low
* That expansion was not maintained
* Price then moved back through recent candles associated with the prior direction
These observations can be used by traders to understand how price interacts with nearby structural reference points.
The indicator itself does not provide trade entries, exits, or directional guidance.
Customization Options
The indicator provides adjustable settings for:
* Marker style (labels or shapes)
* Shape type (circle, square, diamond, etc.)
* Colors for highs and lows
* Vertical spacing between markers and candles
These options help maintain clarity on different chart types and timeframes.
Intended Use
The indicator does not generate forecasts or trading signals.
Its purpose is to visually highlight multi-condition candle formations where price briefly exceeded a prior high or low, failed to sustain that expansion, and later reversed through nearby structural points.
Compatibility
Suitable for all assets and timeframes.
This indicator identifies specific candle formations where price breaks a previous candle’s high or low, fails to maintain that break, and confirms the rejection with an additional condition involving prior candles. These marked locations offer a visual reference for areas where price attempted directional expansion but did not sustain it. All levels remain visible until later invalidated by price movement.
Protected High – Detection Logic
A Protected High is marked only when all three of the following conditions occur:
1. Break of Previous High
The current candle trades above the prior candle’s high.
2. Close Back Inside Range
The current candle closes within the high-to-low range of the previous candle, indicating the upward expansion was not sustained.
3. Reversal Through Prior Bullish Structure
After forming the high, price closes below the opening price of one or more bullish candles that were part of the upward movement into that high.
This reflects a shift away from the prior upward structure.
When all three conditions are met, the high of the candle that created the event is marked on the chart.
Protected Low – Detection Logic
A Protected Low is marked only when all three of the following conditions occur:
1. Break of Previous Low
The current candle trades below the prior candle’s low.
2. Close Back Inside Range
The current candle closes within the high-to-low range of the previous candle, indicating the downward expansion was not sustained.
3. Reversal Through Prior Bearish Structure
After forming the low, price closes above the opening price of one or more bearish candles that were part of the downward movement into that low.
This reflects a shift away from the prior downward structure.
When all three conditions are met, the low of the candle that created the event is marked on the chart.
Level Management
* Marked highs and lows remain active as long as price does not trade beyond them.
* If price moves past a marked level, that level is removed.
* Only active, unviolated structural reference points remain displayed.
Market Structure Context (Strictly Non-Signaling)
Protected highs and lows can help traders observe areas where:
* Price briefly exceeded a previous high or low
* That expansion was not maintained
* Price then moved back through recent candles associated with the prior direction
These observations can be used by traders to understand how price interacts with nearby structural reference points.
The indicator itself does not provide trade entries, exits, or directional guidance.
Customization Options
The indicator provides adjustable settings for:
* Marker style (labels or shapes)
* Shape type (circle, square, diamond, etc.)
* Colors for highs and lows
* Vertical spacing between markers and candles
These options help maintain clarity on different chart types and timeframes.
Intended Use
The indicator does not generate forecasts or trading signals.
Its purpose is to visually highlight multi-condition candle formations where price briefly exceeded a prior high or low, failed to sustain that expansion, and later reversed through nearby structural points.
Compatibility
Suitable for all assets and timeframes.
오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.
오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.