diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 15f64ad38..407894bd2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -20,7 +20,7 @@ jobs: strategy: matrix: os: [ ubuntu-18.04, ubuntu-20.04 ] - python-version: ["3.7", "3.8", "3.9", "3.10"] + python-version: ["3.8", "3.9", "3.10"] steps: - uses: actions/checkout@v2 @@ -115,7 +115,7 @@ jobs: strategy: matrix: os: [ macos-latest ] - python-version: ["3.7", "3.8", "3.9", "3.10"] + python-version: ["3.8", "3.9", "3.10"] steps: - uses: actions/checkout@v2 @@ -207,7 +207,7 @@ jobs: strategy: matrix: os: [ windows-latest ] - python-version: ["3.7", "3.8", "3.9", "3.10"] + python-version: ["3.8", "3.9", "3.10"] steps: - uses: actions/checkout@v2 diff --git a/README.md b/README.md index 3a7d42fe9..b67e16010 100644 --- a/README.md +++ b/README.md @@ -49,7 +49,7 @@ Please find the complete documentation on the [freqtrade website](https://www.fr ## Features -- [x] **Based on Python 3.7+**: For botting on any operating system - Windows, macOS and Linux. +- [x] **Based on Python 3.8+**: For botting on any operating system - Windows, macOS and Linux. - [x] **Persistence**: Persistence is achieved through sqlite. - [x] **Dry-run**: Run the bot without paying money. - [x] **Backtesting**: Run a simulation of your buy/sell strategy. @@ -197,7 +197,7 @@ To run this bot we recommend you a cloud instance with a minimum of: ### Software requirements -- [Python >= 3.7](http://docs.python-guide.org/en/latest/starting/installation/) +- [Python >= 3.8](http://docs.python-guide.org/en/latest/starting/installation/) - [pip](https://pip.pypa.io/en/stable/installing/) - [git](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git) - [TA-Lib](https://mrjbq7.github.io/ta-lib/install.html) diff --git a/build_helpers/TA_Lib-0.4.24-cp37-cp37m-win_amd64.whl b/build_helpers/TA_Lib-0.4.24-cp37-cp37m-win_amd64.whl deleted file mode 100644 index ee8d64c6e..000000000 Binary files a/build_helpers/TA_Lib-0.4.24-cp37-cp37m-win_amd64.whl and /dev/null differ diff --git a/build_helpers/install_windows.ps1 b/build_helpers/install_windows.ps1 index de1b1d597..4caefa340 100644 --- a/build_helpers/install_windows.ps1 +++ b/build_helpers/install_windows.ps1 @@ -5,9 +5,6 @@ python -m pip install --upgrade pip wheel $pyv = python -c "import sys; print(f'{sys.version_info.major}.{sys.version_info.minor}')" -if ($pyv -eq '3.7') { - pip install build_helpers\TA_Lib-0.4.24-cp37-cp37m-win_amd64.whl -} if ($pyv -eq '3.8') { pip install build_helpers\TA_Lib-0.4.24-cp38-cp38-win_amd64.whl } diff --git a/docs/advanced-hyperopt.md b/docs/advanced-hyperopt.md index 9ac31bf16..9dbb86b2d 100644 --- a/docs/advanced-hyperopt.md +++ b/docs/advanced-hyperopt.md @@ -105,7 +105,7 @@ You can define your own estimator for Hyperopt by implementing `generate_estimat ```python class MyAwesomeStrategy(IStrategy): class HyperOpt: - def generate_estimator(): + def generate_estimator(dimensions: List['Dimension'], **kwargs): return "RF" ``` @@ -119,13 +119,34 @@ Example for `ExtraTreesRegressor` ("ET") with additional parameters: ```python class MyAwesomeStrategy(IStrategy): class HyperOpt: - def generate_estimator(): + def generate_estimator(dimensions: List['Dimension'], **kwargs): from skopt.learning import ExtraTreesRegressor # Corresponds to "ET" - but allows additional parameters. return ExtraTreesRegressor(n_estimators=100) ``` +The `dimensions` parameter is the list of `skopt.space.Dimension` objects corresponding to the parameters to be optimized. It can be used to create isotropic kernels for the `skopt.learning.GaussianProcessRegressor` estimator. Here's an example: + +```python +class MyAwesomeStrategy(IStrategy): + class HyperOpt: + def generate_estimator(dimensions: List['Dimension'], **kwargs): + from skopt.utils import cook_estimator + from skopt.learning.gaussian_process.kernels import (Matern, ConstantKernel) + kernel_bounds = (0.0001, 10000) + kernel = ( + ConstantKernel(1.0, kernel_bounds) * + Matern(length_scale=np.ones(len(dimensions)), length_scale_bounds=[kernel_bounds for d in dimensions], nu=2.5) + ) + kernel += ( + ConstantKernel(1.0, kernel_bounds) * + Matern(length_scale=np.ones(len(dimensions)), length_scale_bounds=[kernel_bounds for d in dimensions], nu=1.5) + ) + + return cook_estimator("GP", space=dimensions, kernel=kernel, n_restarts_optimizer=2) +``` + !!! Note While custom estimators can be provided, it's up to you as User to do research on possible parameters and analyze / understand which ones should be used. If you're unsure about this, best use one of the Defaults (`"ET"` has proven to be the most versatile) without further parameters. diff --git a/docs/index.md b/docs/index.md index 292955346..1f8f15704 100644 --- a/docs/index.md +++ b/docs/index.md @@ -11,7 +11,7 @@ ## Introduction -Freqtrade is a crypto-currency algorithmic trading software developed in python (3.7+) and supported on Windows, macOS and Linux. +Freqtrade is a crypto-currency algorithmic trading software developed in python (3.8+) and supported on Windows, macOS and Linux. !!! Danger "DISCLAIMER" This software is for educational purposes only. Do not risk money which you are afraid to lose. USE THE SOFTWARE AT YOUR OWN RISK. THE AUTHORS AND ALL AFFILIATES ASSUME NO RESPONSIBILITY FOR YOUR TRADING RESULTS. @@ -67,7 +67,7 @@ To run this bot we recommend you a linux cloud instance with a minimum of: Alternatively -- Python 3.7+ +- Python 3.8+ - pip (pip3) - git - TA-Lib diff --git a/docs/installation.md b/docs/installation.md index c67eff60b..2a1c3db0a 100644 --- a/docs/installation.md +++ b/docs/installation.md @@ -42,7 +42,7 @@ These requirements apply to both [Script Installation](#script-installation) and ### Install guide -* [Python >= 3.7.x](http://docs.python-guide.org/en/latest/starting/installation/) +* [Python >= 3.8.x](http://docs.python-guide.org/en/latest/starting/installation/) * [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) diff --git a/docs/windows_installation.md b/docs/windows_installation.md index 0832b753c..9a068e152 100644 --- a/docs/windows_installation.md +++ b/docs/windows_installation.md @@ -25,7 +25,7 @@ Install ta-lib according to the [ta-lib documentation](https://github.com/mrjbq7 As compiling from source on windows has heavy dependencies (requires a partial visual studio installation), there is also a repository of unofficial pre-compiled windows Wheels [here](https://www.lfd.uci.edu/~gohlke/pythonlibs/#ta-lib), which need to be downloaded and installed using `pip install TA_Lib-0.4.24-cp38-cp38-win_amd64.whl` (make sure to use the version matching your python version). -Freqtrade provides these dependencies for the latest 3 Python versions (3.7, 3.8, 3.9 and 3.10) and for 64bit Windows. +Freqtrade provides these dependencies for the latest 3 Python versions (3.8, 3.9 and 3.10) and for 64bit Windows. Other versions must be downloaded from the above link. ``` powershell diff --git a/environment.yml b/environment.yml index 84ab5ff6f..50af602e5 100644 --- a/environment.yml +++ b/environment.yml @@ -4,7 +4,7 @@ channels: # - defaults dependencies: # 1/4 req main - - python>=3.7,<3.9 + - python>=3.8,<=3.10 - numpy - pandas - pip @@ -25,9 +25,12 @@ dependencies: - fastapi - uvicorn - pyjwt + - aiofiles + - psutil - colorama - questionary - prompt-toolkit + - python-dateutil # ============================ diff --git a/freqtrade/__main__.py b/freqtrade/__main__.py index ab4c7a110..fc45bdf61 100644 --- a/freqtrade/__main__.py +++ b/freqtrade/__main__.py @@ -3,7 +3,7 @@ __main__.py for Freqtrade To launch Freqtrade as a module -> python -m freqtrade (with Python >= 3.7) +> python -m freqtrade (with Python >= 3.8) """ from freqtrade import main diff --git a/freqtrade/main.py b/freqtrade/main.py index 6593fbcb6..162b4d029 100755 --- a/freqtrade/main.py +++ b/freqtrade/main.py @@ -9,8 +9,8 @@ from typing import Any, List # check min. python version -if sys.version_info < (3, 7): # pragma: no cover - sys.exit("Freqtrade requires Python version >= 3.7") +if sys.version_info < (3, 8): # pragma: no cover + sys.exit("Freqtrade requires Python version >= 3.8") from freqtrade.commands import Arguments from freqtrade.exceptions import FreqtradeException, OperationalException diff --git a/freqtrade/optimize/hyperopt.py b/freqtrade/optimize/hyperopt.py index f98014089..9664e6f07 100644 --- a/freqtrade/optimize/hyperopt.py +++ b/freqtrade/optimize/hyperopt.py @@ -367,7 +367,7 @@ class Hyperopt: } def get_optimizer(self, dimensions: List[Dimension], cpu_count) -> Optimizer: - estimator = self.custom_hyperopt.generate_estimator() + estimator = self.custom_hyperopt.generate_estimator(dimensions=dimensions) acq_optimizer = "sampling" if isinstance(estimator, str): diff --git a/freqtrade/optimize/hyperopt_auto.py b/freqtrade/optimize/hyperopt_auto.py index 63b4b14e1..5bc0af42b 100644 --- a/freqtrade/optimize/hyperopt_auto.py +++ b/freqtrade/optimize/hyperopt_auto.py @@ -91,5 +91,5 @@ class HyperOptAuto(IHyperOpt): def trailing_space(self) -> List['Dimension']: return self._get_func('trailing_space')() - def generate_estimator(self) -> EstimatorType: - return self._get_func('generate_estimator')() + def generate_estimator(self, dimensions: List['Dimension'], **kwargs) -> EstimatorType: + return self._get_func('generate_estimator')(dimensions=dimensions, **kwargs) diff --git a/freqtrade/optimize/hyperopt_interface.py b/freqtrade/optimize/hyperopt_interface.py index 53b4f087c..01ffd7844 100644 --- a/freqtrade/optimize/hyperopt_interface.py +++ b/freqtrade/optimize/hyperopt_interface.py @@ -40,7 +40,7 @@ class IHyperOpt(ABC): IHyperOpt.ticker_interval = str(config['timeframe']) # DEPRECATED IHyperOpt.timeframe = str(config['timeframe']) - def generate_estimator(self) -> EstimatorType: + def generate_estimator(self, dimensions: List[Dimension], **kwargs) -> EstimatorType: """ Return base_estimator. Can be any of "GP", "RF", "ET", "GBRT" or an instance of a class diff --git a/requirements.txt b/requirements.txt index 9101d1689..1b26b5146 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,9 +1,8 @@ -numpy==1.21.5; python_version <= '3.7' -numpy==1.22.1; python_version > '3.7' -pandas==1.3.5 +numpy==1.22.1 +pandas==1.4.0 pandas-ta==0.3.14b -ccxt==1.68.20 +ccxt==1.70.45 # Pin cryptography for now due to rust build errors with piwheels cryptography==36.0.1 aiohttp==3.8.1 diff --git a/setup.cfg b/setup.cfg index c5c7f2f25..6aaec9d73 100644 --- a/setup.cfg +++ b/setup.cfg @@ -14,7 +14,6 @@ classifiers = Environment :: Console Intended Audience :: Science/Research License :: OSI Approved :: GNU General Public License v3 (GPLv3) - Programming Language :: Python :: 3.7 Programming Language :: Python :: 3.8 Programming Language :: Python :: 3.9 Programming Language :: Python :: 3.10 diff --git a/setup.sh b/setup.sh index c642a654d..1df9df606 100755 --- a/setup.sh +++ b/setup.sh @@ -25,7 +25,7 @@ function check_installed_python() { exit 2 fi - for v in 9 10 8 7 + for v in 9 10 8 do PYTHON="python3.${v}" which $PYTHON @@ -219,7 +219,7 @@ function install() { install_redhat else echo "This script does not support your OS." - echo "If you have Python version 3.7 - 3.10, pip, virtualenv, ta-lib you can continue." + echo "If you have Python version 3.8 - 3.10, pip, virtualenv, ta-lib you can continue." echo "Wait 10 seconds to continue the next install steps or use ctrl+c to interrupt this shell." sleep 10 fi @@ -246,7 +246,7 @@ function help() { echo " -p,--plot Install dependencies for Plotting scripts." } -# Verify if 3.7 or 3.8 is installed +# Verify if 3.8+ is installed check_installed_python case $* in