Repository navigation
Behavior changes
Five indicators now follow their published definitions and match TA-Lib 0.8.3. Their output values change, and four of them produce their first value on a different bar. Results computed with earlier versions will not match.
| Indicator | What changed | First value (default periods) | Issue |
|---|---|---|---|
trend.Cci |
The mean deviation measures every typical price in the window against the current SMA, instead of each bar's own SMA. | bar 38 → bar 19 (IdlePeriod is now Period - 1) |
#521 |
trend.Dpo |
Now Close[t − k] − SMA[t] instead of Close[t] − SMA[t − k], with k = Period/2 + 1. |
bar 30 → bar 19 (IdlePeriod is now max(Period - 1, k)) |
#522 |
momentum.EhlersFisher |
The extra * 0.5 factor is removed, which roughly doubles the values. Value1 is set to ±0.999 once it passes ±0.99, instead of being clamped at ±0.999. |
unchanged | #523 |
momentum.ConnorsRsi |
The percent rank compares the ROC with the 100 preceding values instead of 99. | bar 100 → bar 101 | #524 |
trend.Stc |
Each stochastic pass is smoothed exponentially with factor 2 / (DPeriod + 1) (0.5 with the default DPeriod of 3), instead of with an SMA. The MACD's fast EMA is seeded on the slow EMA's first bar, as in TA-Lib. |
bar 71 → bar 67 | #525 |
API change in trend.Stc
The exported Stc.Stochastic and Stc.Apo fields are removed and replaced by Stc.FastEma and Stc.SlowEma. Code that reads or sets the removed fields no longer compiles. NewStc and NewStcWithPeriod keep their signatures. The DPeriod argument now sets the smoothing factor instead of a %D SMA period.
TA-Lib comparison
The new internal/talibcompat test package (#536) compares indicators against TA-Lib reference output in CI. Remaining known differences from TA-Lib are tracked in #520 and #526–#535.
What's Changed
- Compare indicators against TA-Lib reference data by @cinar in #536
- Fix CCI, DPO, Ehlers Fisher, Connors RSI and STC to match their definitions by @cinar in #537
Full Changelog: v2.1.45...v2.1.46