Derivative Oscillator (DOSC)
Summary
Derivative Oscillator: Wilder's RSI, smoothed by two exponential averages in series, with a simple average of that smoothed line subtracted from it. Constance Brown's reading is that the RSI's own swings are too noisy to time with, so she smooths it twice and then plots the distance from its own average as a histogram — MACD's histogram construction, applied to a smoothed RSI rather than to price. The result is in RSI points, centred on zero: crossings of the zero line mark the turn, and the height measures how far the smoothed RSI has run from its mean.
Formula
RSI = RSI(inReal, timePeriod) (Wilder, SMA-seeded)
S1 = EMA(RSI, firstPeriod)
DS = EMA(S1, secondPeriod)
DOSC = DS - SMA(DS, signalPeriod)
Notes
- Every stage is a function TA-Lib already ships, and the output is identical, bit for bit, to
TA_RSIfollowed by twoTA_EMAcalls, aTA_SMAand aTA_SUB. That chain takes five calls and their intermediate buffers; this computes it in one pass without materialising them. - Each exponential average is seeded with a simple average of its own first inputs, the same seeding TA-Lib's EMA uses, and the second seeds on what the first publishes.
TA_SetUnstablePeriodon eitherTA_FUNC_UNST_RSIorTA_FUNC_UNST_EMAdiscards more of that warm-up, and the EMA setting counts twice because there are two exponential stages. Implementations seeding each stage from a single first sample differ over the transient and agree once it decays. - The degenerate reading is whatever
TA_RSIanswers when neither a gain nor a loss has been seen since the seed. Some other implementations answer 100 there and will disagree over that stretch. - The periods are independent: no ordering between the two smoothing periods is required or checked. Swapping them changes the outputs, most at the start: each average is seeded on its own inputs, and that difference decays to rounding level. A signal period of 1 would make the output identically zero, so the minimum is 2.
Inputs
inReal— Input series, usually the close
Outputs
outReal— Derivative Oscillator, in RSI points, centred on zero
Parameters
| Parameter | Type | Default | Accepted values | Description |
|---|---|---|---|---|
optInTimePeriod | integer | 14 | 2–100000 | Period of the RSI |
optInFirstPeriod | integer | 5 | 2–100000 | Period of the first smoothing, applied to the RSI |
optInSecondPeriod | integer | 3 | 2–100000 | Period of the second smoothing, applied to the first |
optInSignalPeriod | integer | 9 | 2–100000 | Period of the simple average subtracted from the smoothed line |
Properties
Numerical Stability: Initial Unstable Period — Inherited from EMA and RSI, which DOSC computes internally; tunable via EMA and RSI's unstable period.
| ☐ Overlap Input |
| ✅ Independent Y-Axis i |
| ☐ Candlestick |
| ☐ Can Output NaN or ±Inf |
| ☐ Identity at Period 1 |
| ☐ Display Shift |
| ☐ Uses Transcendental |
Implementation
TA-Lib Definition: dosc.c · dosc.yaml
| Native | File |
|---|---|
| C | ta_DOSC.c |
| Rust | dosc.rs |
| Java | Core_DOSC.java |
| C# | Core_DOSC.cs |
TA-Lib is also available for Python, R and more using a wrapper.
Aliases
derivative oscillator
See Also
References
- Constance M. Brown, "The Derivative Oscillator: A New Approach for an Old Problem", MTA Journal (Market Technicians Association), Issue 42, Winter 1993-Spring 1994, pp. 45-55 and 61