diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0d43b9f75..d0175aebb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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 . diff --git a/Dockerfile b/Dockerfile index 7728fd6d1..98d48b6bf 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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 diff --git a/build_helpers/install_ta-lib.sh b/build_helpers/install_ta-lib.sh deleted file mode 100755 index 0315c7025..000000000 --- a/build_helpers/install_ta-lib.sh +++ /dev/null @@ -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 diff --git a/build_helpers/install_windows.ps1 b/build_helpers/install_windows.ps1 deleted file mode 100644 index 075606466..000000000 --- a/build_helpers/install_windows.ps1 +++ /dev/null @@ -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 . diff --git a/build_helpers/ta-lib-0.4.0-src.tar.gz b/build_helpers/ta-lib-0.4.0-src.tar.gz deleted file mode 100644 index b79b70b25..000000000 Binary files a/build_helpers/ta-lib-0.4.0-src.tar.gz and /dev/null differ diff --git a/build_helpers/ta_lib-0.5.5-cp310-cp310-win_amd64.whl b/build_helpers/ta_lib-0.5.5-cp310-cp310-win_amd64.whl deleted file mode 100644 index 105a479c7..000000000 Binary files a/build_helpers/ta_lib-0.5.5-cp310-cp310-win_amd64.whl and /dev/null differ diff --git a/build_helpers/ta_lib-0.5.5-cp311-cp311-linux_armv7l.whl b/build_helpers/ta_lib-0.5.5-cp311-cp311-linux_armv7l.whl deleted file mode 100644 index b2194d6f2..000000000 Binary files a/build_helpers/ta_lib-0.5.5-cp311-cp311-linux_armv7l.whl and /dev/null differ diff --git a/build_helpers/ta_lib-0.5.5-cp311-cp311-win_amd64.whl b/build_helpers/ta_lib-0.5.5-cp311-cp311-win_amd64.whl deleted file mode 100644 index 2c955c233..000000000 Binary files a/build_helpers/ta_lib-0.5.5-cp311-cp311-win_amd64.whl and /dev/null differ diff --git a/build_helpers/ta_lib-0.5.5-cp312-cp312-win_amd64.whl b/build_helpers/ta_lib-0.5.5-cp312-cp312-win_amd64.whl deleted file mode 100644 index 98363aadb..000000000 Binary files a/build_helpers/ta_lib-0.5.5-cp312-cp312-win_amd64.whl and /dev/null differ diff --git a/build_helpers/ta_lib-0.5.5-cp313-cp313-win_amd64.whl b/build_helpers/ta_lib-0.5.5-cp313-cp313-win_amd64.whl deleted file mode 100644 index 68bad37e2..000000000 Binary files a/build_helpers/ta_lib-0.5.5-cp313-cp313-win_amd64.whl and /dev/null differ diff --git a/build_helpers/ta_lib-0.6.5-cp311-cp311-manylinux_2_31_armv7l.whl b/build_helpers/ta_lib-0.6.5-cp311-cp311-manylinux_2_31_armv7l.whl new file mode 100644 index 000000000..0c90c4328 Binary files /dev/null and b/build_helpers/ta_lib-0.6.5-cp311-cp311-manylinux_2_31_armv7l.whl differ diff --git a/docs/installation.md b/docs/installation.md index 564b87dfb..3efe6593f 100644 --- a/docs/installation.md +++ b/docs/installation.md @@ -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 diff --git a/docs/updating.md b/docs/updating.md index bfe539284..5ffd9bd2c 100644 --- a/docs/updating.md +++ b/docs/updating.md @@ -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) diff --git a/docs/windows_installation.md b/docs/windows_installation.md index 35a3d4441..51facfb58 100644 --- a/docs/windows_installation.md +++ b/docs/windows_installation.md @@ -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 diff --git a/pyproject.toml b/pyproject.toml index dac02870a..24aadb26d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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", diff --git a/requirements.txt b/requirements.txt index 4ffdedd8c..d01f95216 100644 --- a/requirements.txt +++ b/requirements.txt @@ -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 diff --git a/setup.ps1 b/setup.ps1 index 39e8b7d02..a11e9c7fa 100644 --- a/setup.ps1 +++ b/setup.ps1 @@ -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' diff --git a/setup.sh b/setup.sh index a5c73f945..5e0800ab8 100755 --- a/setup.sh +++ b/setup.sh @@ -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 diff --git a/tests/test_talib.py b/tests/test_talib.py index 97551bec9..81208a67c 100644 --- a/tests/test_talib.py +++ b/tests/test_talib.py @@ -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)