validation and profiles

This commit is contained in:
Miha Kralj
2026-02-26 22:02:52 -08:00
parent 9ab37c1200
commit 8a1ba95173
317 changed files with 18704 additions and 622 deletions
+35 -1
View File
@@ -1,4 +1,4 @@
# DOSC: Derivative Oscillator
# DOSC: Derivative Oscillator
The Derivative Oscillator applies a four-stage signal processing pipeline to extract momentum inflection points: RSI via Wilder's smoothing, double EMA smoothing of the RSI, an SMA signal line of the double-smoothed result, and finally the difference between the smoothed RSI and its signal. The histogram output crosses zero at momentum turning points, offering earlier signals than raw RSI by isolating the rate of change of the smoothed momentum rather than the momentum level itself.
@@ -52,6 +52,40 @@ $$DOSC_t = E_2(t) - S(t)$$
**Default parameters:** rsiPeriod = 14, ema1Period = 5, ema2Period = 3, signalPeriod = 9.
## Performance Profile
### Operation Count (Streaming Mode)
Detrended Oscillator subtracts a shifted (N/2+1) SMA from current price.
| Operation | Count | Cost (cycles) | Subtotal |
| :--- | :---: | :---: | :---: |
| RingBuffer add + oldest sub (SMA sum) | 2 | 1 | 2 |
| MUL × 1/N (SMA) | 1 | 3 | 3 |
| RingBuffer read (shift N/2+1 bars back) | 1 | 1 | 1 |
| SUB (price shifted SMA) | 1 | 1 | 1 |
| **Total** | **5** | — | **~7 cycles** |
One of the cheapest oscillators: ~7 cycles per bar.
### Batch Mode (SIMD Analysis)
| Operation | Vectorizable? | Notes |
| :--- | :---: | :--- |
| Rolling SMA | Yes | Prefix-sum subtract-lag; VADDPD/VSUBPD |
| Shift and subtraction | Yes | Array offset read + VSUBPD |
Fully SIMD-vectorizable. AVX2 achieves near-4× throughput.
### Quality Metrics
| Metric | Score | Notes |
| :--- | :---: | :--- |
| **Accuracy** | 10/10 | Exact SMA arithmetic |
| **Timeliness** | 7/10 | N/2 shift is the dominant lag |
| **Smoothness** | 6/10 | No built-in smoothing of the oscillator output |
| **Noise Rejection** | 5/10 | Sensitive to bar-level noise without external smoothing |
## Resources
- Brown, C. (1994). *Technical Analysis for the Trading Professional*. McGraw-Hill