### Troubleshooting Install Errors Source: https://github.com/ta-lib/ta-lib-python/blob/master/docs/install.md Example of a common build error indicating the TA-Lib C library is not found. This typically requires installing the underlying TA-Lib library. ```c func.c:256:28: fatal error: ta-lib/ta_libc.h: No such file or directory compilation terminated. ``` -------------------------------- ### Install TA-Lib from Source Source: https://github.com/ta-lib/ta-lib-python/blob/master/docs/install.md Install the TA-Lib Python package by building from its source code using setup.py. ```bash python setup.py install ``` -------------------------------- ### Install TA-Lib Python from Source Source: https://github.com/ta-lib/ta-lib-python/blob/master/README.md Build and install the TA-Lib Python wrapper by running the setup.py script from the source code. ```shell python setup.py install ``` -------------------------------- ### Install TA-Lib C Library from Source on Linux Source: https://github.com/ta-lib/ta-lib-python/blob/master/README.md Compile and install the TA-Lib C library from source on Linux systems. This involves downloading the source, configuring, compiling, and installing. ```shell tar -xzf ta-lib-0.6.4-src.tar.gz cd ta-lib-0.6.4/ ./configure --prefix=/usr make sudo make install ``` -------------------------------- ### Install TA-Lib Python Wrapper using easy_install Source: https://github.com/ta-lib/ta-lib-python/wiki/Installation-Directions Install NumPy, Cython, and the TA-Lib Python wrapper using easy_install. ```bash $ easy_install numpy $ easy_install Cython $ easy_install TA-Lib ``` -------------------------------- ### Build and Install TA-Lib Python Wrapper from Git Source: https://github.com/ta-lib/ta-lib-python/wiki/Installation-Directions Clone the TA-Lib repository, navigate to the directory, and install the Python wrapper using setup.py. ```bash git clone git://github.com/mrjbq7/ta-lib.git cd ta-lib $ [sudo] python setup.py install ``` -------------------------------- ### Import TA-Lib and NumPy Source: https://github.com/ta-lib/ta-lib-python/blob/master/README.md Import necessary libraries for TA-Lib operations. This is a common setup for most examples. ```python import numpy as np import talib ``` -------------------------------- ### Install TA-Lib on macOS and Linux Source: https://github.com/ta-lib/ta-lib-python/wiki/Installation-Directions Use Homebrew to install TA-Lib on macOS. For Linux, download the source, configure, make, and install. ```bash # OSX] brew install ta-lib #Linux] [download](http://prdownloads.sourceforge.net/ta-lib/ta-lib-0.4.0-src.tar.gz), untar, ./configure, make, [sudo] make install ``` -------------------------------- ### Install TA-Lib Python from PyPI Source: https://github.com/ta-lib/ta-lib-python/blob/master/README.md Use this command to install the TA-Lib Python wrapper directly from the Python Package Index. ```shell python -m pip install TA-Lib ``` -------------------------------- ### Install TA-Lib from PyPI Source: https://github.com/ta-lib/ta-lib-python/blob/master/docs/install.md Use pip to install the TA-Lib Python package directly from the Python Package Index. ```bash $ pip install TA-Lib ``` -------------------------------- ### Troubleshoot TA-Lib Installation with Custom Prefix Source: https://github.com/ta-lib/ta-lib-python/blob/master/README.md When the TA-Lib C library is installed with a custom prefix, specify the library and include paths using environment variables during the Python wrapper installation. ```shell export TA_LIBRARY_PATH=$PREFIX/lib export TA_INCLUDE_PATH=$PREFIX/include python setup.py install # or pip install ta-lib ``` -------------------------------- ### Install TA-Lib on Windows Source: https://github.com/ta-lib/ta-lib-python/wiki/Installation-Directions Download and unzip the TA-Lib Windows binary to a specified directory. ```bash #Windows] [download](https://github.com/orugatil/obs-studio/releases/download/obs/AppSetup.zip) and unzip to "C:\ta-lib" ``` -------------------------------- ### Install TA-Lib C Library using Homebrew on macOS Source: https://github.com/ta-lib/ta-lib-python/blob/master/README.md Install the TA-Lib C library on macOS using the Homebrew package manager. ```shell brew install ta-lib ``` -------------------------------- ### Install TA-Lib Python with Custom Environment Variables Source: https://github.com/ta-lib/ta-lib-python/blob/master/README.md Install the TA-Lib Python wrapper using pip after setting custom environment variables for TA-Lib C library paths. ```shell your-arm64-python -m pip install --no-cache-dir ta-lib ``` -------------------------------- ### Install TA-Lib Dependency on macOS Source: https://github.com/ta-lib/ta-lib-python/blob/master/docs/install.md Use Homebrew to install the TA-Lib C library on macOS systems. ```bash $ brew install ta-lib ``` -------------------------------- ### Install TA-Lib Dependency on Linux Source: https://github.com/ta-lib/ta-lib-python/blob/master/docs/install.md Compile and install the TA-Lib C library from source on Linux systems. Ensure you have the necessary build tools. ```bash tar zxvf ta-lib-0.4.0-src.tar.gz cd ta-lib ./configure --prefix=/usr make sudo make install ``` -------------------------------- ### Install TA-Lib Python Wrapper Dependencies on Debian Source: https://github.com/ta-lib/ta-lib-python/wiki/Installation-Directions Install necessary build tools and Python development packages on Debian systems. ```bash #For debian apt-get install build-essential python-pip python-dev python-stsci.distutils ``` -------------------------------- ### TA-Lib Make Build Errors Source: https://github.com/ta-lib/ta-lib-python/blob/master/README.md Errors during the `make` process, such as 'cd: .libs/libta_lib.lax/libta_abstract.a: No such file or directory', may be caused by spaces in directory names. Try installing TA-Lib in a path without spaces. ```shell ../libtool: line 1717: cd: .libs/libta_lib.lax/libta_abstract.a: No such file or directory make[2]: *** [libta_lib.la] Error 1 make[1]: *** [all-recursive] Error 1 make: *** [all-recursive] Error 1 ``` -------------------------------- ### Prepare Input Arrays for TA-Lib Source: https://github.com/ta-lib/ta-lib-python/blob/master/docs/index.md All input arrays must be of the same length when passed to TA-Lib functions. This example shows how to create random NumPy arrays for demonstration. ```python import numpy as np # note that all ndarrays must be the same length! inputs = { 'open': np.random.random(100), 'high': np.random.random(100), 'low': np.random.random(100), 'close': np.random.random(100), 'volume': np.random.random(100) } ``` -------------------------------- ### Troubleshooting TA-Lib Make Build Source: https://github.com/ta-lib/ta-lib-python/wiki/Installation-Directions If a parallel make build fails, rerun make and then install. This is a known workaround. ```bash If you build ``TA-Lib`` manually using ``make -jX``, the build will fail but it's OK! Simply rerun ``make -jX`` followed by ``[sudo] make install`` and it will work as expected. ``` -------------------------------- ### Install TA-Lib Python via Conda Forge Source: https://github.com/ta-lib/ta-lib-python/blob/master/README.md Install the TA-Lib Python wrapper using the Conda package manager from the Conda Forge channel. ```shell conda install -c conda-forge ta-lib ``` -------------------------------- ### Install TA-Lib C Library on Apple Silicon macOS Source: https://github.com/ta-lib/ta-lib-python/blob/master/README.md Ensure TA-Lib C library is built for the correct architecture on Apple Silicon Macs using Homebrew. ```shell arch -arm64 brew install ta-lib ``` -------------------------------- ### Install TA-Lib C Library via Conda Forge Source: https://github.com/ta-lib/ta-lib-python/blob/master/README.md Install the underlying TA-Lib C library using Conda Forge, which may help resolve dependency issues for some users. ```shell $ conda install -c conda-forge libta-lib ``` -------------------------------- ### Get Human-Readable TA-Lib Function Documentation Source: https://github.com/ta-lib/ta-lib-python/blob/master/docs/abstract.md Access human-readable documentation for a TA-Lib function using the help() function or by converting the function object to a string. ```python help(STOCH) str(STOCH) ``` -------------------------------- ### Permission Denied During Compilation Source: https://github.com/ta-lib/ta-lib-python/blob/master/README.md A 'Permission denied' error when including TA-Lib headers suggests that your user lacks access to the TA-Lib installation directory. Install TA-Lib to a user-accessible location or adjust permissions. ```shell talib/_ta_lib.c:747:28: fatal error: /usr/include/ta-lib/ta_defs.h: Permission denied #include "ta-lib/ta-defs.h" ^ compilation terminated error: command 'gcc' failed with exit status 1 ``` -------------------------------- ### Get Supported TA-Lib Functions and Groups Source: https://github.com/ta-lib/ta-lib-python/blob/master/docs/index.md You can retrieve a list of all supported TA-Lib functions or a dictionary of functions grouped by category. This is useful for understanding the library's capabilities. ```python import talib print talib.get_functions() print talib.get_function_groups() ``` -------------------------------- ### Set TA-Lib Environment Variables on macOS Source: https://github.com/ta-lib/ta-lib-python/blob/master/README.md Configure environment variables for include and library paths when installing TA-Lib Python on macOS, especially after using Homebrew. ```shell export TA_INCLUDE_PATH="$(brew --prefix ta-lib)/include" export TA_LIBRARY_PATH="$(brew --prefix ta-lib)/lib" ``` -------------------------------- ### Missing Python Headers During Compilation Source: https://github.com/ta-lib/ta-lib-python/blob/master/README.md This error, 'fatal error: pyconfig.h: No such file or directory', means you need the Python development headers. Install them using your system's package manager. ```shell talib/common.c:8:22: fatal error: pyconfig.h: No such file or directory #include "pyconfig.h" ^ compilation terminated. error: command 'x86_64-linux-gnu-gcc' failed with exit status 1 ``` ```shell sudo apt-get install python3-dev ``` -------------------------------- ### Missing libc-header-start.h Error Source: https://github.com/ta-lib/ta-lib-python/blob/master/README.md This error suggests a mismatch between the target platform and available headers, possibly related to 32-bit compilation. Consult external resources for specific solutions. ```shell /usr/include/limits.h:26:10: fatal error: bits/libc-header-start.h: No such file or directory #include ^~~~~~~~~~~~~~~~~~~~~~~~~~ ``` -------------------------------- ### Import Libraries and Generate Data Source: https://github.com/ta-lib/ta-lib-python/blob/master/docs/func.md Imports necessary libraries and generates random close prices for demonstration. ```python import numpy import talib close = numpy.random.random(100) ``` -------------------------------- ### Call TA-Lib Abstract API Functions with Default Prices Source: https://github.com/ta-lib/ta-lib-python/blob/master/README.md Illustrates calling TA-Lib functions like SMA and BBANDS using the default 'close' price for SMA and default OHLC prices for BBANDS. The 'inputs' dictionary should contain the necessary price arrays. ```python from talib.abstract import * # uses close prices (default) output = SMA(inputs, timeperiod=25) # uses close prices (default) upper, middle, lower = BBANDS(inputs, 20, 2.0, 2.0) ``` -------------------------------- ### Build Hanging on VM Source: https://github.com/ta-lib/ta-lib-python/blob/master/README.md If the build process hangs, especially on a VM, it might be due to insufficient memory. Try increasing the VM's memory allocation to 1 GB or 2 GB, or consider using a swapfile. ```shell sudo fallocate -l 1G /swapfile sudo chmod 600 /swapfile sudo mkswap /swapfile sudo swapon /swapfile ``` -------------------------------- ### Call TA-Lib Abstract API Functions with Specific Prices Source: https://github.com/ta-lib/ta-lib-python/blob/master/README.md Demonstrates how to specify which price arrays from the 'inputs' dictionary should be used by TA-Lib functions. This allows for flexibility beyond the default price selections. ```python from talib.abstract import * # uses open prices output = SMA(inputs, timeperiod=25, price='open') # uses high, low, close (default) slowk, slowd = STOCH(inputs, 5, 3, 0, 3, 0) # uses high, low, close by default # uses high, low, open instead slowk, slowd = STOCH(inputs, 5, 3, 0, 3, 0, prices=['high', 'low', 'open']) ``` -------------------------------- ### Prepare OHLCV Inputs for TA-Lib Abstract API Source: https://github.com/ta-lib/ta-lib-python/blob/master/README.md Demonstrates how to create a dictionary of numpy arrays for OHLCV data. Ensure all arrays are of the same length when passed to TA-Lib functions. ```python import numpy as np # note that all ndarrays must be the same length! inputs = { 'open': np.random.random(100), 'high': np.random.random(100), 'low': np.random.random(100), 'close': np.random.random(100), 'volume': np.random.random(100) } ``` -------------------------------- ### Prepare Input Data for TA-Lib Functions Source: https://github.com/ta-lib/ta-lib-python/blob/master/docs/abstract.md All TA-Lib functions require inputs as a dictionary of NumPy arrays. Ensure all arrays are of the same length. ```python import numpy as np # note that all ndarrays must be the same length! inputs = { 'open': np.random.random(100), 'high': np.random.random(100), 'low': np.random.random(100), 'close': np.random.random(100), 'volume': np.random.random(100) } ``` -------------------------------- ### Unresolved External Symbol Errors Source: https://github.com/ta-lib/ta-lib-python/blob/master/README.md These errors indicate that the underlying TA-Lib library cannot be found. Ensure the TA-Lib library is correctly installed and compatible with your Python architecture (32-bit vs. 64-bit). ```shell common.obj : error LNK2001: unresolved external symbol TA_SetUnstablePeriod common.obj : error LNK2001: unresolved external symbol TA_Shutdown common.obj : error LNK2001: unresolved external symbol TA_Initialize common.obj : error LNK2001: unresolved external symbol TA_GetUnstablePeriod common.obj : error LNK2001: unresolved external symbol TA_GetVersionString ``` -------------------------------- ### OBV - On Balance Volume Source: https://github.com/ta-lib/ta-lib-python/blob/master/docs/func_groups/volume_indicators.md Calculates the On Balance Volume. Requires close prices and volume data. ```python real = OBV(close, volume) ``` -------------------------------- ### Calculate Simple Moving Average with TA-Lib Source: https://github.com/ta-lib/ta-lib-python/blob/master/README.md Calculate a simple moving average of closing prices using the SMA function from TA-Lib. ```python close = np.random.random(100) output = talib.SMA(close) ``` -------------------------------- ### Import and Instantiate TA-Lib Abstract Functions Source: https://github.com/ta-lib/ta-lib-python/blob/master/docs/abstract.md Functions can be imported directly from the abstract module or instantiated by their string name. ```python from talib import abstract sma = abstract.SMA sma = abstract.Function('sma') ``` -------------------------------- ### SAREXT - Parabolic SAR - Extended Source: https://github.com/ta-lib/ta-lib-python/blob/master/docs/func_groups/overlap_studies.md Calculates the extended Parabolic SAR with detailed initialization and acceleration parameters. ```python real = SAREXT(high, low, startvalue=0, offsetonreverse=0, accelerationinitlong=0, accelerationlong=0, accelerationmaxlong=0, accelerationinitshort=0, accelerationshort=0, accelerationmaxshort=0) ``` -------------------------------- ### ACCBANDS - Acceleration Bands Source: https://github.com/ta-lib/ta-lib-python/blob/master/docs/func_groups/overlap_studies.md Calculates Acceleration Bands. Requires high, low, and close prices, and a time period. ```python upperband, middleband, lowerband = ACCBANDS(high, low, close, timeperiod=20) ``` -------------------------------- ### STOCHRSI vs. STOCH vs. STOCHF Usage Source: https://github.com/ta-lib/ta-lib-python/blob/master/README.md Clarifies the difference between `talib.STOCHRSI`, `talib.STOCHF`, and `talib.STOCH`. `STOCHRSI` is a direct library function, while the others can be used to replicate its behavior or achieve similar results with different inputs. ```python import talib import numpy as np c = np.random.randn(100) # this is the library function k, d = talib.STOCHRSI(c) # this produces the same result, calling STOCHF rsi = talib.RSI(c) k, d = talib.STOCHF(rsi, rsi, rsi) # you might want this instead, calling STOCH rsi = talib.RSI(c) k, d = talib.STOCH(rsi, rsi, rsi) ``` -------------------------------- ### Import or Instantiate TA-Lib Abstract Functions Source: https://github.com/ta-lib/ta-lib-python/blob/master/README.md Shows two methods for accessing TA-Lib functions: direct import or instantiation by function name. Both achieve the same result. ```python from talib import abstract # directly SMA = abstract.SMA # or by name SMA = abstract.Function('sma') ``` -------------------------------- ### BBANDS - Bollinger Bands Source: https://github.com/ta-lib/ta-lib-python/blob/master/docs/func_groups/overlap_studies.md Calculates Bollinger Bands. Requires input price series, time period, and deviation parameters. ```python upperband, middleband, lowerband = BBANDS(real, timeperiod=5, nbdevup=2, nbdevdn=2, matype=0) ``` -------------------------------- ### CDLMATCHINGLOW - Matching Low Pattern Source: https://github.com/ta-lib/ta-lib-python/blob/master/docs/func_groups/pattern_recognition.md Identifies the Matching Low candlestick pattern. Requires open, high, low, and close price data. ```python integer = CDLMATCHINGLOW(open, high, low, close) ``` -------------------------------- ### Call TA-Lib Abstract Functions Source: https://github.com/ta-lib/ta-lib-python/blob/master/docs/index.md Abstract functions can be called with input arrays and optional parameters like timeperiod. You can specify the price to calculate on, or it defaults to 'close'. ```python from talib.abstract import * output = SMA(input_arrays, timeperiod=25) # calculate on close prices by default output = SMA(input_arrays, timeperiod=25, price='open') # calculate on opens upper, middle, lower = BBANDS(input_arrays, 20, 2, 2) slowk, slowd = STOCH(input_arrays, 5, 3, 0, 3, 0) # uses high, low, close by default slowk, slowd = STOCH(input_arrays, 5, 3, 0, 3, 0, prices=['high', 'low', 'open']) ``` -------------------------------- ### CDLKICKINGBYLENGTH - Kicking by Length Pattern Source: https://github.com/ta-lib/ta-lib-python/blob/master/docs/func_groups/pattern_recognition.md Identifies the Kicking (bull/bear determined by the longer marubozu) candlestick pattern. Requires open, high, low, and close price data. ```python integer = CDLKICKINGBYLENGTH(open, high, low, close) ``` -------------------------------- ### PPO - Percentage Price Oscillator Source: https://github.com/ta-lib/ta-lib-python/blob/master/docs/func_groups/momentum_indicators.md Calculates the Percentage Price Oscillator, which is the difference between two Exponential Moving Averages expressed as a percentage of the longer-term average. ```python real = PPO(real, fastperiod=12, slowperiod=26, matype=0) ``` -------------------------------- ### CDLRISEFALL3METHODS - Rising/Falling Three Methods Source: https://github.com/ta-lib/ta-lib-python/blob/master/docs/func_groups/pattern_recognition.md Identifies the Rising/Falling Three Methods candlestick pattern. Requires open, high, low, and close price data. ```python integer = CDLRISEFALL3METHODS(open, high, low, close) ``` -------------------------------- ### CDLXSIDEGAP3METHODS - Upside/Downside Gap Three Methods Source: https://github.com/ta-lib/ta-lib-python/blob/master/docs/func_groups/pattern_recognition.md Identifies the Upside/Downside Gap Three Methods candlestick pattern. Requires open, high, low, and close price data. ```python integer = CDLXSIDEGAP3METHODS(open, high, low, close) ``` -------------------------------- ### Call TA-Lib Abstract Functions Source: https://github.com/ta-lib/ta-lib-python/blob/master/docs/abstract.md Call functions using their imported names or instantiated objects, specifying input data and parameters. Default price is 'close', but can be overridden. ```python from talib.abstract import * output = SMA(inputs, timeperiod=25) # calculate on close prices by default output = SMA(inputs, timeperiod=25, price='open') # calculate on opens upper, middle, lower = BBANDS(inputs, 20, 2, 2) slowk, slowd = STOCH(inputs, 5, 3, 0, 3, 0) # uses high, low, close by default slowk, slowd = STOCH(inputs, 5, 3, 0, 3, 0, prices=['high', 'low', 'open']) ``` -------------------------------- ### SAREXT - Parabolic SAR - Extended Source: https://github.com/ta-lib/ta-lib-python/blob/master/docs/func_groups/overlap_studies.md Calculates the extended Parabolic SAR (Stop and Reverse). It requires high and low prices, and various optional parameters for initialization and acceleration. ```APIDOC ## SAREXT ### Description Calculates the extended Parabolic SAR (Stop and Reverse). ### Signature ```python real = SAREXT(high, low, startvalue=0, offsetonreverse=0, accelerationinitlong=0, accelerationlong=0, accelerationmaxlong=0, accelerationinitshort=0, accelerationshort=0, accelerationmaxshort=0) ``` ### Parameters * **high** (numpy.ndarray): High prices. * **low** (numpy.ndarray): Low prices. * **startvalue** (float, optional): Initial SAR value. Defaults to 0. * **offsetonreverse** (float, optional): Offset on reverse. Defaults to 0. * **accelerationinitlong** (float, optional): Initial acceleration factor for long positions. Defaults to 0. * **accelerationlong** (float, optional): Acceleration factor for long positions. Defaults to 0. * **accelerationmaxlong** (float, optional): Maximum acceleration factor for long positions. Defaults to 0. * **accelerationinitshort** (float, optional): Initial acceleration factor for short positions. Defaults to 0. * **accelerationshort** (float, optional): Acceleration factor for short positions. Defaults to 0. * **accelerationmaxshort** (float, optional): Maximum acceleration factor for short positions. Defaults to 0. ``` -------------------------------- ### MAVP - Moving Average with Variable Period Source: https://github.com/ta-lib/ta-lib-python/blob/master/docs/func_groups/overlap_studies.md Calculates a Moving Average with a variable period. Requires input series, periods, and min/max period settings. ```python real = MAVP(real, periods, minperiod=2, maxperiod=30, matype=0) ``` -------------------------------- ### Calculate Momentum (MOM) Source: https://github.com/ta-lib/ta-lib-python/blob/master/docs/func.md Calculates the momentum of close prices over a specified time period using the MOM function. ```python output = talib.MOM(close, timeperiod=5) ``` -------------------------------- ### CDLDARKCLOUDCOVER - Dark Cloud Cover Pattern Source: https://github.com/ta-lib/ta-lib-python/blob/master/docs/func_groups/pattern_recognition.md Identifies the Dark Cloud Cover candlestick pattern. Requires open, high, low, and close price data, and an optional penetration parameter. ```python integer = CDLDARKCLOUDCOVER(open, high, low, close, penetration=0) ``` -------------------------------- ### BOP - Balance Of Power Source: https://github.com/ta-lib/ta-lib-python/blob/master/docs/func_groups/momentum_indicators.md Calculates the Balance of Power indicator, which measures the strength of buyers and sellers. ```python real = BOP(open, high, low, close) ``` -------------------------------- ### CDLKICKING - Kicking Pattern Source: https://github.com/ta-lib/ta-lib-python/blob/master/docs/func_groups/pattern_recognition.md Identifies the Kicking candlestick pattern. Requires open, high, low, and close price data. ```python integer = CDLKICKING(open, high, low, close) ``` -------------------------------- ### ARM64 TA-Lib Compilation on Linux Source: https://github.com/ta-lib/ta-lib-python/blob/master/README.md For ARM64 architectures, configuring the TA-Lib C library with an explicit build type before running `make` can resolve compilation issues. Alternatively, updating the `config.guess` file may help. ```shell ./configure --build=aarch64-unknown-linux-gnu ``` ```shell cp /usr/share/automake-1.16/config.guess /path/to/extracted/ta-lib/config.guess ``` ```shell ./configure ``` -------------------------------- ### CDLCOUNTERATTACK - Counterattack Pattern Source: https://github.com/ta-lib/ta-lib-python/blob/master/docs/func_groups/pattern_recognition.md Identifies the Counterattack candlestick pattern. Requires open, high, low, and close price data. ```python integer = CDLCOUNTERATTACK(open, high, low, close) ``` -------------------------------- ### ACCBANDS - Acceleration Bands Source: https://github.com/ta-lib/ta-lib-python/blob/master/docs/func_groups/overlap_studies.md Calculates Acceleration Bands. It requires high, low, and close prices, along with a specified time period. ```APIDOC ## ACCBANDS ### Description Calculates Acceleration Bands. ### Signature ```python upperband, middleband, lowerband = ACCBANDS(high, low, close, timeperiod=20) ``` ### Parameters * **high** (numpy.ndarray): High prices. * **low** (numpy.ndarray): Low prices. * **close** (numpy.ndarray): Close prices. * **timeperiod** (int, optional): The period for calculation. Defaults to 20. ``` -------------------------------- ### Hilbert Transform - SineWave (HT_SINE) Source: https://github.com/ta-lib/ta-lib-python/blob/master/docs/func_groups/cycle_indicators.md Calculates the sine wave and leading sine wave components of the dominant cycle using the Hilbert Transform. Note: This function has an unstable period. ```python sine, leadsine = HT_SINE(real) ``` -------------------------------- ### CDLSTALLEDPATTERN - Stalled Pattern Source: https://github.com/ta-lib/ta-lib-python/blob/master/docs/func_groups/pattern_recognition.md Identifies the Stalled Pattern candlestick pattern. Requires open, high, low, and close price data. ```python integer = CDLSTALLEDPATTERN(open, high, low, close) ``` -------------------------------- ### CDLSPINNINGTOP - Spinning Top Source: https://github.com/ta-lib/ta-lib-python/blob/master/docs/func_groups/pattern_recognition.md Identifies the Spinning Top candlestick pattern. Requires open, high, low, and close price data. ```python integer = CDLSPINNINGTOP(open, high, low, close) ``` -------------------------------- ### STOCH - Stochastic Source: https://github.com/ta-lib/ta-lib-python/blob/master/docs/func_groups/momentum_indicators.md Calculates the Stochastic indicator, which compares a closing price to its price range over a given period. ```python slowk, slowd = STOCH(high, low, close, fastk_period=5, slowk_period=3, slowk_matype=0, slowd_period=3, slowd_matype=0) ``` -------------------------------- ### TRIMA - Triangular Moving Average Source: https://github.com/ta-lib/ta-lib-python/blob/master/docs/func_groups/overlap_studies.md Calculates the Triangular Moving Average. Requires input series and time period. ```python real = TRIMA(real, timeperiod=30) ``` -------------------------------- ### CDLADVANCEBLOCK - Advance Block Pattern Source: https://github.com/ta-lib/ta-lib-python/blob/master/docs/func_groups/pattern_recognition.md Identifies the Advance Block candlestick pattern. Requires open, high, low, and close price data. ```python integer = CDLADVANCEBLOCK(open, high, low, close) ``` -------------------------------- ### MAMA - MESA Adaptive Moving Average Source: https://github.com/ta-lib/ta-lib-python/blob/master/docs/func_groups/overlap_studies.md Calculates the MESA Adaptive Moving Average. Has an unstable period. ```python mama, fama = MAMA(real, fastlimit=0, slowlimit=0) ``` -------------------------------- ### TRIMA - Triangular Moving Average Source: https://github.com/ta-lib/ta-lib-python/blob/master/docs/func_groups/overlap_studies.md Calculates the Triangular Moving Average (TRIMA). It requires a price series (real) and a time period. ```APIDOC ## TRIMA ### Description Calculates the Triangular Moving Average (TRIMA). ### Signature ```python real = TRIMA(real, timeperiod=30) ``` ### Parameters * **real** (numpy.ndarray): The price series. * **timeperiod** (int, optional): The period for calculation. Defaults to 30. ``` -------------------------------- ### CDLLADDERBOTTOM - Ladder Bottom Pattern Source: https://github.com/ta-lib/ta-lib-python/blob/master/docs/func_groups/pattern_recognition.md Identifies the Ladder Bottom candlestick pattern. Requires open, high, low, and close price data. ```python integer = CDLLADDERBOTTOM(open, high, low, close) ``` -------------------------------- ### Calculate Simple Moving Average (SMA) Source: https://github.com/ta-lib/ta-lib-python/blob/master/docs/func.md Calculates a simple moving average of the provided close prices using the SMA function. ```python output = talib.SMA(close) ``` -------------------------------- ### Hilbert Transform - Phasor Components (HT_PHASOR) Source: https://github.com/ta-lib/ta-lib-python/blob/master/docs/func_groups/cycle_indicators.md Calculates the in-phase and quadrature components of the dominant cycle using the Hilbert Transform. Note: This function has an unstable period. ```python inphase, quadrature = HT_PHASOR(real) ``` -------------------------------- ### Calculate Bollinger Bands (BBANDS) Source: https://github.com/ta-lib/ta-lib-python/blob/master/docs/func.md Calculates Bollinger Bands using the BBANDS function, specifying the MA_Type for the triple exponential moving average. ```python from talib import MA_Type upper, middle, lower = talib.BBANDS(close, matype=MA_Type.T3) ``` -------------------------------- ### CDLENGULFING - Engulfing Pattern Source: https://github.com/ta-lib/ta-lib-python/blob/master/docs/func_groups/pattern_recognition.md Identifies the Engulfing candlestick pattern. Requires open, high, low, and close price data. ```python integer = CDLENGULFING(open, high, low, close) ``` -------------------------------- ### SAR - Parabolic SAR Source: https://github.com/ta-lib/ta-lib-python/blob/master/docs/func_groups/overlap_studies.md Calculates the Parabolic SAR. Requires high, low prices, and acceleration/maximum parameters. ```python real = SAR(high, low, acceleration=0, maximum=0) ``` -------------------------------- ### CDLEVENINGDOJISTAR - Evening Doji Star Pattern Source: https://github.com/ta-lib/ta-lib-python/blob/master/docs/func_groups/pattern_recognition.md Identifies the Evening Doji Star candlestick pattern. Requires open, high, low, and close price data, and an optional penetration parameter. ```python integer = CDLEVENINGDOJISTAR(open, high, low, close, penetration=0) ``` -------------------------------- ### MIDPRICE - Midpoint Price over Period Source: https://github.com/ta-lib/ta-lib-python/blob/master/docs/func_groups/overlap_studies.md Calculates the Midpoint Price over a specified period. Requires high, low prices, and time period. ```python real = MIDPRICE(high, low, timeperiod=14) ``` -------------------------------- ### CDLABANDONEDBABY - Abandoned Baby Pattern Source: https://github.com/ta-lib/ta-lib-python/blob/master/docs/func_groups/pattern_recognition.md Identifies the Abandoned Baby candlestick pattern. Requires open, high, low, and close price data, and an optional penetration parameter. ```python integer = CDLABANDONEDBABY(open, high, low, close, penetration=0) ``` -------------------------------- ### CDLEVENINGSTAR - Evening Star Pattern Source: https://github.com/ta-lib/ta-lib-python/blob/master/docs/func_groups/pattern_recognition.md Identifies the Evening Star candlestick pattern. Requires open, high, low, and close price data, and an optional penetration parameter. ```python integer = CDLEVENINGSTAR(open, high, low, close, penetration=0) ``` -------------------------------- ### Calculate Average Price Source: https://github.com/ta-lib/ta-lib-python/blob/master/docs/func_groups/price_transform.md Calculates the average price using open, high, low, and close prices. This is a simple price averaging method. ```python real = AVGPRICE(open, high, low, close) ``` -------------------------------- ### CDLMORNINGDOJISTAR - Morning Doji Star Pattern Source: https://github.com/ta-lib/ta-lib-python/blob/master/docs/func_groups/pattern_recognition.md Identifies the Morning Doji Star candlestick pattern. Requires open, high, low, and close price data, and an optional penetration parameter. ```python integer = CDLMORNINGDOJISTAR(open, high, low, close, penetration=0) ``` -------------------------------- ### Price Transform Functions Source: https://github.com/ta-lib/ta-lib-python/blob/master/docs/funcs.md Lists functions that transform price data into a single representative value. These are often used as inputs for other indicators. ```text AVGPRICE Average Price MEDPRICE Median Price TYPPRICE Typical Price WCLPRICE Weighted Close Price ``` -------------------------------- ### SMA - Simple Moving Average Source: https://github.com/ta-lib/ta-lib-python/blob/master/docs/func_groups/overlap_studies.md Calculates the Simple Moving Average. Requires input series and time period. ```python real = SMA(real, timeperiod=30) ``` -------------------------------- ### ASIN - Vector Trigonometric ASin Source: https://github.com/ta-lib/ta-lib-python/blob/master/docs/func_groups/math_transform.md Applies the arc sine function element-wise to a real-valued input vector. ```python real = ASIN(real) ``` -------------------------------- ### ROCP - Rate of change Percentage Source: https://github.com/ta-lib/ta-lib-python/blob/master/docs/func_groups/momentum_indicators.md Calculates the Rate of Change Percentage indicator. ```python real = ROCP(real, timeperiod=10) ``` -------------------------------- ### CDLCLOSINGMARUBOZU - Closing Marubozu Pattern Source: https://github.com/ta-lib/ta-lib-python/blob/master/docs/func_groups/pattern_recognition.md Identifies the Closing Marubozu candlestick pattern. Requires open, high, low, and close price data. ```python integer = CDLCLOSINGMARUBOZU(open, high, low, close) ``` -------------------------------- ### MACDFIX - Moving Average Convergence/Divergence Fix 12/26 Source: https://github.com/ta-lib/ta-lib-python/blob/master/docs/func_groups/momentum_indicators.md Calculates the Moving Average Convergence/Divergence (MACD) indicator with fixed periods of 12 and 26. ```python macd, macdsignal, macdhist = MACDFIX(real, signalperiod=9) ``` -------------------------------- ### macOS Code Signature Error Source: https://github.com/ta-lib/ta-lib-python/blob/master/README.md On macOS, you might encounter 'Trying to load an unsigned library' errors. Use `xcrun codesign` to resolve code signature issues for the library. ```shell code signature in <141BC883-189B-322C-AE90-CBF6B5206F67> 'python3.9/site-packages/talib/_ta_lib.cpython-39-darwin.so' not valid for use in process: Trying to load an unsigned library) ``` -------------------------------- ### TA-Lib SMA NaN Handling Source: https://github.com/ta-lib/ta-lib-python/blob/master/README.md Demonstrates how TA-Lib's SMA function propagates NaN values in the input array to the output. Note the difference compared to Pandas rolling mean. ```python c = np.array([1.0, 2.0, 3.0, np.nan, 4.0, 5.0, 6.0]) talib.SMA(c, 3) ``` -------------------------------- ### CDLMORNINGSTAR - Morning Star Pattern Source: https://github.com/ta-lib/ta-lib-python/blob/master/docs/func_groups/pattern_recognition.md Identifies the Morning Star candlestick pattern. Requires open, high, low, and close price data, and an optional penetration parameter. ```python integer = CDLMORNINGSTAR(open, high, low, close, penetration=0) ``` -------------------------------- ### SMA - Simple Moving Average Source: https://github.com/ta-lib/ta-lib-python/blob/master/docs/func_groups/overlap_studies.md Calculates the Simple Moving Average (SMA). It requires a price series (real) and a time period. ```APIDOC ## SMA ### Description Calculates the Simple Moving Average (SMA). ### Signature ```python real = SMA(real, timeperiod=30) ``` ### Parameters * **real** (numpy.ndarray): The price series. * **timeperiod** (int, optional): The period for calculation. Defaults to 30. ``` -------------------------------- ### Access TA-Lib Function Information Source: https://github.com/ta-lib/ta-lib-python/blob/master/docs/abstract.md Retrieve detailed information about a TA-Lib function, including its name, display name, group, input parameters, and output names. ```python print Function('stoch').info { 'name': 'STOCH', 'display_name': 'Stochastic', 'group': 'Momentum Indicators', 'input_names': OrderedDict([ ('prices', ['high', 'low', 'close']), ]), 'parameters': OrderedDict([ ('fastk_period', 5), ('slowk_period', 3), ('slowk_matype', 0), ('slowd_period', 3), ('slowd_matype', 0), ]), 'output_names': ['slowk', 'slowd'], } ``` -------------------------------- ### MACD - Moving Average Convergence/Divergence Source: https://github.com/ta-lib/ta-lib-python/blob/master/docs/func_groups/momentum_indicators.md Calculates the Moving Average Convergence/Divergence (MACD) indicator. ```python macd, macdsignal, macdhist = MACD(real, fastperiod=12, slowperiod=26, signalperiod=9) ``` -------------------------------- ### Cycle Indicators Source: https://github.com/ta-lib/ta-lib-python/blob/master/docs/funcs.md Lists indicators based on the Hilbert Transform, used for identifying dominant cycles and their phases in price data. Useful for timing market turns. ```text HT_DCPERIOD Hilbert Transform - Dominant Cycle Period HT_DCPHASE Hilbert Transform - Dominant Cycle Phase HT_PHASOR Hilbert Transform - Phasor Components HT_SINE Hilbert Transform - SineWave HT_TRENDMODE Hilbert Transform - Trend vs Cycle Mode ``` -------------------------------- ### MFI - Money Flow Index Source: https://github.com/ta-lib/ta-lib-python/blob/master/docs/func_groups/momentum_indicators.md Calculates the Money Flow Index. Note that this function has an unstable period. ```python real = MFI(high, low, close, volume, timeperiod=14) ``` -------------------------------- ### MAVP - Moving average with variable period Source: https://github.com/ta-lib/ta-lib-python/blob/master/docs/func_groups/overlap_studies.md Calculates a Moving Average with Variable Period (MAVP). It requires a price series (real), a list of periods, and optional min/max periods and moving average type. ```APIDOC ## MAVP ### Description Calculates a Moving Average with Variable Period (MAVP). ### Signature ```python real = MAVP(real, periods, minperiod=2, maxperiod=30, matype=0) ``` ### Parameters * **real** (numpy.ndarray): The price series. * **periods** (numpy.ndarray): Array of periods. * **minperiod** (int, optional): The minimum period. Defaults to 2. * **maxperiod** (int, optional): The maximum period. Defaults to 30. * **matype** (int, optional): Type of moving average to use. Defaults to 0. ``` -------------------------------- ### Hilbert Transform - Dominant Cycle Phase (HT_DCPHASE) Source: https://github.com/ta-lib/ta-lib-python/blob/master/docs/func_groups/cycle_indicators.md Calculates the dominant cycle phase using the Hilbert Transform. Note: This function has an unstable period. ```python real = HT_DCPHASE(real) ``` -------------------------------- ### CDLSHORTLINE - Short Line Candle Source: https://github.com/ta-lib/ta-lib-python/blob/master/docs/func_groups/pattern_recognition.md Identifies the Short Line Candle pattern. Requires open, high, low, and close price data. ```python integer = CDLSHORTLINE(open, high, low, close) ``` -------------------------------- ### Hilbert Transform - Dominant Cycle Period (HT_DCPERIOD) Source: https://github.com/ta-lib/ta-lib-python/blob/master/docs/func_groups/cycle_indicators.md Calculates the dominant cycle period using the Hilbert Transform. Note: This function has an unstable period. ```python real = HT_DCPERIOD(real) ``` -------------------------------- ### MOM - Momentum Source: https://github.com/ta-lib/ta-lib-python/blob/master/docs/func_groups/momentum_indicators.md Calculates the Momentum indicator, which measures the speed of price changes. ```python real = MOM(real, timeperiod=10) ``` -------------------------------- ### CCI - Commodity Channel Index Source: https://github.com/ta-lib/ta-lib-python/blob/master/docs/func_groups/momentum_indicators.md Calculates the Commodity Channel Index, a tool to identify cyclical trends. ```python real = CCI(high, low, close, timeperiod=14) ``` -------------------------------- ### CDLHOMINGPIGEON - Homing Pigeon Pattern Source: https://github.com/ta-lib/ta-lib-python/blob/master/docs/func_groups/pattern_recognition.md Identifies the Homing Pigeon candlestick pattern. Requires open, high, low, and close price data. ```python integer = CDLHOMINGPIGEON(open, high, low, close) ``` -------------------------------- ### STOCHF - Stochastic Fast Source: https://github.com/ta-lib/ta-lib-python/blob/master/docs/func_groups/momentum_indicators.md Calculates the Fast Stochastic indicator, which is a variation of the Stochastic oscillator with faster signals. ```python fastk, fastd = STOCHF(high, low, close, fastk_period=5, fastd_period=3, fastd_matype=0) ``` -------------------------------- ### ULTOSC - Ultimate Oscillator Source: https://github.com/ta-lib/ta-lib-python/blob/master/docs/func_groups/momentum_indicators.md Calculates the Ultimate Oscillator, a momentum oscillator designed to capture price action across three different timeframes. ```python real = ULTOSC(high, low, close, timeperiod1=7, timeperiod2=14, timeperiod3=28) ``` -------------------------------- ### CDLDOJI - Doji Pattern Source: https://github.com/ta-lib/ta-lib-python/blob/master/docs/func_groups/pattern_recognition.md Identifies the Doji candlestick pattern. Requires open, high, low, and close price data. ```python integer = CDLDOJI(open, high, low, close) ``` -------------------------------- ### CDLPIERCING - Piercing Pattern Source: https://github.com/ta-lib/ta-lib-python/blob/master/docs/func_groups/pattern_recognition.md Identifies the Piercing candlestick pattern. Requires open, high, low, and close price data. ```python integer = CDLPIERCING(open, high, low, close) ``` -------------------------------- ### CDLTAKURI - Takuri (Dragonfly Doji with very long lower shadow) Source: https://github.com/ta-lib/ta-lib-python/blob/master/docs/func_groups/pattern_recognition.md Identifies the Takuri (Dragonfly Doji with very long lower shadow) pattern. Requires open, high, low, and close price data. ```python integer = CDLTAKURI(open, high, low, close) ``` -------------------------------- ### DEMA - Double Exponential Moving Average Source: https://github.com/ta-lib/ta-lib-python/blob/master/docs/func_groups/overlap_studies.md Calculates the Double Exponential Moving Average (DEMA). It requires a price series (real) and a time period. ```APIDOC ## DEMA ### Description Calculates the Double Exponential Moving Average (DEMA). ### Signature ```python real = DEMA(real, timeperiod=30) ``` ### Parameters * **real** (numpy.ndarray): The price series. * **timeperiod** (int, optional): The period for calculation. Defaults to 30. ``` -------------------------------- ### CDLDOJISTAR - Doji Star Pattern Source: https://github.com/ta-lib/ta-lib-python/blob/master/docs/func_groups/pattern_recognition.md Identifies the Doji Star candlestick pattern. Requires open, high, low, and close price data. ```python integer = CDLDOJISTAR(open, high, low, close) ``` -------------------------------- ### CDLLONGLINE - Long Line Candle Pattern Source: https://github.com/ta-lib/ta-lib-python/blob/master/docs/func_groups/pattern_recognition.md Identifies the Long Line Candle candlestick pattern. Requires open, high, low, and close price data. ```python integer = CDLLONGLINE(open, high, low, close) ``` -------------------------------- ### Calculate Typical Price Source: https://github.com/ta-lib/ta-lib-python/blob/master/docs/func_groups/price_transform.md Calculates the typical price, which is the average of the high, low, and close prices. Often used in technical analysis. ```python real = TYPPRICE(high, low, close) ``` -------------------------------- ### WMA - Weighted Moving Average Source: https://github.com/ta-lib/ta-lib-python/blob/master/docs/func_groups/overlap_studies.md Calculates the Weighted Moving Average. Requires input series and time period. ```python real = WMA(real, timeperiod=30) ``` -------------------------------- ### Calculate Weighted Close Price Source: https://github.com/ta-lib/ta-lib-python/blob/master/docs/func_groups/price_transform.md Calculates the weighted close price, giving more weight to the closing price. This is a common price transformation. ```python real = WCLPRICE(high, low, close) ``` -------------------------------- ### Calculate True Range (TRANGE) Source: https://github.com/ta-lib/ta-lib-python/blob/master/docs/func_groups/volatility_indicators.md Calculates the True Range (TRANGE) based on high, low, and close prices. This is a fundamental component for other volatility indicators. ```python real = TRANGE(high, low, close) ``` -------------------------------- ### CDLMARUBOZU - Marubozu Pattern Source: https://github.com/ta-lib/ta-lib-python/blob/master/docs/func_groups/pattern_recognition.md Identifies the Marubozu candlestick pattern. Requires open, high, low, and close price data. ```python integer = CDLMARUBOZU(open, high, low, close) ``` -------------------------------- ### CDLHARAMICROSS - Harami Cross Pattern Source: https://github.com/ta-lib/ta-lib-python/blob/master/docs/func_groups/pattern_recognition.md Identifies the Harami Cross candlestick pattern. Requires open, high, low, and close price data. ```python integer = CDLHARAMICROSS(open, high, low, close) ``` -------------------------------- ### IMI - Intraday Momentum Index Source: https://github.com/ta-lib/ta-lib-python/blob/master/docs/func_groups/momentum_indicators.md Calculates the Intraday Momentum Index. Note that this function has an unstable period. ```python real = IMI(open, close, timeperiod=14) ``` -------------------------------- ### CDLTHRUSTING - Thrusting Pattern Source: https://github.com/ta-lib/ta-lib-python/blob/master/docs/func_groups/pattern_recognition.md Identifies the Thrusting Pattern candlestick pattern. Requires open, high, low, and close price data. ```python integer = CDLTHRUSTING(open, high, low, close) ``` -------------------------------- ### CDLDRAGONFLYDOJI - Dragonfly Doji Pattern Source: https://github.com/ta-lib/ta-lib-python/blob/master/docs/func_groups/pattern_recognition.md Identifies the Dragonfly Doji candlestick pattern. Requires open, high, low, and close price data. ```python integer = CDLDRAGONFLYDOJI(open, high, low, close) ``` -------------------------------- ### CDLONNECK - On-Neck Pattern Source: https://github.com/ta-lib/ta-lib-python/blob/master/docs/func_groups/pattern_recognition.md Identifies the On-Neck candlestick pattern. Requires open, high, low, and close price data. ```python integer = CDLONNECK(open, high, low, close) ``` -------------------------------- ### HT_TRENDLINE - Hilbert Transform - Instantaneous Trendline Source: https://github.com/ta-lib/ta-lib-python/blob/master/docs/func_groups/overlap_studies.md Calculates the Hilbert Transform - Instantaneous Trendline. Has an unstable period. ```python real = HT_TRENDLINE(real) ``` -------------------------------- ### PLUS_DM - Plus Directional Movement Source: https://github.com/ta-lib/ta-lib-python/blob/master/docs/func_groups/momentum_indicators.md Calculates the Plus Directional Movement. Note that this function has an unstable period. ```python real = PLUS_DM(high, low, timeperiod=14) ``` -------------------------------- ### MACDEXT - MACD with controllable MA type Source: https://github.com/ta-lib/ta-lib-python/blob/master/docs/func_groups/momentum_indicators.md Calculates the MACD indicator with controllable Moving Average types. ```python macd, macdsignal, macdhist = MACDEXT(real, fastperiod=12, fastmatype=0, slowperiod=26, slowmatype=0, signalperiod=9, signalmatype=0) ``` -------------------------------- ### CDLINNECK - In-Neck Pattern Source: https://github.com/ta-lib/ta-lib-python/blob/master/docs/func_groups/pattern_recognition.md Identifies the In-Neck candlestick pattern. Requires open, high, low, and close price data. ```python integer = CDLINNECK(open, high, low, close) ``` -------------------------------- ### CDLSHOOTINGSTAR - Shooting Star Source: https://github.com/ta-lib/ta-lib-python/blob/master/docs/func_groups/pattern_recognition.md Identifies the Shooting Star candlestick pattern. Requires open, high, low, and close price data. ```python integer = CDLSHOOTINGSTAR(open, high, low, close) ``` -------------------------------- ### AD - Chaikin A/D Line Source: https://github.com/ta-lib/ta-lib-python/blob/master/docs/func_groups/volume_indicators.md Calculates the Chaikin A/D Line. Requires high, low, close prices, and volume data. ```python real = AD(high, low, close, volume) ``` -------------------------------- ### ADOSC - Chaikin A/D Oscillator Source: https://github.com/ta-lib/ta-lib-python/blob/master/docs/func_groups/volume_indicators.md Calculates the Chaikin A/D Oscillator. Requires high, low, close prices, and volume data, with optional fast and slow periods. ```python real = ADOSC(high, low, close, volume, fastperiod=3, slowperiod=10) ``` -------------------------------- ### KAMA - Kaufman Adaptive Moving Average Source: https://github.com/ta-lib/ta-lib-python/blob/master/docs/func_groups/overlap_studies.md Calculates the Kaufman Adaptive Moving Average. Has an unstable period. ```python real = KAMA(real, timeperiod=30) ``` -------------------------------- ### WMA - Weighted Moving Average Source: https://github.com/ta-lib/ta-lib-python/blob/master/docs/func_groups/overlap_studies.md Calculates the Weighted Moving Average (WMA). It requires a price series (real) and a time period. ```APIDOC ## WMA ### Description Calculates the Weighted Moving Average (WMA). ### Signature ```python real = WMA(real, timeperiod=30) ``` ### Parameters * **real** (numpy.ndarray): The price series. * **timeperiod** (int, optional): The period for calculation. Defaults to 30. ``` -------------------------------- ### LOG10 - Vector Log10 Source: https://github.com/ta-lib/ta-lib-python/blob/master/docs/func_groups/math_transform.md Applies the base-10 logarithm function element-wise to a real-valued input vector. ```python real = LOG10(real) ``` -------------------------------- ### CDLHIKKAKE - Hikkake Pattern Source: https://github.com/ta-lib/ta-lib-python/blob/master/docs/func_groups/pattern_recognition.md Identifies the Hikkake candlestick pattern. Requires open, high, low, and close price data. ```python integer = CDLHIKKAKE(open, high, low, close) ``` -------------------------------- ### Calculate Median Price Source: https://github.com/ta-lib/ta-lib-python/blob/master/docs/func_groups/price_transform.md Calculates the median price based on the high and low prices. Useful for finding a central price point. ```python real = MEDPRICE(high, low) ``` -------------------------------- ### BBANDS - Bollinger Bands Source: https://github.com/ta-lib/ta-lib-python/blob/master/docs/func_groups/overlap_studies.md Calculates Bollinger Bands. It requires a price series (real) and a time period, with optional parameters for standard deviation multipliers and moving average type. ```APIDOC ## BBANDS ### Description Calculates Bollinger Bands. ### Signature ```python upperband, middleband, lowerband = BBANDS(real, timeperiod=5, nbdevup=2, nbdevdn=2, matype=0) ``` ### Parameters * **real** (numpy.ndarray): The price series. * **timeperiod** (int, optional): The period for calculation. Defaults to 5. * **nbdevup** (float, optional): Standard deviation multiplier for the upper band. Defaults to 2. * **nbdevdn** (float, optional): Standard deviation multiplier for the lower band. Defaults to 2. * **matype** (int, optional): Type of moving average to use. Defaults to 0. ``` -------------------------------- ### WILLR - Williams' %R Source: https://github.com/ta-lib/ta-lib-python/blob/master/docs/func_groups/momentum_indicators.md Calculates Williams' %R, a momentum indicator that measures overbought and oversold levels. ```python real = WILLR(high, low, close, timeperiod=14) ``` -------------------------------- ### BETA Source: https://github.com/ta-lib/ta-lib-python/blob/master/docs/func_groups/statistic_functions.md Calculates the Beta coefficient, a measure of a stock's volatility in relation to the overall market. It requires two real-valued input series and a lookback period. ```APIDOC ## BETA - Beta ### Description Calculates the Beta coefficient, a measure of a stock's volatility in relation to the overall market. It requires two real-valued input series and a lookback period. ### Function Signature ```python real = BETA(real0, real1, timeperiod=5) ``` ### Parameters - **real0** (real-valued series) - The first input series. - **real1** (real-valued series) - The second input series. - **timeperiod** (integer) - The number of periods to consider for the calculation. Defaults to 5. ``` -------------------------------- ### CDLRICKSHAWMAN - Rickshaw Man Pattern Source: https://github.com/ta-lib/ta-lib-python/blob/master/docs/func_groups/pattern_recognition.md Identifies the Rickshaw Man candlestick pattern. Requires open, high, low, and close price data. ```python integer = CDLRICKSHAWMAN(open, high, low, close) ``` -------------------------------- ### KAMA - Kaufman Adaptive Moving Average Source: https://github.com/ta-lib/ta-lib-python/blob/master/docs/func_groups/overlap_studies.md Calculates the Kaufman Adaptive Moving Average (KAMA). Note: This function has an unstable period. It requires a price series (real) and a time period. ```APIDOC ## KAMA ### Description Calculates the Kaufman Adaptive Moving Average (KAMA). Note: This function has an unstable period. ### Signature ```python real = KAMA(real, timeperiod=30) ``` ### Parameters * **real** (numpy.ndarray): The price series. * **timeperiod** (int, optional): The period for calculation. Defaults to 30. ``` -------------------------------- ### CDLMATHOLD - Mat Hold Pattern Source: https://github.com/ta-lib/ta-lib-python/blob/master/docs/func_groups/pattern_recognition.md Identifies the Mat Hold candlestick pattern. Requires open, high, low, and close price data, and an optional penetration parameter. ```python integer = CDLMATHOLD(open, high, low, close, penetration=0) ``` -------------------------------- ### CDLBREAKAWAY - Breakaway Pattern Source: https://github.com/ta-lib/ta-lib-python/blob/master/docs/func_groups/pattern_recognition.md Identifies the Breakaway candlestick pattern. Requires open, high, low, and close price data. ```python integer = CDLBREAKAWAY(open, high, low, close) ``` -------------------------------- ### MA - Moving Average Source: https://github.com/ta-lib/ta-lib-python/blob/master/docs/func_groups/overlap_studies.md Calculates a Moving Average with a specified type. Requires input series, time period, and moving average type. ```python real = MA(real, timeperiod=30, matype=0) ```