freqtrade / technical

Various indicators developed or collected for the Freqtrade
GNU General Public License v3.0
786 stars 220 forks source link
dataframe freqtrade technical-analysis trading

Technical

Technical CI Documentation CI PyPI Ruff

Technical is a companion project for Freqtrade. It includes technical indicators, as well as helpful utilities (e.g. timeframe resampling) aimed to assist in strategy development for Freqtrade.

What does it do for you

Technical provides easy to use indicators, collected from all over github, as well as custom methods. Over time we plan to provide a simple API wrapper around TA-Lib, PyTi and others, as we find them. So you have one place, to find 100s of indicators.

Custom indicators

Utilities

Wrapped Indicators

The following indicators are available and have been 'wrapped' to be used on a dataframe with the standard open/close/high/low/volume columns:

We will try to add more and more wrappers as we get to it, but please be patient or help out with PR's! It's super easy, but also super boring work.

Usage

to use the library, please install it with pip

pip install technical

To get the latest version, install directly from github:

pip install git+https://github.com/freqtrade/technical

and then import the required packages

from technical.indicators import accumulation_distribution, ...
from technical.util import resample_to_interval, resampled_merge

# Assuming 1h dataframe -resampling to 4h:
dataframe_long = resample_to_interval(dataframe, 240)  # 240 = 4 * 60 = 4h

dataframe_long['rsi'] = ta.RSI(dataframe_long)
# Combine the 2 dataframes
dataframe = resampled_merge(dataframe, dataframe_long, fill_na=True)

"""
The resulting dataframe will have 5 resampled columns in addition to the regular columns,
following the template resample_<interval_in_minutes>_<orig_column_name>.
So in the above example:
['resample_240_open', 'resample_240_high', 'resample_240_low','resample_240_close', 'resample_240_rsi']
"""

Contributions

We will happily add your custom indicators to this repo! Just clone this repository and implement your favorite indicator to use with Freqtrade and create a Pull Request.

Please run both ruff check . and ruff format . before creating a PR to avoid unnecessary failures in CI.

Have fun!