mirror of
https://github.com/mihakralj/QuanTAlib.git
synced 2026-08-23 04:58:08 +00:00
validation and profiles
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
# RVGI: Relative Vigor Index
|
||||
# RVGI: Relative Vigor Index
|
||||
|
||||
The Relative Vigor Index measures the conviction of a price move by comparing closing strength (close minus open) to the total intrabar range (high minus low), smoothed through a symmetrically weighted moving average and then averaged over a lookback period. The premise is that in bullish markets, closes tend to occur near highs and opens near lows, producing positive RVGI values, while bearish markets show the opposite pattern. A 4-bar SWMA signal line provides crossover triggers. The indicator oscillates around zero with no fixed bounds.
|
||||
|
||||
@@ -52,6 +52,43 @@ $$Signal_t = \frac{RVGI_{t-3} + 2 \cdot RVGI_{t-2} + 2 \cdot RVGI_{t-1} + RVGI_t
|
||||
|
||||
**Default parameters:** period = 10.
|
||||
|
||||
## Performance Profile
|
||||
|
||||
### Operation Count (Streaming Mode)
|
||||
|
||||
RVGI (Relative Vigor Index) computes a symmetrically-weighted sum of body changes (4-bar) divided by range changes, then smooths with a SMA-like signal line.
|
||||
|
||||
| Operation | Count | Cost (cycles) | Subtotal |
|
||||
| :--- | :---: | :---: | :---: |
|
||||
| Body/range weighted numerator (4 FMAs) | 4 | 4 | 16 |
|
||||
| Body/range weighted denominator (4 FMAs) | 4 | 4 | 16 |
|
||||
| DIV (numerator/denominator) | 1 | 15 | 15 |
|
||||
| RingBuffer updates × 2 (num, denom) | 4 | 1 | 4 |
|
||||
| Signal line (4-tap weighted avg) | 4 | 3 | 12 |
|
||||
| CMP (denom > 0 guard) | 1 | 1 | 1 |
|
||||
| **Total** | **18** | — | **~64 cycles** |
|
||||
|
||||
~64 cycles per bar. Two simultaneous 4-tap FIR convolutions + a division.
|
||||
|
||||
### Batch Mode (SIMD Analysis)
|
||||
|
||||
| Operation | Vectorizable? | Notes |
|
||||
| :--- | :---: | :--- |
|
||||
| 4-tap weighted sums (FIR) | Yes | VDPPS / manual dot product with VFMADD |
|
||||
| Division | Yes | VDIVPD |
|
||||
| Signal line (4-tap FIR) | Yes | Same FIR pattern |
|
||||
|
||||
Fully vectorizable — no recursive dependencies. AVX2 achieves ~4× throughput.
|
||||
|
||||
### Quality Metrics
|
||||
|
||||
| Metric | Score | Notes |
|
||||
| :--- | :---: | :--- |
|
||||
| **Accuracy** | 9/10 | Symmetric weighting reduces endpoint bias |
|
||||
| **Timeliness** | 7/10 | 4-bar FIR window + 4-bar signal = 8-bar warmup only |
|
||||
| **Smoothness** | 7/10 | Symmetric FIR provides gentle smoothing |
|
||||
| **Noise Rejection** | 7/10 | Weighted averaging suppresses tick noise |
|
||||
|
||||
## Resources
|
||||
|
||||
- Ehlers, J.F. (2002). *Rocket Science for Traders*. Wiley, Chapter 12
|
||||
|
||||
Reference in New Issue
Block a user