OPEN-SOURCE SCRIPT
Prev TF CLOSE EMA Box (Resets Every TF)

⚙️ Key Features
✅ Custom reset timeframe (independent of chart TF)
✅ Uses previous CLOSED EMA (no lookahead)
✅ Box instead of line (clearer structure)
✅ Optional “disrespected → gray” logic
✅ Wick-based or close-based validation
✅ Works on futures, crypto, forex, equities
📈 How to Use
Treat the box as a dynamic support / resistance zone
Best used for:
Trend continuation
Mean reversion
Bias filtering (above = bullish, below = bearish)
When the box turns gray, the EMA level has lost structural validity
❗ Important Notes
This is not a signal indicator
No entries or exits are generated
Designed for context, bias, and structure
Combine with price action, liquidity, or session logic
🧩 Inputs Explained
Reset / EMA TF → timeframe used for EMA calculation & box reset
EMA Length → standard EMA length (default 9)
Box Height → thickness of the EMA zone
Disrespect Logic → optional invalidation behavior
✅ Custom reset timeframe (independent of chart TF)
✅ Uses previous CLOSED EMA (no lookahead)
✅ Box instead of line (clearer structure)
✅ Optional “disrespected → gray” logic
✅ Wick-based or close-based validation
✅ Works on futures, crypto, forex, equities
📈 How to Use
Treat the box as a dynamic support / resistance zone
Best used for:
Trend continuation
Mean reversion
Bias filtering (above = bullish, below = bearish)
When the box turns gray, the EMA level has lost structural validity
❗ Important Notes
This is not a signal indicator
No entries or exits are generated
Designed for context, bias, and structure
Combine with price action, liquidity, or session logic
🧩 Inputs Explained
Reset / EMA TF → timeframe used for EMA calculation & box reset
EMA Length → standard EMA length (default 9)
Box Height → thickness of the EMA zone
Disrespect Logic → optional invalidation behavior
Open-source script
In true TradingView spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
Disclaimer
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.
Open-source script
In true TradingView spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
Disclaimer
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.