mirror of
https://github.com/mihakralj/QuanTAlib.git
synced 2026-08-20 11:38:05 +00:00
Add Yang-Zhang Volatility (YZV) Indicator Implementation
- Introduced YZV class for calculating Yang-Zhang Volatility, a comprehensive volatility measure that incorporates overnight, open-to-close, and high-low components. - Implemented calculation methods, including batch processing for TBarSeries and spans. - Added documentation for YZV, detailing its mathematical foundation, performance profile, and trading applications. - Updated volume index documentation to reflect changes in file paths. - Refactored VWMA calculation method to use a more generic source parameter instead of price.
This commit is contained in:
+1
-1
@@ -20,7 +20,7 @@ The core innovation of this indicator is its ability to measure where the "weigh
|
||||
| Parameter | Default | Function | When to Adjust |
|
||||
| ------ | ------ | ------ | ------ |
|
||||
| Length | 10 | Controls the lookback period for the Center of Gravity calculation | Increase for longer cycles and smoother signals, decrease for shorter cycles and more responsive signals |
|
||||
| Source | close | Price data used for calculation | Use close for trend-following, hlc3 for balanced representation, or hl2 for range-based analysis |
|
||||
| Source | source | Data source for calculation | Typically uses close; hlc3 provides balanced representation; hl2 for range-based analysis |
|
||||
|
||||
**Pro Tip:** The optimal length setting often correlates with the dominant cycle length in the market. Start with shorter periods (8-14) for active markets and longer periods (20-30) for smoother, longer-term cycle identification.
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ DSP serves as both a standalone cycle indicator and a foundational component for
|
||||
|
||||
| Parameter | Default | Function | When to Adjust |
|
||||
| ------ | ------ | ------ | ------ |
|
||||
| Source | hlc3 | Price data used for calculation | Use `close` for end-of-bar analysis, `hlc3` for balanced price representation |
|
||||
| Source | source | Data source for calculation | Use `close` for end-of-bar analysis, `hlc3` for balanced price representation |
|
||||
| Dominant Cycle Period | 40 | Period used to calculate quarter-cycle and half-cycle EMAs | Should match actual market cycle: 20-30 for faster cycles, 40-50 for standard, 60-80 for slower cycles |
|
||||
|
||||
**Pro Tip:** The Dominant Cycle Period should ideally be obtained from HT_DCPERIOD or other cycle measurement tools for adaptive behavior. For fixed analysis, 40 bars works well for daily charts (approximates a 2-month cycle). The quarter-cycle EMA (P/4 = 10) responds to short-term moves while the half-cycle EMA (P/2 = 20) provides the baseline, creating the band-pass effect.
|
||||
|
||||
@@ -16,7 +16,7 @@ The Ehlers Even Better Sinewave (EBSW) indicator, developed by John Ehlers, is a
|
||||
|
||||
| Parameter | Default | Function | When to Adjust |
|
||||
| --------- | ------- | -------- | -------------- |
|
||||
| Source | close | Price data used for calculation. | Typically `close`, but `hlc3` or `ohlc4` can be used for a more comprehensive price representation. |
|
||||
| Source | source | Data source for calculation. | Typically `close`, but `hlc3` or `ohlc4` can be used for a more comprehensive price representation. |
|
||||
| HP Length | 40 | Lookback period for the 1-pole High-Pass Filter used for detrending. | Shorter periods make the filter more responsive to shorter cycles; longer periods focus on longer-term cycles. Adjust based on observed cycle characteristics. |
|
||||
| SSF Length | 10 | Lookback period for the Super Smoother Filter used for smoothing the detrended cycle component. | Shorter periods result in a more responsive (but potentially noisier) wave; longer periods provide more smoothing. |
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ Unlike fixed-length filters, HOMOD continuously adapts to current market rhythm
|
||||
|
||||
| Parameter | Default | Function | When to Adjust |
|
||||
| ------ | ------ | ------ | ------ |
|
||||
| Source | hlc3 | Input series analyzed for cycle period | Switch to close for end-of-day signals or to custom synthetic blends |
|
||||
| Source | source | Data source for cycle period analysis | Switch to close for end-of-day signals or to custom synthetic blends |
|
||||
| Min Period | 6 | Lower bound for detected cycle length | Increase to ignore ultrashort noise-dominated cycles |
|
||||
| Max Period | 50 | Upper bound for detected cycle length | Raise for weekly/monthly studies; lower for intraday scalping |
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ Unlike traditional cycle detection methods that rely on fixed periods, HT_DCPERI
|
||||
|
||||
| Parameter | Default | Function | When to Adjust |
|
||||
| ------ | ------ | ------ | ------ |
|
||||
| Source | hlc3 | Price data to analyze | Use close for end-of-bar signals, hlc3 for intrabar smoothing |
|
||||
| Source | source | Data source for analysis | Use close for end-of-bar signals, hlc3 for intrabar smoothing |
|
||||
|
||||
**Pro Tip:** The indicator automatically adapts to any timeframe. On daily charts, a period of 20 indicates a 20-day cycle (about one month). On hourly charts, 20 indicates a 20-hour cycle. Consider the timeframe when interpreting the cycle length - what matters is the number of bars, not calendar time.
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ HT_DCPHASE works by computing the In-phase (I) and Quadrature (Q) components thr
|
||||
|
||||
| Parameter | Default | Function | When to Adjust |
|
||||
| ------ | ------ | ------ | ------ |
|
||||
| Source | hlc3 | Price data for analysis | Use close for simpler signals; hlc3 for smoother, more comprehensive cycle detection |
|
||||
| Source | source | Data source for analysis | Use close for simpler signals; hlc3 for smoother, more comprehensive cycle detection |
|
||||
|
||||
**Pro Tip:** HT_DCPHASE is most effective when used in conjunction with HT_DCPERIOD to understand both the cycle length and current position. Phase crossings through zero often correspond to significant trend changes. The indicator works best on instruments with clear cyclical behavior - sideways or ranging markets provide cleaner signals than strongly trending markets.
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ The phasor components represent the cycle in two-dimensional phase space, where
|
||||
|
||||
| Parameter | Default | Function | When to Adjust |
|
||||
| ------ | ------ | ------ | ------ |
|
||||
| Source | hlc3 | Price data for analysis | Use close for simpler signals; hlc3 for smoother, more comprehensive cycle detection |
|
||||
| Source | source | Data source for analysis | Use close for simpler signals; hlc3 for smoother, more comprehensive cycle detection |
|
||||
|
||||
**Pro Tip:** HT_PHASOR is primarily useful for custom indicator development and advanced cycle analysis. The I and Q components can be used to calculate amplitude (cycle strength), phase (cycle position), and instantaneous frequency. When I and Q oscillate with constant magnitude, the market is in a strong cyclical mode. When their magnitudes vary significantly, the market may be transitioning between cycle and trend modes.
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ This indicator transforms the complex phase information from Hilbert Transform a
|
||||
|
||||
| Parameter | Default | Function | When to Adjust |
|
||||
| ------ | ------ | ------ | ------ |
|
||||
| Source | hlc3 | Price data for cycle analysis | Use close for simpler signals; hlc3 for smoother, more comprehensive cycle detection |
|
||||
| Source | source | Data source for cycle analysis | Use close for simpler signals; hlc3 for smoother, more comprehensive cycle detection |
|
||||
|
||||
**Pro Tip:** Watch for crossovers between the sine and lead-sine waves as potential cycle reversal signals. When lead-sine crosses above sine near the trough (-1), it suggests an upcoming cycle bottom. When lead-sine crosses below sine near the peak (+1), it suggests an upcoming cycle top. The indicator works best in ranging or cyclical markets; strong trends can produce less reliable signals as the cycle assumption breaks down.
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ Market Applications:
|
||||
| Parameter | Default | Function | When to Adjust |
|
||||
| ------ | ------ | ------ | ------ |
|
||||
| Period | 28 | Fixed cycle period for correlation analysis | Match to expected dominant cycle length |
|
||||
| Source | Close | Price series for phase calculation | Use typical price or other smoothed series |
|
||||
| Source | source | Data source for phase calculation | Use typical price or other smoothed series |
|
||||
| Show Derived Period | false | Display calculated period from phase rate | Enable for adaptive period analysis |
|
||||
| Show Trend State | false | Display trend/cycle state variable | Enable for regime identification |
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ The indicator calculates the difference between a quarter-cycle SSF and a half-c
|
||||
|
||||
| Parameter | Default | Function | When to Adjust |
|
||||
| ------ | ------ | ------ | ------ |
|
||||
| Source | hlc3 | Price data used for calculation | hlc3 provides balanced price representation; close for directional bias |
|
||||
| Source | source | Data source for calculation | hlc3 provides balanced price representation; close for directional bias |
|
||||
| Period | 40 | Dominant cycle period in bars | Match to your identified dominant cycle (typically 20-50 bars for daily charts) |
|
||||
|
||||
**Pro Tip:** SSF-DSP provides cleaner signals than EMA-based DSP with ~1.5-2x more smoothing. If you use period=40 for regular DSP, try period=30-35 for SSF-DSP to achieve similar responsiveness with better noise rejection.
|
||||
|
||||
Reference in New Issue
Block a user