Merge pull request #12101 from freqtrade/dependabot/pip/develop/ta-lib-0.6.5

chore(deps): bump ta-lib from 0.5.5 to 0.6.5
This commit is contained in:
Matthias
2025-08-15 13:10:22 +02:00
committed by GitHub
19 changed files with 11 additions and 203 deletions

View File

@@ -47,24 +47,9 @@ jobs:
cache-suffix: "${{ matrix.python-version }}"
prune-cache: false
- name: Cache_dependencies
uses: actions/cache@v4
id: cache
with:
path: ~/dependencies/
key: ${{ runner.os }}-dependencies
- name: TA binary *nix
if: steps.cache.outputs.cache-hit != 'true'
run: |
cd build_helpers && ./install_ta-lib.sh ${HOME}/dependencies/; cd ..
- name: Installation - *nix
run: |
uv pip install --upgrade wheel
export LD_LIBRARY_PATH=${HOME}/dependencies/lib:$LD_LIBRARY_PATH
export TA_LIBRARY_PATH=${HOME}/dependencies/lib
export TA_INCLUDE_PATH=${HOME}/dependencies/include
uv pip install -r requirements-dev.txt
uv pip install -e ft_client/
uv pip install -e .
@@ -183,18 +168,6 @@ jobs:
cache-suffix: "${{ matrix.python-version }}"
prune-cache: false
- name: Cache_dependencies
uses: actions/cache@v4
id: cache
with:
path: ~/dependencies/
key: ${{ matrix.os }}-dependencies
- name: TA binary *nix
if: steps.cache.outputs.cache-hit != 'true'
run: |
cd build_helpers && ./install_ta-lib.sh ${HOME}/dependencies/; cd ..
- name: Installation - macOS (Brew)
run: |
# brew update
@@ -222,9 +195,6 @@ jobs:
- name: Installation (python)
run: |
uv pip install wheel
export LD_LIBRARY_PATH=${HOME}/dependencies/lib:$LD_LIBRARY_PATH
export TA_LIBRARY_PATH=${HOME}/dependencies/lib
export TA_INCLUDE_PATH=${HOME}/dependencies/include
uv pip install -r requirements-dev.txt
uv pip install -e ft_client/
uv pip install -e .
@@ -315,7 +285,9 @@ jobs:
function uvpipFunction { uv pip $args }
Set-Alias -name pip -value uvpipFunction
./build_helpers/install_windows.ps1
python -m pip install --upgrade pip
pip install -r requirements-dev.txt
pip install -e .
- name: Tests
run: |
@@ -458,25 +430,9 @@ jobs:
cache-suffix: "3.12"
prune-cache: false
- name: Cache_dependencies
uses: actions/cache@v4
id: cache
with:
path: ~/dependencies/
key: ${{ runner.os }}-dependencies
- name: TA binary *nix
if: steps.cache.outputs.cache-hit != 'true'
run: |
cd build_helpers && ./install_ta-lib.sh ${HOME}/dependencies/; cd ..
- name: Installation - *nix
run: |
uv pip install --upgrade wheel
export LD_LIBRARY_PATH=${HOME}/dependencies/lib:$LD_LIBRARY_PATH
export TA_LIBRARY_PATH=${HOME}/dependencies/lib
export TA_INCLUDE_PATH=${HOME}/dependencies/include
uv pip install -r requirements-dev.txt
uv pip install -e ft_client/
uv pip install -e .

View File

@@ -27,11 +27,6 @@ RUN apt-get update \
&& apt-get clean \
&& pip install --upgrade pip wheel
# Install TA-lib
COPY build_helpers/* /tmp/
RUN cd /tmp && /tmp/install_ta-lib.sh && rm -r /tmp/*ta-lib*
ENV LD_LIBRARY_PATH=/usr/local/lib
# Install dependencies
COPY --chown=ftuser:ftuser requirements.txt requirements-hyperopt.txt /freqtrade/
USER ftuser

View File

@@ -1,35 +0,0 @@
if [ -z "$1" ]; then
INSTALL_LOC=/usr/local
else
INSTALL_LOC=${1}
fi
echo "Installing to ${INSTALL_LOC}"
if [ -n "$2" ] || [ ! -f "${INSTALL_LOC}/lib/libta_lib.a" ]; then
tar zxvf ta-lib-0.4.0-src.tar.gz
cd ta-lib \
&& sed -i.bak "s|0.00000001|0.000000000000000001 |g" src/ta_func/ta_utility.h \
&& echo "Downloading gcc config.guess and config.sub" \
&& curl -s 'https://raw.githubusercontent.com/gcc-mirror/gcc/master/config.guess' -o config.guess \
&& curl -s 'https://raw.githubusercontent.com/gcc-mirror/gcc/master/config.sub' -o config.sub \
&& ./configure --prefix=${INSTALL_LOC}/ \
&& make
if [ $? -ne 0 ]; then
echo "Failed building ta-lib."
cd .. && rm -rf ./ta-lib/
exit 1
fi
if [ -z "$2" ]; then
which sudo && sudo make install || make install
if [ -x "$(command -v apt-get)" ]; then
echo "Updating library path using ldconfig"
sudo ldconfig
fi
else
# Don't install with sudo
make install
fi
cd .. && rm -rf ./ta-lib/
else
echo "TA-lib already installed, skipping installation"
fi

View File

@@ -1,10 +0,0 @@
# vendored Wheels compiled via https://github.com/xmatthias/ta-lib-python/tree/ta_bundled_040
python -m pip install --upgrade pip
python -c "import sys; print(f'{sys.version_info.major}.{sys.version_info.minor}')"
pip install -U wheel "numpy<3.0"
pip install --only-binary ta-lib --find-links=build_helpers\ "ta-lib<0.6.0"
pip install -r requirements-dev.txt
pip install -e .

View File

@@ -46,7 +46,6 @@ These requirements apply to both [Script Installation](#script-installation) and
* [pip](https://pip.pypa.io/en/stable/installing/)
* [git](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git)
* [virtualenv](https://virtualenv.pypa.io/en/stable/installation.html) (Recommended)
* [TA-Lib](https://ta-lib.github.io/ta-lib-python/) (install instructions [below](#install-ta-lib))
### Install code
@@ -201,35 +200,6 @@ This option will hard reset your branch (only if you are on either `stable` or `
Make sure you fulfill the [Requirements](#requirements) and have downloaded the [Freqtrade repository](#freqtrade-repository).
### Install TA-Lib
#### TA-Lib script installation
```bash
sudo ./build_helpers/install_ta-lib.sh
```
!!! Note
This will use the ta-lib tar.gz included in this repository.
##### TA-Lib manual installation
[Official installation guide](https://ta-lib.github.io/ta-lib-python/install.html)
```bash
wget http://prdownloads.sourceforge.net/ta-lib/ta-lib-0.4.0-src.tar.gz
tar xvzf ta-lib-0.4.0-src.tar.gz
cd ta-lib
sed -i.bak "s|0.00000001|0.000000000000000001 |g" src/ta_func/ta_utility.h
./configure --prefix=/usr/local
make
sudo make install
# On debian based systems (debian, ubuntu, ...) - updating ldconfig might be necessary.
sudo ldconfig
cd ..
rm -rf ./ta-lib*
```
### Setup Python virtual environment (virtualenv)
You will run freqtrade in separated `virtual environment`
@@ -332,16 +302,6 @@ python3 -m pip install -r requirements.txt
python3 -m pip install -e .
```
Patch conda libta-lib (Linux only)
```bash
# Ensure that the environment is active!
conda activate freqtrade
cd build_helpers
bash install_ta-lib.sh ${CONDA_PREFIX} nosudo
```
[You are now ready](#you-are-ready) to run the bot.
### Important shortcuts

View File

@@ -42,7 +42,3 @@ freqtrade install-ui
Update-problems usually come missing dependencies (you didn't follow the above instructions) - or from updated dependencies, which fail to install (for example TA-lib).
Please refer to the corresponding installation sections (common problems linked below)
Common problems and their solutions:
* [ta-lib update on windows](windows_installation.md#install-ta-lib)

View File

@@ -38,30 +38,6 @@ cd freqtrade
!!! Hint
Using the [Anaconda Distribution](https://www.anaconda.com/distribution/) under Windows can greatly help with installation problems. Check out the [Anaconda installation section](installation.md#installation-with-conda) in the documentation for more information.
### Install ta-lib
Install ta-lib according to the [ta-lib documentation](https://github.com/TA-Lib/ta-lib-python#windows).
As compiling from source on windows has heavy dependencies (requires a partial visual studio installation), Freqtrade provides these dependencies (in the binary wheel format) for the latest 3 Python versions (3.11, 3.12 and 3.13) and for 64bit Windows.
These Wheels are also used by CI running on windows, and are therefore tested together with freqtrade.
Other versions must be downloaded from the above link.
``` powershell
cd \path\freqtrade
python -m venv .venv
.venv\Scripts\activate.ps1
# optionally install ta-lib from wheel
# Eventually adjust the below filename to match the downloaded wheel
pip install --find-links build_helpers\ TA-Lib -U
pip install -r requirements.txt
pip install -e .
freqtrade
```
!!! Note "Use Powershell"
The above installation script assumes you're using powershell on a 64bit windows.
Commands for the legacy CMD windows console may differ.
### Error during installation on Windows

View File

@@ -40,7 +40,7 @@ dependencies = [
"jsonschema",
"numpy>2.0,<3.0",
"pandas>=2.2.0,<3.0",
"TA-Lib<0.6",
"TA-Lib<0.7",
"ft-pandas-ta",
"technical",
"tabulate",

View File

@@ -4,7 +4,7 @@ bottleneck==1.5.0
numexpr==2.11.0
# Indicator libraries
ft-pandas-ta==0.3.15
ta-lib==0.5.5
ta-lib==0.6.5
technical==1.5.2
ccxt==4.4.99

View File

@@ -228,16 +228,6 @@ function Main {
}
}
if (-not (Test-Path "$VenvDir\Lib\site-packages\talib")) {
# Install TA-Lib using the virtual environment's pip
Write-Log "Installing TA-Lib using virtual environment's pip..."
python -m pip install --find-links=build_helpers\ --prefer-binary TA-Lib 2>&1 | Out-File $LogFilePath -Append
if ($LASTEXITCODE -ne 0) {
Write-Log "Failed to install TA-Lib." -Level 'ERROR'
Exit-Script -exitCode 1
}
}
# Present options for requirement files
$SelectedIndices = Get-UserSelection -prompt "Select which requirement files to install:" -options $RequirementFiles -defaultChoice 'A'

View File

@@ -91,7 +91,6 @@ function updateenv() {
fi
fi
fi
install_talib
${PYTHON} -m pip install --upgrade -r ${REQUIREMENTS} ${REQUIREMENTS_HYPEROPT} ${REQUIREMENTS_PLOT} ${REQUIREMENTS_FREQAI} ${REQUIREMENTS_FREQAI_RL}
if [ $? -ne 0 ]; then
@@ -118,25 +117,6 @@ function updateenv() {
fi
}
# Install tab lib
function install_talib() {
if [ -f /usr/local/lib/libta_lib.a ] || [ -f /usr/local/lib/libta_lib.so ] || [ -f /usr/lib/libta_lib.so ]; then
echo "ta-lib already installed, skipping"
return
fi
cd build_helpers && ./install_ta-lib.sh
if [ $? -ne 0 ]; then
echo "Quitting. Please fix the above error before continuing."
cd ..
exit 1
fi;
cd ..
}
# Install bot MacOS
function install_macos() {
if [ ! -x "$(command -v brew)" ]
@@ -257,7 +237,7 @@ function install() {
install_redhat
else
echo "This script does not support your OS."
echo "If you have Python version 3.11 - 3.13, pip, virtualenv, ta-lib you can continue."
echo "If you have Python version 3.11 - 3.13, pip, virtualenv installed you can continue."
echo "Wait 10 seconds to continue the next install steps or use ctrl+c to interrupt this shell."
sleep 10
fi

View File

@@ -5,11 +5,11 @@ import talib.abstract as ta
def test_talib_bollingerbands_near_zero_values():
inputs = pd.DataFrame(
[
{"close": 0.00000010},
{"close": 0.00000011},
{"close": 0.00000012},
{"close": 0.00000013},
{"close": 0.00000014},
{"close": 0.000010},
{"close": 0.000011},
{"close": 0.000012},
{"close": 0.000013},
{"close": 0.000014},
]
)
bollinger = ta.BBANDS(inputs, matype=0, timeperiod=2)