OPEN-SOURCE SCRIPT
Zarattini Intra-day Threshold Bands (ZITB)

This indicator implements the intraday threshold band methodology described in the research paper by Carlo Zarattini et al.
Overview:
Plots intraday threshold bands based on daily open/close levels.
Supports visualization of BaseUp/BaseDown levels and Threshold Upper/Lower bands.
Optional shading between threshold bands for easier interpretation.
Usage Notes / Limitations:
Originally studied on SPY (US equities), this implementation is adapted for NSE intraday market timing, specifically the NIFTY50 index.
Internally, 2-minute candles are used if the chart timeframe is less than 2 minutes.
Values may be inaccurate if the chart timeframe is more than 1 day.
Lookback days are auto-capped to avoid exceeding TradingView’s 5000-bar limit.
The indicator automatically aligns intraday bars across multiple days to compute average deltas.
For better returns, it is recommended to use this indicator in conjunction with VWAP and a volatility-based position sizing mechanism.
Can be used as a reference for Open Range Breakout (ORB) strategies.
Customizations:
Toggle plotting of base levels and thresholds.
Toggle shading between thresholds.
Line colors and styles can be adjusted in the Style tab.
Intended for educational and research purposes only.
This indicator implements the approach described in the research paper by Zarattini et al.
Note: This implementation is designed for the NSE NIFTY50 index. While Zarattini’s original study was conducted on SPY, this version adapts the methodology for the Indian market.
Methodology Explanation
This indicator is primarily designed for Open Range Breakout (ORB) strategies.
Base Levels
BaseUp = Maximum of today’s open and previous day’s close
BaseDown = Minimum of today’s open and previous day’s close
Delta Calculation
For the past 14 trading days (lookbackDays), the delta for each intraday candle is calculated as the ab
solute difference from the close of the first candle of that day.
Average Delta
For a given intraday time/candle today, deltaAvg is computed as the average of the deltas at the same time across the previous 14 days.
Threshold Bands
ThresholdUp = BaseUp + deltaAvg
ThresholdDown = BaseDown − deltaAvg
Signals
Spot price moving above ThresholdUp → Long signal
Spot price moving below ThresholdDown → Short signal
Tip: For better returns, combine this indicator with VWAP and a volatility-based position sizing mechanism.
Overview:
Plots intraday threshold bands based on daily open/close levels.
Supports visualization of BaseUp/BaseDown levels and Threshold Upper/Lower bands.
Optional shading between threshold bands for easier interpretation.
Usage Notes / Limitations:
Originally studied on SPY (US equities), this implementation is adapted for NSE intraday market timing, specifically the NIFTY50 index.
Internally, 2-minute candles are used if the chart timeframe is less than 2 minutes.
Values may be inaccurate if the chart timeframe is more than 1 day.
Lookback days are auto-capped to avoid exceeding TradingView’s 5000-bar limit.
The indicator automatically aligns intraday bars across multiple days to compute average deltas.
For better returns, it is recommended to use this indicator in conjunction with VWAP and a volatility-based position sizing mechanism.
Can be used as a reference for Open Range Breakout (ORB) strategies.
Customizations:
Toggle plotting of base levels and thresholds.
Toggle shading between thresholds.
Line colors and styles can be adjusted in the Style tab.
Intended for educational and research purposes only.
This indicator implements the approach described in the research paper by Zarattini et al.
Note: This implementation is designed for the NSE NIFTY50 index. While Zarattini’s original study was conducted on SPY, this version adapts the methodology for the Indian market.
Methodology Explanation
This indicator is primarily designed for Open Range Breakout (ORB) strategies.
Base Levels
BaseUp = Maximum of today’s open and previous day’s close
BaseDown = Minimum of today’s open and previous day’s close
Delta Calculation
For the past 14 trading days (lookbackDays), the delta for each intraday candle is calculated as the ab
solute difference from the close of the first candle of that day.
Average Delta
For a given intraday time/candle today, deltaAvg is computed as the average of the deltas at the same time across the previous 14 days.
Threshold Bands
ThresholdUp = BaseUp + deltaAvg
ThresholdDown = BaseDown − deltaAvg
Signals
Spot price moving above ThresholdUp → Long signal
Spot price moving below ThresholdDown → Short signal
Tip: For better returns, combine this indicator with VWAP and a volatility-based position sizing mechanism.
Mã nguồn mở
Theo đúng tinh thần TradingView, người tạo ra tập lệnh này đã biến tập lệnh thành mã nguồn mở để các nhà giao dịch có thể xem xét và xác minh công năng. Xin dành lời khen tặng cho tác giả! Mặc dù bạn có thể sử dụng miễn phí, nhưng lưu ý nếu đăng lại mã, bạn phải tuân theo Quy tắc nội bộ của chúng tôi.
Gokul Ramachandran – software architect, programmer. Interested in trading and investment. Currently trading and researching strategies that can be employed in NSE.
Contact: gokul4trading@gmail.com]
LinkedIn: linkedin.com/in/gokulramachandran/
Contact: gokul4trading@gmail.com]
LinkedIn: linkedin.com/in/gokulramachandran/
Thông báo miễn trừ trách nhiệm
Thông tin và ấn phẩm không có nghĩa là và không cấu thành, tài chính, đầu tư, kinh doanh, hoặc các loại lời khuyên hoặc khuyến nghị khác được cung cấp hoặc xác nhận bởi TradingView. Đọc thêm trong Điều khoản sử dụng.
Mã nguồn mở
Theo đúng tinh thần TradingView, người tạo ra tập lệnh này đã biến tập lệnh thành mã nguồn mở để các nhà giao dịch có thể xem xét và xác minh công năng. Xin dành lời khen tặng cho tác giả! Mặc dù bạn có thể sử dụng miễn phí, nhưng lưu ý nếu đăng lại mã, bạn phải tuân theo Quy tắc nội bộ của chúng tôi.
Gokul Ramachandran – software architect, programmer. Interested in trading and investment. Currently trading and researching strategies that can be employed in NSE.
Contact: gokul4trading@gmail.com]
LinkedIn: linkedin.com/in/gokulramachandran/
Contact: gokul4trading@gmail.com]
LinkedIn: linkedin.com/in/gokulramachandran/
Thông báo miễn trừ trách nhiệm
Thông tin và ấn phẩm không có nghĩa là và không cấu thành, tài chính, đầu tư, kinh doanh, hoặc các loại lời khuyên hoặc khuyến nghị khác được cung cấp hoặc xác nhận bởi TradingView. Đọc thêm trong Điều khoản sử dụng.