All indicators

Yang-Zhang Estimator

By LuxAlgoJun 5, 2026

Yang-Zhang Estimator is an indicator on Vela, our next-generation charting platform, written in Pine Script®.

Static chart image

Yang-Zhang Estimator is the definitive clean build of the Yang-Zhang estimator, the OHLC realized-volatility measure that handles opening gaps and drift at once. Overnight and open-to-close log returns feed two sample variances over the window, a Rogers-Satchell range term supplies the third component, and the three combine under the paper's weight k = 0.34 / (1.34 + (n + 1) / (n - 1)) and annualize into a percentage. The line draws with a gradient fill, a dashed threshold marks your reference level, and a slower comparison estimate can overlay for regime work.

How to Trade the Yang-Zhang Estimator?

  • Threshold crosses: the estimate crossing above the Threshold Level marks entry into your defined high-volatility regime; crossing back below marks normalization.
  • Expansion / contraction: the primary estimate crossing above the slower comparison estimate signals volatility expanding; crossing below, contracting.
  • Component read: the optional component plots show where the volatility lives. On 24/7 markets the overnight term sits near zero.

It is a sizing and regime instrument, not a directional signal.

Yang-Zhang Estimator Settings

  • Window Length (default 20): bars n in the estimation window; shorter tracks regime shifts faster but jumps more.
  • Bars per Year (default 252): annualization factor, matched to the symbol's clock.
  • Show Comparison Window (default off) and Comparison Length (default 60): the second, slower estimate behind the expansion/contraction alerts.
  • Show Threshold (default on) and Threshold Level (%) (default 20): the dashed reference line and its level.
  • Show Components (default off): plots the annualized overnight, open-to-close and Rogers-Satchell components separately.

Frequently Asked Questions

Free to use

Run it on Vela. Go further with a paid plan.

  • Up to 500 Custom Alerts, with webhook automation
  • Up to 10× the chart history of Free
  • Orderflow lookback up to full history
  • More Quant usage to customize it, plus extra usage when you need it
  • Futures data alongside crypto, stocks, forex and commodities
See plans
Original indicatorBuilt in-house by LuxAlgo

Run it on Vela. Make it yours with Quant.

Open this indicator free on Vela, our next-generation charting platform. Then ask Quant, our coding agent built into Vela, to retune it or turn it into a backtested strategy of your own.