Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,7 @@ jobs:
env:
CIBW_TEST_COMMAND: >
cd .. &&
python -c "import talib; assert talib._ta_lib._ta_get_runtime_info('vmath.transcendental') == 1, 'TA-Lib C is not using vForce'" &&
pytest -k "not RSI and not threading" {project}/tests
CIBW_ARCHS_MACOS: arm64
CIBW_ENVIRONMENT_MACOS : >
Expand Down
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -446,6 +446,13 @@ Functions marked in the docs as having an unstable period start with that
extra unstable-period setting at `0`. In other words, `get_unstable_period()`
returns `0` until you explicitly change it with `set_unstable_period()`.

Instead of a count, `set_unstable_period()` also takes an Auto level. With
`talib.set_unstable_period('ALL', talib.UNSTABLE_AUTO_PREC_4)` each function
works out how many leading values to discard, so that the first 4 significant
digits of what it returns no longer depend on where your data starts;
`UNSTABLE_AUTO_PREC_8` targets 8. `get_unstable_period()` then returns the
level. See [Unstable Period](https://ta-lib.org/api/unstable-period/#auto).

### NaN's

The underlying TA-Lib C library handles NaN's in a sometimes surprising manner
Expand Down Expand Up @@ -539,7 +546,8 @@ slowk, slowd = STOCH(inputs, 5, 3, 0, 3, 0, prices=['high', 'low', 'open'])
The Streaming API keeps a handle per indicator instead of recomputing from the
whole array. Opening one costs a pass over the history; every bar after that is
O(1), and each value it produces is identical to the one the Function API
reports for that bar.
reports for that bar. On Apple Silicon macOS, a function using a transcendental
math function (SIN, EXP, LN, ...) may differ from it in the last bits.

```python
import talib
Expand Down
7 changes: 7 additions & 0 deletions docs/func.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,13 @@ Functions documented as having an unstable period start with that extra
unstable-period setting at ``0``. ``get_unstable_period()`` only returns a
non-zero value after you set one explicitly with ``set_unstable_period()``.

Instead of a count, ``set_unstable_period()`` also takes an Auto level. With
``talib.set_unstable_period('ALL', talib.UNSTABLE_AUTO_PREC_4)`` each function
works out how many leading values to discard, so that the first 4 significant
digits of what it returns no longer depend on where your data starts;
``UNSTABLE_AUTO_PREC_8`` targets 8. ``get_unstable_period()`` then returns the
level. See [Unstable Period](https://ta-lib.org/api/unstable-period/#auto).

Documentation for all functions:

* [Overlap Studies](func_groups/overlap_studies.md)
Expand Down
18 changes: 18 additions & 0 deletions docs/func_groups/cycle_indicators.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,24 @@ NOTE: The ``HT_TRENDMODE`` function has an unstable period.
integer = HT_TRENDMODE(close)
```

### SWAK_2PHP - Swiss Army Knife - Two-Pole High-Pass Filter
NOTE: The ``SWAK_2PHP`` function has an unstable period.
```python
real = SWAK_2PHP(close, timeperiod=20)
```

### SWAK_BP - Swiss Army Knife - Band-Pass Filter
NOTE: The ``SWAK_BP`` function has an unstable period.
```python
real = SWAK_BP(close, timeperiod=20, delta=0.1)
```

### SWAK_HP - Swiss Army Knife - High-Pass Filter
NOTE: The ``SWAK_HP`` function has an unstable period.
```python
real = SWAK_HP(close, timeperiod=20)
```


[Documentation Index](../doc_index.md)
[FLOAT_RIGHTAll Function Groups](../funcs.md)
82 changes: 82 additions & 0 deletions docs/func_groups/momentum_indicators.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@ aroondown, aroonup = AROON(high, low, timeperiod=14)
real = AROONOSC(high, low, timeperiod=14)
```

### ASI - Wilder Accumulative Swing Index
```python
real = ASI(open, high, low, close, limitmove=3)
```

### BOP - Balance Of Power
```python
real = BOP(open, high, low, close)
Expand All @@ -45,6 +50,21 @@ real = BOP(open, high, low, close)
real = CCI(high, low, close, timeperiod=14)
```

### CG - Center of Gravity Oscillator
```python
real = CG(close, timeperiod=10)
```

### CHOP - Choppiness Index
```python
real = CHOP(high, low, close, timeperiod=14)
```

### CHOPTR - Choppiness Index (True Range Box)
```python
real = CHOPTR(high, low, close, timeperiod=14)
```

### CMO - Chande Momentum Oscillator
NOTE: The ``CMO`` function has an unstable period.
```python
Expand All @@ -61,6 +81,21 @@ real = CMOU(close, timeperiod=14)
real = COPPOCK(close, wmaperiod=10, roc1period=11, roc2period=14)
```

### CRSI - Connors Relative Strength Index
```python
real = CRSI(close, timeperiod=3, streakperiod=2, rankperiod=100)
```

### CTI - Correlation Trend Indicator
```python
real = CTI(close, timeperiod=20)
```

### DOSC - Derivative Oscillator
```python
real = DOSC(close, timeperiod=14, firstperiod=5, secondperiod=3, signalperiod=9)
```

### DPO - Detrended Price Oscillator
```python
real = DPO(close, timeperiod=20)
Expand All @@ -82,6 +117,12 @@ real = ER(close, timeperiod=10)
bullpower, bearpower = ERI(high, low, close, timeperiod=13)
```

### FISHER - Fisher Transform
NOTE: The ``FISHER`` function has an unstable period.
```python
fisher, trigger = FISHER(high, low, timeperiod=10)
```

### FOSC - Forecast Oscillator
```python
real = FOSC(close, timeperiod=5)
Expand All @@ -92,6 +133,11 @@ real = FOSC(close, timeperiod=5)
swinghigh, swinglow = FRACTAL(high, low, leftbars=2, rightbars=2)
```

### IBS - Internal Bar Strength
```python
real = IBS(high, low, close)
```

### IMI - Intraday Momentum Index
```python
real = IMI(open, close, timeperiod=14)
Expand All @@ -102,6 +148,16 @@ real = IMI(open, close, timeperiod=14)
k, d, j = KDJ(high, low, close, fastk_period=9, slowk_period=3, slowk_matype=13, slowd_period=3, slowd_matype=13)
```

### KST - Know Sure Thing (Pring)
```python
kst, kstsignal = KST(close, roc1period=10, roc2period=15, roc3period=20, roc4period=30, sma1period=10, sma2period=10, sma3period=10, sma4period=15, signalperiod=9)
```

### KSTEXT - Know Sure Thing with controllable MA type
```python
kst, kstsignal = KSTEXT(close, roc1period=10, roc2period=15, roc3period=20, roc4period=30, ma1period=10, ma2period=10, ma3period=10, ma4period=15, signalperiod=9, rocmatype=0, signalmatype=0)
```

### MACD - Moving Average Convergence/Divergence
```python
macd, macdsignal, macdhist = MACD(close, fastperiod=12, slowperiod=26, signalperiod=9)
Expand Down Expand Up @@ -156,6 +212,11 @@ real = PLUS_DM(high, low, timeperiod=14)
real = PPO(close, fastperiod=12, slowperiod=26, matype=1)
```

### PSO - Premier Stochastic Oscillator
```python
real = PSO(high, low, close, fastk_period=8, emaperiod=5)
```

### QSTICK - Qstick
```python
real = QSTICK(open, close, timeperiod=10)
Expand Down Expand Up @@ -187,11 +248,27 @@ NOTE: The ``RSI`` function has an unstable period.
real = RSI(close, timeperiod=14)
```

### SI - Wilder Swing Index
```python
real = SI(open, high, low, close, limitmove=3)
```

### SMI - Stochastic Momentum Index
```python
smi, smisignal = SMI(high, low, close, timeperiod=13, fastperiod=2, slowperiod=25, signalperiod=9)
```

### SQZMOM - Squeeze Momentum and Level
```python
momentum, squeeze = SQZMOM(high, low, close, bbperiod=20, nbdev=2, kcperiod=20, factorwide=2, factornormal=1.5, factornarrow=1)
```

### STC - Schaff Trend Cycle
NOTE: The ``STC`` function has an unstable period.
```python
real = STC(close, fastperiod=23, slowperiod=50, cycleperiod=10)
```

### STOCH - Stochastic
NOTE: `slowk_matype` and `slowd_matype` take an `MA_Type` value. See [STOCH](https://ta-lib.org/functions/stoch) for the formula.
```python
Expand Down Expand Up @@ -238,6 +315,11 @@ plusvi, minusvi = VORTEX(high, low, close, timeperiod=14)
real = WAD(high, low, close)
```

### WAVETREND - WaveTrend Oscillator
```python
wt1, wt2 = WAVETREND(high, low, close, channelperiod=10, averageperiod=21, signalperiod=4)
```

### WILLR - Williams' %R
```python
real = WILLR(high, low, close, timeperiod=14)
Expand Down
50 changes: 50 additions & 0 deletions docs/func_groups/overlap_studies.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,21 @@
upperband, middleband, lowerband = ACCBANDS(high, low, close, timeperiod=20)
```

### ALMA - Arnaud Legoux Moving Average
```python
real = ALMA(close, timeperiod=9, sigma=6, offset=0.85)
```

### BBANDS - Bollinger Bands
```python
upperband, middleband, lowerband = BBANDS(close, timeperiod=20, nbdevup=2, nbdevdn=2, matype=0)
```

### CKSP - Chande Kroll Stop
```python
highstop, lowstop = CKSP(high, low, close, timeperiod=10, multiplier=1, stopperiod=9)
```

### DEMA - Double Exponential Moving Average
```python
real = DEMA(close, timeperiod=30)
Expand All @@ -25,6 +35,12 @@ NOTE: The ``EMA`` function has an unstable period.
real = EMA(close, timeperiod=30)
```

### FRAMA - Fractal Adaptive Moving Average
NOTE: The ``FRAMA`` function has an unstable period.
```python
real = FRAMA(high, low, timeperiod=16)
```

### HMA - Hull Moving Average
```python
real = HMA(close, timeperiod=20)
Expand All @@ -36,6 +52,11 @@ NOTE: The ``HT_TRENDLINE`` function has an unstable period.
real = HT_TRENDLINE(close)
```

### ICHIMOKU - Ichimoku Kinko Hyo
```python
tenkansen, kijunsen, senkouspana, senkouspanb = ICHIMOKU(high, low, tenkanperiod=9, kijunperiod=26, senkoubperiod=52)
```

### KAMA - Kaufman Adaptive Moving Average
NOTE: The ``KAMA`` function has an unstable period.
```python
Expand Down Expand Up @@ -63,6 +84,12 @@ mama, fama = MAMA(close, fastlimit=0, slowlimit=0)
real = MAVP(close, periods, minperiod=2, maxperiod=30, matype=0)
```

### MCGD - McGinley Dynamic
NOTE: The ``MCGD`` function has an unstable period.
```python
real = MCGD(close, timeperiod=14)
```

### MIDPOINT - MidPoint over period
```python
real = MIDPOINT(close, timeperiod=14)
Expand Down Expand Up @@ -99,6 +126,18 @@ real = SMA(close, timeperiod=30)
supertrend, trend = SUPERTREND(high, low, close, timeperiod=10, multiplier=3)
```

### SWAK_BUTTER - Swiss Army Knife - Butterworth Filter
NOTE: The ``SWAK_BUTTER`` function has an unstable period.
```python
real = SWAK_BUTTER(close, timeperiod=20)
```

### SWAK_GAUSS - Swiss Army Knife - Gaussian Filter
NOTE: The ``SWAK_GAUSS`` function has an unstable period.
```python
real = SWAK_GAUSS(close, timeperiod=20)
```

### T3 - Triple Exponential Moving Average (T3)
NOTE: The ``T3`` function has an unstable period.
```python
Expand All @@ -115,6 +154,12 @@ real = TEMA(close, timeperiod=30)
real = TRIMA(close, timeperiod=30)
```

### VIDYA - Variable Index Dynamic Average
NOTE: The ``VIDYA`` function has an unstable period.
```python
real = VIDYA(close, timeperiod=12, cmoperiod=9)
```

### VWMA - Volume Weighted Moving Average
```python
real = VWMA(close, volume, timeperiod=30)
Expand All @@ -125,6 +170,11 @@ real = VWMA(close, volume, timeperiod=30)
real = WMA(close, timeperiod=30)
```

### ZIGZAG - Zig Zag
```python
zigzag, trend, pivotidx = ZIGZAG(high, low, sensitivity=5, mintrendlength=1)
```

### ZLEMA - Zero-Lag Exponential Moving Average
```python
real = ZLEMA(close, timeperiod=30)
Expand Down
12 changes: 11 additions & 1 deletion docs/func_groups/statistic_functions.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ real = BETA(high, low, timeperiod=5)
real = CORREL(high, low, timeperiod=30)
```

### KURTOSIS - Rolling Excess Kurtosis
```python
real = KURTOSIS(close, timeperiod=30)
```

### LINEARREG - Linear Regression
```python
real = LINEARREG(close, timeperiod=14)
Expand All @@ -29,9 +34,14 @@ real = LINEARREG_INTERCEPT(close, timeperiod=14)
real = LINEARREG_SLOPE(close, timeperiod=14)
```

### MEDIAN - Rolling Median
```python
real = MEDIAN(close, timeperiod=30)
```

### PERCENTILE - Percentile (nearest rank)
```python
real = PERCENTILE(close, timeperiod=30, percentile=50)
real = PERCENTILE(close, timeperiod=100, percentile=50)
```

### PERCENTRANK - Percent Rank
Expand Down
20 changes: 20 additions & 0 deletions docs/func_groups/volatility_indicators.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ NOTE: The ``ATR`` function has an unstable period.
real = ATR(high, low, close, timeperiod=14)
```

### BBW - Bollinger BandWidth
```python
real = BBW(close, timeperiod=20, nbdevup=2, nbdevdn=2, matype=0)
```

### CVI - Chaikin's Volatility
```python
real = CVI(high, low, timeperiod=10, rocperiod=10)
Expand All @@ -26,12 +31,27 @@ NOTE: The ``NATR`` function has an unstable period.
real = NATR(high, low, close, timeperiod=14)
```

### PERCENTB - Bollinger Bands %B
```python
real = PERCENTB(close, timeperiod=20, nbdevup=2, nbdevdn=2, matype=0)
```

### ROGERSSATCHELL - Rogers-Satchell Volatility
```python
real = ROGERSSATCHELL(open, high, low, close, timeperiod=10, annualization=252)
```

### RVI - Relative Volatility Index
NOTE: The ``RVI`` function has an unstable period.
```python
real = RVI(close, timeperiod=14, stddevperiod=10)
```

### RVIR - Relative Volatility Index, refined high/low form
```python
real = RVIR(high, low, timeperiod=14, stddevperiod=10)
```

### TRANGE - True Range
```python
real = TRANGE(high, low, close)
Expand Down
Loading
Loading