Compare commits
15 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
457b8d8761 | ||
|
|
70dfa1435b | ||
|
|
98fc5b6e65 | ||
|
|
c126c26501 | ||
|
|
2159059b87 | ||
|
|
f0f4faca71 | ||
|
|
0bc647dbd9 | ||
|
|
e3efb72efe | ||
|
|
a9ef63cb20 | ||
|
|
3b0daff2a2 | ||
|
|
67bd4f08e6 | ||
|
|
4c2d291eaf | ||
|
|
85df7faa98 | ||
|
|
8d3ed03184 | ||
|
|
f5870a7540 |
21
.devcontainer/Dockerfile
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
FROM freqtradeorg/freqtrade:develop
|
||||||
|
|
||||||
|
USER root
|
||||||
|
# Install dependencies
|
||||||
|
COPY requirements-dev.txt /freqtrade/
|
||||||
|
|
||||||
|
RUN apt-get update \
|
||||||
|
&& apt-get -y install git mercurial sudo vim build-essential \
|
||||||
|
&& apt-get clean \
|
||||||
|
&& mkdir -p /home/ftuser/.vscode-server /home/ftuser/.vscode-server-insiders /home/ftuser/commandhistory \
|
||||||
|
&& echo "export PROMPT_COMMAND='history -a'" >> /home/ftuser/.bashrc \
|
||||||
|
&& echo "export HISTFILE=~/commandhistory/.bash_history" >> /home/ftuser/.bashrc \
|
||||||
|
&& chown ftuser:ftuser -R /home/ftuser/.local/ \
|
||||||
|
&& chown ftuser: -R /home/ftuser/
|
||||||
|
|
||||||
|
USER ftuser
|
||||||
|
|
||||||
|
RUN pip install --user autopep8 -r docs/requirements-docs.txt -r requirements-dev.txt --no-cache-dir
|
||||||
|
|
||||||
|
# Empty the ENTRYPOINT to allow all commands
|
||||||
|
ENTRYPOINT []
|
||||||
@@ -1,44 +1,39 @@
|
|||||||
{
|
{
|
||||||
"name": "freqtrade Develop",
|
"name": "freqtrade Develop",
|
||||||
"image": "ghcr.io/freqtrade/freqtrade-devcontainer:latest",
|
"build": {
|
||||||
|
"dockerfile": "Dockerfile",
|
||||||
|
"context": ".."
|
||||||
|
},
|
||||||
// Use 'forwardPorts' to make a list of ports inside the container available locally.
|
// Use 'forwardPorts' to make a list of ports inside the container available locally.
|
||||||
"forwardPorts": [
|
"forwardPorts": [
|
||||||
8080
|
8080
|
||||||
],
|
],
|
||||||
"workspaceMount": "source=${localWorkspaceFolder},target=/workspaces/freqtrade,type=bind,consistency=cached",
|
"mounts": [
|
||||||
|
"source=freqtrade-bashhistory,target=/home/ftuser/commandhistory,type=volume"
|
||||||
|
],
|
||||||
// Uncomment to connect as a non-root user if you've added one. See https://aka.ms/vscode-remote/containers/non-root.
|
// Uncomment to connect as a non-root user if you've added one. See https://aka.ms/vscode-remote/containers/non-root.
|
||||||
"remoteUser": "ftuser",
|
"remoteUser": "ftuser",
|
||||||
"onCreateCommand": "pip install --user -e .",
|
|
||||||
"postCreateCommand": "freqtrade create-userdir --userdir user_data/",
|
"postCreateCommand": "freqtrade create-userdir --userdir user_data/",
|
||||||
"workspaceFolder": "/workspaces/freqtrade",
|
|
||||||
"customizations": {
|
"workspaceFolder": "/freqtrade/",
|
||||||
"vscode": {
|
|
||||||
"settings": {
|
"settings": {
|
||||||
"terminal.integrated.shell.linux": "/bin/bash",
|
"terminal.integrated.shell.linux": "/bin/bash",
|
||||||
"editor.insertSpaces": true,
|
"editor.insertSpaces": true,
|
||||||
"files.trimTrailingWhitespace": true,
|
"files.trimTrailingWhitespace": true,
|
||||||
"[markdown]": {
|
"[markdown]": {
|
||||||
"files.trimTrailingWhitespace": false
|
"files.trimTrailingWhitespace": false,
|
||||||
},
|
},
|
||||||
"python.pythonPath": "/usr/local/bin/python",
|
"python.pythonPath": "/usr/local/bin/python",
|
||||||
"[python]": {
|
},
|
||||||
"editor.codeActionsOnSave": {
|
|
||||||
"source.organizeImports": "explicit"
|
// Add the IDs of extensions you want installed when the container is created.
|
||||||
},
|
"extensions": [
|
||||||
"editor.formatOnSave": true,
|
"ms-python.python",
|
||||||
"editor.defaultFormatter": "charliermarsh.ruff"
|
"ms-python.vscode-pylance",
|
||||||
}
|
"davidanson.vscode-markdownlint",
|
||||||
},
|
"ms-azuretools.vscode-docker",
|
||||||
// Add the IDs of extensions you want installed when the container is created.
|
"vscode-icons-team.vscode-icons",
|
||||||
"extensions": [
|
],
|
||||||
"ms-python.python",
|
|
||||||
"ms-python.vscode-pylance",
|
|
||||||
"charliermarsh.ruff",
|
|
||||||
"davidanson.vscode-markdownlint",
|
|
||||||
"ms-azuretools.vscode-docker",
|
|
||||||
"vscode-icons-team.vscode-icons",
|
|
||||||
"github.vscode-github-actions",
|
|
||||||
],
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
21
.github/.devcontainer/Dockerfile
vendored
@@ -1,21 +0,0 @@
|
|||||||
FROM freqtradeorg/freqtrade:develop_freqairl
|
|
||||||
|
|
||||||
USER root
|
|
||||||
# Install dependencies
|
|
||||||
COPY requirements-dev.txt /freqtrade/
|
|
||||||
|
|
||||||
ARG USERNAME=ftuser
|
|
||||||
|
|
||||||
RUN apt-get update \
|
|
||||||
&& apt-get -y install --no-install-recommends apt-utils dialog git ssh vim build-essential zsh \
|
|
||||||
&& apt-get clean \
|
|
||||||
&& mkdir -p /home/${USERNAME}/.vscode-server /home/${USERNAME}/.vscode-server-insiders /home/${USERNAME}/commandhistory \
|
|
||||||
&& chown ${USERNAME}:${USERNAME} -R /home/${USERNAME}/.local/ \
|
|
||||||
&& chown ${USERNAME}: -R /home/${USERNAME}/
|
|
||||||
|
|
||||||
USER ftuser
|
|
||||||
|
|
||||||
RUN pip install --user autopep8 -r docs/requirements-docs.txt -r requirements-dev.txt --no-cache-dir
|
|
||||||
|
|
||||||
# Empty the ENTRYPOINT to allow all commands
|
|
||||||
ENTRYPOINT []
|
|
||||||
12
.github/.devcontainer/devcontainer.json
vendored
@@ -1,12 +0,0 @@
|
|||||||
{
|
|
||||||
"name": "freqtrade Dev container image builder",
|
|
||||||
"build": {
|
|
||||||
"dockerfile": "Dockerfile",
|
|
||||||
"context": "../../"
|
|
||||||
},
|
|
||||||
"features": {
|
|
||||||
"ghcr.io/devcontainers/features/common-utils:2": {
|
|
||||||
},
|
|
||||||
"ghcr.io/stuartleeks/dev-container-features/shell-history:0.0.3": {}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
10
.github/ISSUE_TEMPLATE/bug_report.md
vendored
@@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
name: Bug report
|
name: Bug report
|
||||||
about: Create a report to help us improve. Do not use this for strategy assistance.
|
about: Create a report to help us improve
|
||||||
title: ''
|
title: ''
|
||||||
labels: "Triage Needed"
|
labels: "Triage Needed"
|
||||||
assignees: ''
|
assignees: ''
|
||||||
@@ -12,11 +12,7 @@ Have you searched for similar issues before posting it?
|
|||||||
If you have discovered a bug in the bot, please [search the issue tracker](https://github.com/freqtrade/freqtrade/issues?q=is%3Aissue).
|
If you have discovered a bug in the bot, please [search the issue tracker](https://github.com/freqtrade/freqtrade/issues?q=is%3Aissue).
|
||||||
If it hasn't been reported, please create a new issue.
|
If it hasn't been reported, please create a new issue.
|
||||||
|
|
||||||
Has your strategy or configuration been generated by an AI model, and is now not working?
|
Please do not use bug reports to request new features.
|
||||||
This is almost certainly NOT a bug in Freqtrade, but a problem with the code your AI model generated.
|
|
||||||
Please consult the documentation. We'll close such issues and point to the documentation.
|
|
||||||
|
|
||||||
Please do not use the bug report template to request new features.
|
|
||||||
-->
|
-->
|
||||||
|
|
||||||
## Describe your environment
|
## Describe your environment
|
||||||
@@ -24,7 +20,7 @@ Please do not use the bug report template to request new features.
|
|||||||
* Operating system: ____
|
* Operating system: ____
|
||||||
* Python Version: _____ (`python -V`)
|
* Python Version: _____ (`python -V`)
|
||||||
* CCXT version: _____ (`pip freeze | grep ccxt`)
|
* CCXT version: _____ (`pip freeze | grep ccxt`)
|
||||||
* Freqtrade Version: ____ (`freqtrade -V` or `docker compose run --rm freqtrade -V` for Freqtrade running in docker)
|
* Freqtrade Version: ____ (`freqtrade -V` or `docker-compose run --rm freqtrade -V` for Freqtrade running in docker)
|
||||||
|
|
||||||
Note: All issues other than enhancement requests will be closed without further comment if the above template is deleted or not filled out.
|
Note: All issues other than enhancement requests will be closed without further comment if the above template is deleted or not filled out.
|
||||||
|
|
||||||
|
|||||||
4
.github/ISSUE_TEMPLATE/feature_request.md
vendored
@@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
name: Feature request
|
name: Feature request
|
||||||
about: Suggest a new feature or idea for this project
|
about: Suggest an idea for this project
|
||||||
title: ''
|
title: ''
|
||||||
labels: ''
|
labels: ''
|
||||||
assignees: ''
|
assignees: ''
|
||||||
@@ -18,7 +18,7 @@ Have you search for this feature before requesting it? It's highly likely that a
|
|||||||
* Operating system: ____
|
* Operating system: ____
|
||||||
* Python Version: _____ (`python -V`)
|
* Python Version: _____ (`python -V`)
|
||||||
* CCXT version: _____ (`pip freeze | grep ccxt`)
|
* CCXT version: _____ (`pip freeze | grep ccxt`)
|
||||||
* Freqtrade Version: ____ (`freqtrade -V` or `docker compose run --rm freqtrade -V` for Freqtrade running in docker)
|
* Freqtrade Version: ____ (`freqtrade -V` or `docker-compose run --rm freqtrade -V` for Freqtrade running in docker)
|
||||||
|
|
||||||
|
|
||||||
## Describe the enhancement
|
## Describe the enhancement
|
||||||
|
|||||||
11
.github/ISSUE_TEMPLATE/question.md
vendored
@@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
name: Question
|
name: Question
|
||||||
about: Ask a question you could not find an answer in the docs. Use this template if you've got problems with your strategy.
|
about: Ask a question you could not find an answer in the docs
|
||||||
title: ''
|
title: ''
|
||||||
labels: "Question"
|
labels: "Question"
|
||||||
assignees: ''
|
assignees: ''
|
||||||
@@ -8,12 +8,9 @@ assignees: ''
|
|||||||
---
|
---
|
||||||
<!--
|
<!--
|
||||||
Have you searched for similar issues before posting it?
|
Have you searched for similar issues before posting it?
|
||||||
Did you have a VERY good look at the [documentation](https://www.freqtrade.io/) and are sure that the question is not explained there
|
Did you have a VERY good look at the [documentation](https://www.freqtrade.io/en/latest/) and are sure that the question is not explained there
|
||||||
|
|
||||||
Please do not use the question template to report bugs or to request new features.
|
Please do not use the question template to report bugs or to request new features.
|
||||||
|
|
||||||
Has your strategy or configuration been generated by an AI model, and is now not working?
|
|
||||||
Please consult the documentation. We'll close such issues and point to the documentation.
|
|
||||||
-->
|
-->
|
||||||
|
|
||||||
## Describe your environment
|
## Describe your environment
|
||||||
@@ -21,8 +18,8 @@ Please consult the documentation. We'll close such issues and point to the docum
|
|||||||
* Operating system: ____
|
* Operating system: ____
|
||||||
* Python Version: _____ (`python -V`)
|
* Python Version: _____ (`python -V`)
|
||||||
* CCXT version: _____ (`pip freeze | grep ccxt`)
|
* CCXT version: _____ (`pip freeze | grep ccxt`)
|
||||||
* Freqtrade Version: ____ (`freqtrade -V` or `docker compose run --rm freqtrade -V` for Freqtrade running in docker)
|
* Freqtrade Version: ____ (`freqtrade -V` or `docker-compose run --rm freqtrade -V` for Freqtrade running in docker)
|
||||||
|
|
||||||
## Your question
|
## Your question
|
||||||
|
|
||||||
*Ask the question you have not been able to find an answer in the [Documentation](https://www.freqtrade.io/)*
|
*Ask the question you have not been able to find an answer in the [Documentation](https://www.freqtrade.io/en/latest/)*
|
||||||
|
|||||||
21
.github/dependabot.yml
vendored
@@ -1,34 +1,17 @@
|
|||||||
version: 2
|
version: 2
|
||||||
updates:
|
updates:
|
||||||
- package-ecosystem: docker
|
- package-ecosystem: docker
|
||||||
directories:
|
directory: "/"
|
||||||
- "/"
|
|
||||||
- "/docker"
|
|
||||||
schedule:
|
schedule:
|
||||||
interval: daily
|
interval: daily
|
||||||
ignore:
|
|
||||||
- dependency-name: "*"
|
|
||||||
update-types: ["version-update:semver-major"]
|
|
||||||
open-pull-requests-limit: 10
|
open-pull-requests-limit: 10
|
||||||
|
|
||||||
- package-ecosystem: pip
|
- package-ecosystem: pip
|
||||||
directory: "/"
|
directory: "/"
|
||||||
schedule:
|
schedule:
|
||||||
interval: weekly
|
interval: weekly
|
||||||
time: "03:00"
|
open-pull-requests-limit: 10
|
||||||
timezone: "Etc/UTC"
|
|
||||||
open-pull-requests-limit: 15
|
|
||||||
target-branch: develop
|
target-branch: develop
|
||||||
groups:
|
|
||||||
types:
|
|
||||||
patterns:
|
|
||||||
- "types-*"
|
|
||||||
pytest:
|
|
||||||
patterns:
|
|
||||||
- "pytest*"
|
|
||||||
mkdocs:
|
|
||||||
patterns:
|
|
||||||
- "mkdocs*"
|
|
||||||
|
|
||||||
- package-ecosystem: "github-actions"
|
- package-ecosystem: "github-actions"
|
||||||
directory: "/"
|
directory: "/"
|
||||||
|
|||||||
50
.github/workflows/binance-lev-tier-update.yml
vendored
@@ -1,50 +0,0 @@
|
|||||||
name: Binance Leverage tiers update
|
|
||||||
|
|
||||||
on:
|
|
||||||
schedule:
|
|
||||||
- cron: "0 3 * * 4"
|
|
||||||
# on demand
|
|
||||||
workflow_dispatch:
|
|
||||||
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
auto-update:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
environment:
|
|
||||||
name: develop
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
with:
|
|
||||||
persist-credentials: false
|
|
||||||
|
|
||||||
- uses: actions/setup-python@v5
|
|
||||||
with:
|
|
||||||
python-version: "3.12"
|
|
||||||
|
|
||||||
- name: Install ccxt
|
|
||||||
run: pip install ccxt
|
|
||||||
|
|
||||||
- name: Run leverage tier update
|
|
||||||
env:
|
|
||||||
CI_WEB_PROXY: ${{ secrets.CI_WEB_PROXY }}
|
|
||||||
FREQTRADE__EXCHANGE__KEY: ${{ secrets.BINANCE_EXCHANGE_KEY }}
|
|
||||||
FREQTRADE__EXCHANGE__SECRET: ${{ secrets.BINANCE_EXCHANGE_SECRET }}
|
|
||||||
run: python build_helpers/binance_update_lev_tiers.py
|
|
||||||
|
|
||||||
|
|
||||||
- uses: peter-evans/create-pull-request@271a8d0340265f705b14b6d32b9829c1cb33d45e # v7.0.8
|
|
||||||
with:
|
|
||||||
token: ${{ secrets.REPO_SCOPED_TOKEN }}
|
|
||||||
add-paths: freqtrade/exchange/binance_leverage_tiers.json
|
|
||||||
labels: |
|
|
||||||
Tech maintenance
|
|
||||||
Dependencies
|
|
||||||
branch: update/binance-leverage-tiers
|
|
||||||
title: Update Binance Leverage Tiers
|
|
||||||
commit-message: "chore: update pre-commit hooks"
|
|
||||||
committer: Freqtrade Bot <154552126+freqtrade-bot@users.noreply.github.com>
|
|
||||||
author: Freqtrade Bot <154552126+freqtrade-bot@users.noreply.github.com>
|
|
||||||
body: Update binance leverage tiers.
|
|
||||||
delete-branch: true
|
|
||||||
565
.github/workflows/ci.yml
vendored
@@ -11,114 +11,80 @@ on:
|
|||||||
types: [published]
|
types: [published]
|
||||||
pull_request:
|
pull_request:
|
||||||
schedule:
|
schedule:
|
||||||
- cron: '0 3 * * 4'
|
- cron: '0 5 * * 4'
|
||||||
|
|
||||||
concurrency:
|
concurrency:
|
||||||
group: "${{ github.workflow }}-${{ github.ref }}-${{ github.event_name }}"
|
group: ${{ github.workflow }}-${{ github.ref }}
|
||||||
cancel-in-progress: true
|
cancel-in-progress: true
|
||||||
permissions:
|
|
||||||
repository-projects: read
|
|
||||||
jobs:
|
jobs:
|
||||||
build-linux:
|
build_linux:
|
||||||
|
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
os: [ "ubuntu-22.04", "ubuntu-24.04" ]
|
os: [ ubuntu-18.04, ubuntu-20.04, ubuntu-22.04 ]
|
||||||
python-version: ["3.10", "3.11", "3.12", "3.13"]
|
python-version: ["3.8", "3.9", "3.10.6"]
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v3
|
||||||
with:
|
|
||||||
persist-credentials: false
|
|
||||||
|
|
||||||
- name: Set up Python
|
- name: Set up Python
|
||||||
uses: actions/setup-python@v5
|
uses: actions/setup-python@v4
|
||||||
with:
|
with:
|
||||||
python-version: ${{ matrix.python-version }}
|
python-version: ${{ matrix.python-version }}
|
||||||
|
|
||||||
- name: Install uv
|
|
||||||
uses: astral-sh/setup-uv@bd01e18f51369d5a26f1651c3cb451d3417e3bba # v6.3.1
|
|
||||||
with:
|
|
||||||
activate-environment: true
|
|
||||||
enable-cache: true
|
|
||||||
python-version: ${{ matrix.python-version }}
|
|
||||||
cache-dependency-glob: "requirements**.txt"
|
|
||||||
cache-suffix: "${{ matrix.python-version }}"
|
|
||||||
prune-cache: false
|
|
||||||
|
|
||||||
- name: Cache_dependencies
|
- name: Cache_dependencies
|
||||||
uses: actions/cache@v4
|
uses: actions/cache@v3
|
||||||
id: cache
|
id: cache
|
||||||
with:
|
with:
|
||||||
path: ~/dependencies/
|
path: ~/dependencies/
|
||||||
key: ${{ runner.os }}-dependencies
|
key: ${{ runner.os }}-dependencies
|
||||||
|
|
||||||
|
- name: pip cache (linux)
|
||||||
|
uses: actions/cache@v3
|
||||||
|
if: runner.os == 'Linux'
|
||||||
|
with:
|
||||||
|
path: ~/.cache/pip
|
||||||
|
key: test-${{ matrix.os }}-${{ matrix.python-version }}-pip
|
||||||
|
|
||||||
- name: TA binary *nix
|
- name: TA binary *nix
|
||||||
if: steps.cache.outputs.cache-hit != 'true'
|
if: steps.cache.outputs.cache-hit != 'true'
|
||||||
run: |
|
run: |
|
||||||
cd build_helpers && ./install_ta-lib.sh ${HOME}/dependencies/; cd ..
|
cd build_helpers && ./install_ta-lib.sh ${HOME}/dependencies/; cd ..
|
||||||
|
|
||||||
- name: Installation - *nix
|
- name: Installation - *nix
|
||||||
|
if: runner.os == 'Linux'
|
||||||
run: |
|
run: |
|
||||||
uv pip install --upgrade wheel
|
python -m pip install --upgrade pip wheel
|
||||||
export LD_LIBRARY_PATH=${HOME}/dependencies/lib:$LD_LIBRARY_PATH
|
export LD_LIBRARY_PATH=${HOME}/dependencies/lib:$LD_LIBRARY_PATH
|
||||||
export TA_LIBRARY_PATH=${HOME}/dependencies/lib
|
export TA_LIBRARY_PATH=${HOME}/dependencies/lib
|
||||||
export TA_INCLUDE_PATH=${HOME}/dependencies/include
|
export TA_INCLUDE_PATH=${HOME}/dependencies/include
|
||||||
uv pip install -r requirements-dev.txt
|
pip install -r requirements-dev.txt
|
||||||
uv pip install -e ft_client/
|
pip install -e .
|
||||||
uv pip install -e .
|
|
||||||
|
|
||||||
- name: Check for version alignment
|
|
||||||
run: |
|
|
||||||
python build_helpers/freqtrade_client_version_align.py
|
|
||||||
|
|
||||||
- name: Tests
|
- name: Tests
|
||||||
if: (!(runner.os == 'Linux' && matrix.python-version == '3.12' && matrix.os == 'ubuntu-24.04'))
|
|
||||||
run: |
|
run: |
|
||||||
pytest --random-order
|
pytest --random-order --cov=freqtrade --cov-config=.coveragerc
|
||||||
|
if: matrix.python-version != '3.9' || matrix.os != 'ubuntu-22.04'
|
||||||
|
|
||||||
- name: Tests with Coveralls
|
- name: Tests incl. ccxt compatibility tests
|
||||||
if: (runner.os == 'Linux' && matrix.python-version == '3.12' && matrix.os == 'ubuntu-24.04')
|
|
||||||
run: |
|
run: |
|
||||||
pytest --random-order --cov=freqtrade --cov=freqtrade_client --cov-config=.coveragerc
|
pytest --random-order --cov=freqtrade --cov-config=.coveragerc --longrun
|
||||||
|
if: matrix.python-version == '3.9' && matrix.os == 'ubuntu-22.04'
|
||||||
|
|
||||||
- name: Coveralls
|
- name: Coveralls
|
||||||
if: (runner.os == 'Linux' && matrix.python-version == '3.12' && matrix.os == 'ubuntu-24.04')
|
if: (runner.os == 'Linux' && matrix.python-version == '3.9')
|
||||||
env:
|
env:
|
||||||
# Coveralls token. Not used as secret due to github not providing secrets to forked repositories
|
# Coveralls token. Not used as secret due to github not providing secrets to forked repositories
|
||||||
COVERALLS_REPO_TOKEN: 6D1m0xupS3FgutfuGao8keFf9Hc0FpIXu
|
COVERALLS_REPO_TOKEN: 6D1m0xupS3FgutfuGao8keFf9Hc0FpIXu
|
||||||
run: |
|
run: |
|
||||||
# Allow failure for coveralls
|
# Allow failure for coveralls
|
||||||
uv pip install coveralls
|
|
||||||
coveralls || true
|
coveralls || true
|
||||||
|
|
||||||
- name: Run json schema extract
|
|
||||||
# This should be kept before the repository check to ensure that the schema is up-to-date
|
|
||||||
run: |
|
|
||||||
python build_helpers/extract_config_json_schema.py
|
|
||||||
|
|
||||||
- name: Run command docs partials extract
|
|
||||||
# This should be kept before the repository check to ensure that the docs are up-to-date
|
|
||||||
run: |
|
|
||||||
python build_helpers/create_command_partials.py
|
|
||||||
|
|
||||||
- name: Check for repository changes
|
|
||||||
# TODO: python 3.13 slightly changed the output of argparse.
|
|
||||||
if: (matrix.python-version != '3.13')
|
|
||||||
run: |
|
|
||||||
if [ -n "$(git status --porcelain)" ]; then
|
|
||||||
echo "Repository is dirty, changes detected:"
|
|
||||||
git status
|
|
||||||
git diff
|
|
||||||
exit 1
|
|
||||||
else
|
|
||||||
echo "Repository is clean, no changes detected."
|
|
||||||
fi
|
|
||||||
|
|
||||||
- name: Backtesting (multi)
|
- name: Backtesting (multi)
|
||||||
run: |
|
run: |
|
||||||
cp tests/testdata/config.tests.json config.json
|
cp config_examples/config_bittrex.example.json config.json
|
||||||
freqtrade create-userdir --userdir user_data
|
freqtrade create-userdir --userdir user_data
|
||||||
freqtrade new-strategy -s AwesomeStrategy
|
freqtrade new-strategy -s AwesomeStrategy
|
||||||
freqtrade new-strategy -s AwesomeStrategyMin --template minimal
|
freqtrade new-strategy -s AwesomeStrategyMin --template minimal
|
||||||
@@ -126,267 +92,180 @@ jobs:
|
|||||||
|
|
||||||
- name: Hyperopt
|
- name: Hyperopt
|
||||||
run: |
|
run: |
|
||||||
cp tests/testdata/config.tests.json config.json
|
cp config_examples/config_bittrex.example.json config.json
|
||||||
freqtrade create-userdir --userdir user_data
|
freqtrade create-userdir --userdir user_data
|
||||||
freqtrade hyperopt --datadir tests/testdata -e 6 --strategy SampleStrategy --hyperopt-loss SharpeHyperOptLossDaily --print-all
|
freqtrade hyperopt --datadir tests/testdata -e 5 --strategy SampleStrategy --hyperopt-loss SharpeHyperOptLossDaily --print-all
|
||||||
|
|
||||||
|
- name: Flake8
|
||||||
|
run: |
|
||||||
|
flake8
|
||||||
|
|
||||||
- name: Sort imports (isort)
|
- name: Sort imports (isort)
|
||||||
run: |
|
run: |
|
||||||
isort --check .
|
isort --check .
|
||||||
|
|
||||||
- name: Run Ruff
|
|
||||||
run: |
|
|
||||||
ruff check --output-format=github
|
|
||||||
|
|
||||||
- name: Run Ruff format check
|
|
||||||
run: |
|
|
||||||
ruff format --check
|
|
||||||
|
|
||||||
- name: Mypy
|
- name: Mypy
|
||||||
if: matrix.os == 'ubuntu-24.04'
|
|
||||||
run: |
|
run: |
|
||||||
mypy freqtrade scripts tests
|
mypy freqtrade scripts tests
|
||||||
|
|
||||||
- name: Discord notification
|
- name: Discord notification
|
||||||
uses: rjstone/discord-webhook-notify@c2597273488aeda841dd1e891321952b51f7996f #v2.2.1
|
uses: rjstone/discord-webhook-notify@v1
|
||||||
if: failure() && ( github.event_name != 'pull_request' || github.event.pull_request.head.repo.fork == false)
|
if: failure() && ( github.event_name != 'pull_request' || github.event.pull_request.head.repo.fork == false)
|
||||||
with:
|
with:
|
||||||
severity: error
|
severity: error
|
||||||
details: Freqtrade CI failed on ${{ matrix.os }}
|
details: Freqtrade CI failed on ${{ matrix.os }}
|
||||||
webhookUrl: ${{ secrets.DISCORD_WEBHOOK }}
|
webhookUrl: ${{ secrets.DISCORD_WEBHOOK }}
|
||||||
|
|
||||||
build-macos:
|
build_macos:
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
os: [ "macos-14", "macos-15" ]
|
os: [ macos-latest ]
|
||||||
python-version: ["3.10", "3.11", "3.12", "3.13"]
|
python-version: ["3.8", "3.9", "3.10.6"]
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v3
|
||||||
with:
|
|
||||||
persist-credentials: false
|
|
||||||
|
|
||||||
- name: Set up Python
|
- name: Set up Python
|
||||||
uses: actions/setup-python@v5
|
uses: actions/setup-python@v4
|
||||||
with:
|
with:
|
||||||
python-version: ${{ matrix.python-version }}
|
python-version: ${{ matrix.python-version }}
|
||||||
check-latest: true
|
|
||||||
|
|
||||||
- name: Install uv
|
|
||||||
uses: astral-sh/setup-uv@bd01e18f51369d5a26f1651c3cb451d3417e3bba # v6.3.1
|
|
||||||
with:
|
|
||||||
activate-environment: true
|
|
||||||
enable-cache: true
|
|
||||||
python-version: ${{ matrix.python-version }}
|
|
||||||
cache-dependency-glob: "requirements**.txt"
|
|
||||||
cache-suffix: "${{ matrix.python-version }}"
|
|
||||||
prune-cache: false
|
|
||||||
|
|
||||||
- name: Cache_dependencies
|
- name: Cache_dependencies
|
||||||
uses: actions/cache@v4
|
uses: actions/cache@v3
|
||||||
id: cache
|
id: cache
|
||||||
with:
|
with:
|
||||||
path: ~/dependencies/
|
path: ~/dependencies/
|
||||||
key: ${{ matrix.os }}-dependencies
|
key: ${{ runner.os }}-dependencies
|
||||||
|
|
||||||
|
- name: pip cache (macOS)
|
||||||
|
uses: actions/cache@v3
|
||||||
|
if: runner.os == 'macOS'
|
||||||
|
with:
|
||||||
|
path: ~/Library/Caches/pip
|
||||||
|
key: test-${{ matrix.os }}-${{ matrix.python-version }}-pip
|
||||||
|
|
||||||
- name: TA binary *nix
|
- name: TA binary *nix
|
||||||
if: steps.cache.outputs.cache-hit != 'true'
|
if: steps.cache.outputs.cache-hit != 'true'
|
||||||
run: |
|
run: |
|
||||||
cd build_helpers && ./install_ta-lib.sh ${HOME}/dependencies/; cd ..
|
cd build_helpers && ./install_ta-lib.sh ${HOME}/dependencies/; cd ..
|
||||||
|
|
||||||
- name: Installation - macOS (Brew)
|
- name: Installation - macOS
|
||||||
|
if: runner.os == 'macOS'
|
||||||
run: |
|
run: |
|
||||||
# brew update
|
brew update
|
||||||
# TODO: Should be the brew upgrade
|
brew install hdf5 c-blosc
|
||||||
# homebrew fails to update python due to unlinking failures
|
python -m pip install --upgrade pip wheel
|
||||||
# https://github.com/actions/runner-images/issues/6817
|
|
||||||
rm /usr/local/bin/2to3 || true
|
|
||||||
rm /usr/local/bin/2to3-3.11 || true
|
|
||||||
rm /usr/local/bin/2to3-3.12 || true
|
|
||||||
rm /usr/local/bin/idle3 || true
|
|
||||||
rm /usr/local/bin/idle3.11 || true
|
|
||||||
rm /usr/local/bin/idle3.12 || true
|
|
||||||
rm /usr/local/bin/pydoc3 || true
|
|
||||||
rm /usr/local/bin/pydoc3.11 || true
|
|
||||||
rm /usr/local/bin/pydoc3.12 || true
|
|
||||||
rm /usr/local/bin/python3 || true
|
|
||||||
rm /usr/local/bin/python3.11 || true
|
|
||||||
rm /usr/local/bin/python3.12 || true
|
|
||||||
rm /usr/local/bin/python3-config || true
|
|
||||||
rm /usr/local/bin/python3.11-config || true
|
|
||||||
rm /usr/local/bin/python3.12-config || true
|
|
||||||
|
|
||||||
brew install libomp
|
|
||||||
|
|
||||||
- name: Installation (python)
|
|
||||||
run: |
|
|
||||||
uv pip install wheel
|
|
||||||
export LD_LIBRARY_PATH=${HOME}/dependencies/lib:$LD_LIBRARY_PATH
|
export LD_LIBRARY_PATH=${HOME}/dependencies/lib:$LD_LIBRARY_PATH
|
||||||
export TA_LIBRARY_PATH=${HOME}/dependencies/lib
|
export TA_LIBRARY_PATH=${HOME}/dependencies/lib
|
||||||
export TA_INCLUDE_PATH=${HOME}/dependencies/include
|
export TA_INCLUDE_PATH=${HOME}/dependencies/include
|
||||||
uv pip install -r requirements-dev.txt
|
pip install -r requirements-dev.txt
|
||||||
uv pip install -e ft_client/
|
pip install -e .
|
||||||
uv pip install -e .
|
|
||||||
|
|
||||||
- name: Tests
|
- name: Tests
|
||||||
run: |
|
run: |
|
||||||
pytest --random-order
|
pytest --random-order
|
||||||
|
|
||||||
- name: Check for repository changes
|
|
||||||
run: |
|
|
||||||
if [ -n "$(git status --porcelain)" ]; then
|
|
||||||
echo "Repository is dirty, changes detected:"
|
|
||||||
git status
|
|
||||||
git diff
|
|
||||||
exit 1
|
|
||||||
else
|
|
||||||
echo "Repository is clean, no changes detected."
|
|
||||||
fi
|
|
||||||
|
|
||||||
- name: Backtesting
|
- name: Backtesting
|
||||||
run: |
|
run: |
|
||||||
cp tests/testdata/config.tests.json config.json
|
cp config_examples/config_bittrex.example.json config.json
|
||||||
freqtrade create-userdir --userdir user_data
|
freqtrade create-userdir --userdir user_data
|
||||||
freqtrade new-strategy -s AwesomeStrategyAdv --template advanced
|
freqtrade new-strategy -s AwesomeStrategyAdv --template advanced
|
||||||
freqtrade backtesting --datadir tests/testdata --strategy AwesomeStrategyAdv
|
freqtrade backtesting --datadir tests/testdata --strategy AwesomeStrategyAdv
|
||||||
|
|
||||||
- name: Hyperopt
|
- name: Hyperopt
|
||||||
run: |
|
run: |
|
||||||
cp tests/testdata/config.tests.json config.json
|
cp config_examples/config_bittrex.example.json config.json
|
||||||
freqtrade create-userdir --userdir user_data
|
freqtrade create-userdir --userdir user_data
|
||||||
freqtrade hyperopt --datadir tests/testdata -e 5 --strategy SampleStrategy --hyperopt-loss SharpeHyperOptLossDaily --print-all
|
freqtrade hyperopt --datadir tests/testdata -e 5 --strategy SampleStrategy --hyperopt-loss SharpeHyperOptLossDaily --print-all
|
||||||
|
|
||||||
|
- name: Flake8
|
||||||
|
run: |
|
||||||
|
flake8
|
||||||
|
|
||||||
- name: Sort imports (isort)
|
- name: Sort imports (isort)
|
||||||
run: |
|
run: |
|
||||||
isort --check .
|
isort --check .
|
||||||
|
|
||||||
- name: Run Ruff
|
|
||||||
run: |
|
|
||||||
ruff check --output-format=github
|
|
||||||
|
|
||||||
- name: Run Ruff format check
|
|
||||||
run: |
|
|
||||||
ruff format --check
|
|
||||||
|
|
||||||
- name: Mypy
|
- name: Mypy
|
||||||
if: matrix.os == 'macos-15'
|
|
||||||
run: |
|
run: |
|
||||||
mypy freqtrade scripts
|
mypy freqtrade scripts
|
||||||
|
|
||||||
- name: Discord notification
|
- name: Discord notification
|
||||||
uses: rjstone/discord-webhook-notify@c2597273488aeda841dd1e891321952b51f7996f #v2.2.1
|
uses: rjstone/discord-webhook-notify@v1
|
||||||
if: failure() && ( github.event_name != 'pull_request' || github.event.pull_request.head.repo.fork == false)
|
if: failure() && ( github.event_name != 'pull_request' || github.event.pull_request.head.repo.fork == false)
|
||||||
with:
|
with:
|
||||||
severity: info
|
severity: info
|
||||||
details: Test Succeeded!
|
details: Test Succeeded!
|
||||||
webhookUrl: ${{ secrets.DISCORD_WEBHOOK }}
|
webhookUrl: ${{ secrets.DISCORD_WEBHOOK }}
|
||||||
|
|
||||||
build-windows:
|
build_windows:
|
||||||
|
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
os: [ windows-latest ]
|
os: [ windows-latest ]
|
||||||
python-version: ["3.10", "3.11", "3.12", "3.13"]
|
python-version: ["3.8", "3.9", "3.10.6"]
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v3
|
||||||
with:
|
|
||||||
persist-credentials: false
|
|
||||||
|
|
||||||
- name: Set up Python
|
- name: Set up Python
|
||||||
uses: actions/setup-python@v5
|
uses: actions/setup-python@v4
|
||||||
with:
|
with:
|
||||||
python-version: ${{ matrix.python-version }}
|
python-version: ${{ matrix.python-version }}
|
||||||
|
|
||||||
- name: Install uv
|
- name: Pip cache (Windows)
|
||||||
uses: astral-sh/setup-uv@bd01e18f51369d5a26f1651c3cb451d3417e3bba # v6.3.1
|
uses: actions/cache@v3
|
||||||
with:
|
with:
|
||||||
activate-environment: true
|
path: ~\AppData\Local\pip\Cache
|
||||||
enable-cache: true
|
key: ${{ matrix.os }}-${{ matrix.python-version }}-pip
|
||||||
python-version: ${{ matrix.python-version }}
|
|
||||||
cache-dependency-glob: "requirements**.txt"
|
|
||||||
cache-suffix: "${{ matrix.python-version }}"
|
|
||||||
prune-cache: false
|
|
||||||
|
|
||||||
- name: Installation
|
- name: Installation
|
||||||
run: |
|
run: |
|
||||||
function uvpipFunction { uv pip $args }
|
|
||||||
Set-Alias -name pip -value uvpipFunction
|
|
||||||
|
|
||||||
./build_helpers/install_windows.ps1
|
./build_helpers/install_windows.ps1
|
||||||
|
|
||||||
- name: Tests
|
- name: Tests
|
||||||
run: |
|
run: |
|
||||||
pytest --random-order --durations 20 -n auto
|
pytest --random-order
|
||||||
|
|
||||||
- name: Check for repository changes
|
|
||||||
run: |
|
|
||||||
if (git status --porcelain) {
|
|
||||||
Write-Host "Repository is dirty, changes detected:"
|
|
||||||
git status
|
|
||||||
git diff
|
|
||||||
exit 1
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
Write-Host "Repository is clean, no changes detected."
|
|
||||||
}
|
|
||||||
|
|
||||||
- name: Backtesting
|
- name: Backtesting
|
||||||
run: |
|
run: |
|
||||||
cp tests/testdata/config.tests.json config.json
|
cp config_examples/config_bittrex.example.json config.json
|
||||||
freqtrade create-userdir --userdir user_data
|
freqtrade create-userdir --userdir user_data
|
||||||
freqtrade backtesting --datadir tests/testdata --strategy SampleStrategy
|
freqtrade backtesting --datadir tests/testdata --strategy SampleStrategy
|
||||||
|
|
||||||
- name: Hyperopt
|
- name: Hyperopt
|
||||||
run: |
|
run: |
|
||||||
cp tests/testdata/config.tests.json config.json
|
cp config_examples/config_bittrex.example.json config.json
|
||||||
freqtrade create-userdir --userdir user_data
|
freqtrade create-userdir --userdir user_data
|
||||||
freqtrade hyperopt --datadir tests/testdata -e 5 --strategy SampleStrategy --hyperopt-loss SharpeHyperOptLossDaily --print-all
|
freqtrade hyperopt --datadir tests/testdata -e 5 --strategy SampleStrategy --hyperopt-loss SharpeHyperOptLossDaily --print-all
|
||||||
|
|
||||||
- name: Run Ruff
|
- name: Flake8
|
||||||
run: |
|
run: |
|
||||||
ruff check --output-format=github
|
flake8
|
||||||
|
|
||||||
- name: Run Ruff format check
|
|
||||||
run: |
|
|
||||||
ruff format --check
|
|
||||||
|
|
||||||
- name: Mypy
|
- name: Mypy
|
||||||
run: |
|
run: |
|
||||||
mypy freqtrade scripts tests
|
mypy freqtrade scripts tests
|
||||||
|
|
||||||
- name: Run Pester tests (PowerShell)
|
|
||||||
run: |
|
|
||||||
$PSVersionTable
|
|
||||||
Set-PSRepository psgallery -InstallationPolicy trusted
|
|
||||||
Install-Module -Name Pester -RequiredVersion 5.3.1 -Confirm:$false -Force -SkipPublisherCheck
|
|
||||||
$Error.clear()
|
|
||||||
Invoke-Pester -Path "tests" -CI
|
|
||||||
if ($Error.Length -gt 0) {exit 1}
|
|
||||||
|
|
||||||
shell: powershell
|
|
||||||
|
|
||||||
- name: Discord notification
|
- name: Discord notification
|
||||||
uses: rjstone/discord-webhook-notify@c2597273488aeda841dd1e891321952b51f7996f #v2.2.1
|
uses: rjstone/discord-webhook-notify@v1
|
||||||
if: failure() && ( github.event_name != 'pull_request' || github.event.pull_request.head.repo.fork == false)
|
if: failure() && ( github.event_name != 'pull_request' || github.event.pull_request.head.repo.fork == false)
|
||||||
with:
|
with:
|
||||||
severity: error
|
severity: error
|
||||||
details: Test Failed
|
details: Test Failed
|
||||||
webhookUrl: ${{ secrets.DISCORD_WEBHOOK }}
|
webhookUrl: ${{ secrets.DISCORD_WEBHOOK }}
|
||||||
|
|
||||||
mypy-version-check:
|
mypy_version_check:
|
||||||
runs-on: ubuntu-22.04
|
runs-on: ubuntu-20.04
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v3
|
||||||
with:
|
|
||||||
persist-credentials: false
|
|
||||||
|
|
||||||
- name: Set up Python
|
- name: Set up Python
|
||||||
uses: actions/setup-python@v5
|
uses: actions/setup-python@v4
|
||||||
with:
|
with:
|
||||||
python-version: "3.12"
|
python-version: "3.10"
|
||||||
|
|
||||||
- name: pre-commit dependencies
|
- name: pre-commit dependencies
|
||||||
run: |
|
run: |
|
||||||
@@ -396,238 +275,170 @@ jobs:
|
|||||||
pre-commit:
|
pre-commit:
|
||||||
runs-on: ubuntu-22.04
|
runs-on: ubuntu-22.04
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v3
|
||||||
with:
|
|
||||||
persist-credentials: false
|
|
||||||
|
|
||||||
- uses: actions/setup-python@v5
|
- uses: actions/setup-python@v4
|
||||||
with:
|
with:
|
||||||
python-version: "3.12"
|
python-version: "3.10"
|
||||||
- uses: pre-commit/action@2c7b3805fd2a0fd8c1884dcaebf91fc102a13ecd # v3.0.1
|
- uses: pre-commit/action@v3.0.0
|
||||||
|
|
||||||
docs-check:
|
docs_check:
|
||||||
runs-on: ubuntu-22.04
|
runs-on: ubuntu-20.04
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v3
|
||||||
with:
|
|
||||||
persist-credentials: false
|
|
||||||
|
|
||||||
- name: Documentation syntax
|
- name: Documentation syntax
|
||||||
run: |
|
run: |
|
||||||
./tests/test_docs.sh
|
./tests/test_docs.sh
|
||||||
|
|
||||||
- name: Set up Python
|
- name: Set up Python
|
||||||
uses: actions/setup-python@v5
|
uses: actions/setup-python@v4
|
||||||
with:
|
with:
|
||||||
python-version: "3.12"
|
python-version: "3.10"
|
||||||
|
|
||||||
- name: Documentation build
|
- name: Documentation build
|
||||||
run: |
|
run: |
|
||||||
pip install -r docs/requirements-docs.txt
|
pip install -r docs/requirements-docs.txt
|
||||||
|
pip install mkdocs
|
||||||
mkdocs build
|
mkdocs build
|
||||||
|
|
||||||
- name: Discord notification
|
- name: Discord notification
|
||||||
uses: rjstone/discord-webhook-notify@c2597273488aeda841dd1e891321952b51f7996f #v2.2.1
|
uses: rjstone/discord-webhook-notify@v1
|
||||||
if: failure() && ( github.event_name != 'pull_request' || github.event.pull_request.head.repo.fork == false)
|
if: failure() && ( github.event_name != 'pull_request' || github.event.pull_request.head.repo.fork == false)
|
||||||
with:
|
with:
|
||||||
severity: error
|
severity: error
|
||||||
details: Freqtrade doc test failed!
|
details: Freqtrade doc test failed!
|
||||||
webhookUrl: ${{ secrets.DISCORD_WEBHOOK }}
|
webhookUrl: ${{ secrets.DISCORD_WEBHOOK }}
|
||||||
|
|
||||||
|
# Notify only once - when CI completes (and after deploy) in case it's successfull
|
||||||
build-linux-online:
|
|
||||||
# Run pytest with "live" checks
|
|
||||||
runs-on: ubuntu-24.04
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
with:
|
|
||||||
persist-credentials: false
|
|
||||||
|
|
||||||
- name: Set up Python
|
|
||||||
uses: actions/setup-python@v5
|
|
||||||
with:
|
|
||||||
python-version: "3.12"
|
|
||||||
|
|
||||||
- name: Install uv
|
|
||||||
uses: astral-sh/setup-uv@bd01e18f51369d5a26f1651c3cb451d3417e3bba # v6.3.1
|
|
||||||
with:
|
|
||||||
activate-environment: true
|
|
||||||
enable-cache: true
|
|
||||||
python-version: "3.12"
|
|
||||||
cache-dependency-glob: "requirements**.txt"
|
|
||||||
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 .
|
|
||||||
|
|
||||||
- name: Tests incl. ccxt compatibility tests
|
|
||||||
env:
|
|
||||||
CI_WEB_PROXY: http://152.67.78.211:13128
|
|
||||||
run: |
|
|
||||||
pytest --random-order --longrun --durations 20 -n auto
|
|
||||||
|
|
||||||
|
|
||||||
# Notify only once - when CI completes (and after deploy) in case it's successful
|
|
||||||
notify-complete:
|
notify-complete:
|
||||||
needs: [
|
needs: [ build_linux, build_macos, build_windows, docs_check, mypy_version_check, pre-commit ]
|
||||||
build-linux,
|
runs-on: ubuntu-20.04
|
||||||
build-macos,
|
|
||||||
build-windows,
|
|
||||||
docs-check,
|
|
||||||
mypy-version-check,
|
|
||||||
pre-commit,
|
|
||||||
build-linux-online
|
|
||||||
]
|
|
||||||
runs-on: ubuntu-22.04
|
|
||||||
# Discord notification can't handle schedule events
|
# Discord notification can't handle schedule events
|
||||||
if: github.event_name != 'schedule' && github.repository == 'freqtrade/freqtrade'
|
if: (github.event_name != 'schedule')
|
||||||
permissions:
|
permissions:
|
||||||
repository-projects: read
|
repository-projects: read
|
||||||
steps:
|
steps:
|
||||||
|
|
||||||
- name: Check user permission
|
- name: Check user permission
|
||||||
id: check
|
id: check
|
||||||
uses: scherermichael-oss/action-has-permission@136e061bfe093832d87f090dd768e14e27a740d3 # 1.0.6
|
uses: scherermichael-oss/action-has-permission@1.0.6
|
||||||
with:
|
with:
|
||||||
required-permission: write
|
required-permission: write
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
- name: Discord notification
|
- name: Discord notification
|
||||||
uses: rjstone/discord-webhook-notify@c2597273488aeda841dd1e891321952b51f7996f #v2.2.1
|
uses: rjstone/discord-webhook-notify@v1
|
||||||
if: always() && steps.check.outputs.has-permission && ( github.event_name != 'pull_request' || github.event.pull_request.head.repo.fork == false)
|
if: always() && steps.check.outputs.has-permission && ( github.event_name != 'pull_request' || github.event.pull_request.head.repo.fork == false)
|
||||||
with:
|
with:
|
||||||
severity: info
|
severity: info
|
||||||
details: Test Completed!
|
details: Test Completed!
|
||||||
webhookUrl: ${{ secrets.DISCORD_WEBHOOK }}
|
webhookUrl: ${{ secrets.DISCORD_WEBHOOK }}
|
||||||
|
|
||||||
build:
|
deploy:
|
||||||
name: "Build"
|
needs: [ build_linux, build_macos, build_windows, docs_check, mypy_version_check, pre-commit ]
|
||||||
needs: [ build-linux, build-macos, build-windows, docs-check, mypy-version-check, pre-commit ]
|
runs-on: ubuntu-20.04
|
||||||
runs-on: ubuntu-22.04
|
|
||||||
|
if: (github.event_name == 'push' || github.event_name == 'schedule' || github.event_name == 'release') && github.repository == 'freqtrade/freqtrade'
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v3
|
||||||
with:
|
|
||||||
persist-credentials: false
|
|
||||||
|
|
||||||
- name: Set up Python
|
- name: Set up Python
|
||||||
uses: actions/setup-python@v5
|
uses: actions/setup-python@v4
|
||||||
with:
|
with:
|
||||||
python-version: "3.12"
|
python-version: "3.9"
|
||||||
|
|
||||||
|
- name: Extract branch name
|
||||||
|
shell: bash
|
||||||
|
run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF##*/})"
|
||||||
|
id: extract_branch
|
||||||
|
|
||||||
- name: Build distribution
|
- name: Build distribution
|
||||||
run: |
|
run: |
|
||||||
pip install -U build
|
pip install -U setuptools wheel
|
||||||
python -m build --sdist --wheel
|
python setup.py sdist bdist_wheel
|
||||||
|
|
||||||
- name: Upload artifacts 📦
|
|
||||||
uses: actions/upload-artifact@v4
|
|
||||||
with:
|
|
||||||
name: freqtrade-build
|
|
||||||
path: |
|
|
||||||
dist
|
|
||||||
retention-days: 10
|
|
||||||
|
|
||||||
- name: Build Client distribution
|
|
||||||
run: |
|
|
||||||
pip install -U build
|
|
||||||
python -m build --sdist --wheel ft_client
|
|
||||||
|
|
||||||
- name: Upload artifacts 📦
|
|
||||||
uses: actions/upload-artifact@v4
|
|
||||||
with:
|
|
||||||
name: freqtrade-client-build
|
|
||||||
path: |
|
|
||||||
ft_client/dist
|
|
||||||
retention-days: 10
|
|
||||||
|
|
||||||
deploy-test-pypi:
|
|
||||||
name: "Publish Python 🐍 distribution 📦 to TestPyPI"
|
|
||||||
needs: [ build ]
|
|
||||||
runs-on: ubuntu-22.04
|
|
||||||
if: (github.event_name == 'release')
|
|
||||||
environment:
|
|
||||||
name: testpypi
|
|
||||||
url: https://test.pypi.org/p/freqtrade
|
|
||||||
permissions:
|
|
||||||
id-token: write
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
with:
|
|
||||||
persist-credentials: false
|
|
||||||
|
|
||||||
- name: Download artifact 📦
|
|
||||||
uses: actions/download-artifact@v4
|
|
||||||
with:
|
|
||||||
pattern: freqtrade*-build
|
|
||||||
path: dist
|
|
||||||
merge-multiple: true
|
|
||||||
|
|
||||||
- name: Publish to PyPI (Test)
|
- name: Publish to PyPI (Test)
|
||||||
uses: pypa/gh-action-pypi-publish@76f52bc884231f62b9a034ebfe128415bbaabdfc # v1.12.4
|
uses: pypa/gh-action-pypi-publish@v1.5.1
|
||||||
|
if: (github.event_name == 'release')
|
||||||
with:
|
with:
|
||||||
repository-url: https://test.pypi.org/legacy/
|
user: __token__
|
||||||
|
password: ${{ secrets.pypi_test_password }}
|
||||||
|
repository_url: https://test.pypi.org/legacy/
|
||||||
deploy-pypi:
|
|
||||||
name: "Publish Python 🐍 distribution 📦 to PyPI"
|
|
||||||
needs: [ build ]
|
|
||||||
runs-on: ubuntu-22.04
|
|
||||||
if: (github.event_name == 'release')
|
|
||||||
environment:
|
|
||||||
name: pypi
|
|
||||||
url: https://pypi.org/p/freqtrade
|
|
||||||
permissions:
|
|
||||||
id-token: write
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
with:
|
|
||||||
persist-credentials: false
|
|
||||||
|
|
||||||
- name: Download artifact 📦
|
|
||||||
uses: actions/download-artifact@v4
|
|
||||||
with:
|
|
||||||
pattern: freqtrade*-build
|
|
||||||
path: dist
|
|
||||||
merge-multiple: true
|
|
||||||
|
|
||||||
- name: Publish to PyPI
|
- name: Publish to PyPI
|
||||||
uses: pypa/gh-action-pypi-publish@76f52bc884231f62b9a034ebfe128415bbaabdfc # v1.12.4
|
uses: pypa/gh-action-pypi-publish@v1.5.1
|
||||||
|
if: (github.event_name == 'release')
|
||||||
|
with:
|
||||||
|
user: __token__
|
||||||
|
password: ${{ secrets.pypi_password }}
|
||||||
|
|
||||||
|
- name: Dockerhub login
|
||||||
|
env:
|
||||||
|
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
|
||||||
|
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
|
||||||
|
run: |
|
||||||
|
echo "${DOCKER_PASSWORD}" | docker login --username ${DOCKER_USERNAME} --password-stdin
|
||||||
|
|
||||||
docker-build:
|
# We need docker experimental to pull the ARM image.
|
||||||
name: "Docker Build and Deploy"
|
- name: Switch docker to experimental
|
||||||
needs: [ build-linux, build-macos, build-windows, docs-check, mypy-version-check, pre-commit ]
|
run: |
|
||||||
|
docker version -f '{{.Server.Experimental}}'
|
||||||
|
echo $'{\n "experimental": true\n}' | sudo tee /etc/docker/daemon.json
|
||||||
|
sudo systemctl restart docker
|
||||||
|
docker version -f '{{.Server.Experimental}}'
|
||||||
|
|
||||||
|
- name: Set up Docker Buildx
|
||||||
|
id: buildx
|
||||||
|
uses: crazy-max/ghaction-docker-buildx@v3.3.1
|
||||||
|
with:
|
||||||
|
buildx-version: latest
|
||||||
|
qemu-version: latest
|
||||||
|
|
||||||
|
- name: Available platforms
|
||||||
|
run: echo ${{ steps.buildx.outputs.platforms }}
|
||||||
|
|
||||||
|
- name: Build and test and push docker images
|
||||||
|
env:
|
||||||
|
IMAGE_NAME: freqtradeorg/freqtrade
|
||||||
|
BRANCH_NAME: ${{ steps.extract_branch.outputs.branch }}
|
||||||
|
run: |
|
||||||
|
build_helpers/publish_docker_multi.sh
|
||||||
|
|
||||||
|
deploy_arm:
|
||||||
|
needs: [ deploy ]
|
||||||
|
# Only run on 64bit machines
|
||||||
|
runs-on: [self-hosted, linux, ARM64]
|
||||||
if: (github.event_name == 'push' || github.event_name == 'schedule' || github.event_name == 'release') && github.repository == 'freqtrade/freqtrade'
|
if: (github.event_name == 'push' || github.event_name == 'schedule' || github.event_name == 'release') && github.repository == 'freqtrade/freqtrade'
|
||||||
uses: ./.github/workflows/docker-build.yml
|
|
||||||
permissions:
|
steps:
|
||||||
packages: write
|
- uses: actions/checkout@v3
|
||||||
contents: read
|
|
||||||
secrets:
|
- name: Extract branch name
|
||||||
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
|
shell: bash
|
||||||
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
|
run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF##*/})"
|
||||||
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
|
id: extract_branch
|
||||||
|
|
||||||
|
- name: Dockerhub login
|
||||||
|
env:
|
||||||
|
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
|
||||||
|
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
|
||||||
|
run: |
|
||||||
|
echo "${DOCKER_PASSWORD}" | docker login --username ${DOCKER_USERNAME} --password-stdin
|
||||||
|
|
||||||
|
- name: Build and test and push docker images
|
||||||
|
env:
|
||||||
|
IMAGE_NAME: freqtradeorg/freqtrade
|
||||||
|
BRANCH_NAME: ${{ steps.extract_branch.outputs.branch }}
|
||||||
|
run: |
|
||||||
|
build_helpers/publish_docker_arm64.sh
|
||||||
|
|
||||||
|
- name: Discord notification
|
||||||
|
uses: rjstone/discord-webhook-notify@v1
|
||||||
|
if: always() && ( github.event_name != 'pull_request' || github.event.pull_request.head.repo.fork == false) && (github.event_name != 'schedule')
|
||||||
|
with:
|
||||||
|
severity: info
|
||||||
|
details: Deploy Succeeded!
|
||||||
|
webhookUrl: ${{ secrets.DISCORD_WEBHOOK }}
|
||||||
61
.github/workflows/deploy-docs.yml
vendored
@@ -1,61 +0,0 @@
|
|||||||
name: Build Documentation
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- develop
|
|
||||||
release:
|
|
||||||
types: [published]
|
|
||||||
|
|
||||||
|
|
||||||
# disable permissions for all of the available permissions
|
|
||||||
permissions: {}
|
|
||||||
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
build-docs:
|
|
||||||
permissions:
|
|
||||||
contents: write # for mike to push
|
|
||||||
name: Deploy Docs through mike
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
with:
|
|
||||||
persist-credentials: true
|
|
||||||
|
|
||||||
- name: Set up Python
|
|
||||||
uses: actions/setup-python@v5
|
|
||||||
with:
|
|
||||||
python-version: '3.12'
|
|
||||||
|
|
||||||
- name: Install dependencies
|
|
||||||
run: |
|
|
||||||
python -m pip install --upgrade pip
|
|
||||||
pip install -r docs/requirements-docs.txt
|
|
||||||
|
|
||||||
- name: Fetch gh-pages branch
|
|
||||||
run: |
|
|
||||||
git fetch origin gh-pages --depth=1
|
|
||||||
|
|
||||||
- name: Configure Git user
|
|
||||||
run: |
|
|
||||||
git config --local user.email "github-actions[bot]@users.noreply.github.com"
|
|
||||||
git config --local user.name "github-actions[bot]"
|
|
||||||
|
|
||||||
- name: Build and push Mike
|
|
||||||
if: ${{ github.event_name == 'push' }}
|
|
||||||
run: |
|
|
||||||
mike deploy ${REF_NAME} latest --push --update-aliases
|
|
||||||
env:
|
|
||||||
REF_NAME: ${{ github.ref_name }}
|
|
||||||
|
|
||||||
- name: Build and push Mike - Release
|
|
||||||
if: ${{ github.event_name == 'release' }}
|
|
||||||
run: |
|
|
||||||
mike deploy ${REF_NAME} stable --push --update-aliases
|
|
||||||
env:
|
|
||||||
REF_NAME: ${{ github.ref_name }}
|
|
||||||
|
|
||||||
- name: Show mike versions
|
|
||||||
run: |
|
|
||||||
mike list
|
|
||||||
42
.github/workflows/devcontainer-build.yml
vendored
@@ -1,42 +0,0 @@
|
|||||||
name: Devcontainer Pre-Build
|
|
||||||
|
|
||||||
on:
|
|
||||||
workflow_dispatch:
|
|
||||||
schedule:
|
|
||||||
- cron: "0 3 * * 0"
|
|
||||||
# push:
|
|
||||||
# branches:
|
|
||||||
# - "master"
|
|
||||||
# tags:
|
|
||||||
# - "v*.*.*"
|
|
||||||
# pull_requests:
|
|
||||||
# branches:
|
|
||||||
# - "master"
|
|
||||||
|
|
||||||
concurrency:
|
|
||||||
group: "${{ github.workflow }}"
|
|
||||||
cancel-in-progress: true
|
|
||||||
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
build-and-push:
|
|
||||||
permissions:
|
|
||||||
packages: write
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
with:
|
|
||||||
persist-credentials: false
|
|
||||||
- name: Login to GitHub Container Registry
|
|
||||||
uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3.4.0
|
|
||||||
with:
|
|
||||||
registry: ghcr.io
|
|
||||||
username: ${{ github.actor }}
|
|
||||||
password: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
- name: Pre-build dev container image
|
|
||||||
uses: devcontainers/ci@8bf61b26e9c3a98f69cb6ce2f88d24ff59b785c6 # v0.3.19
|
|
||||||
with:
|
|
||||||
subFolder: .github
|
|
||||||
imageName: ghcr.io/${{ github.repository }}-devcontainer
|
|
||||||
cacheFrom: ghcr.io/${{ github.repository }}-devcontainer
|
|
||||||
push: always
|
|
||||||
132
.github/workflows/docker-build.yml
vendored
@@ -1,132 +0,0 @@
|
|||||||
name: Docker Build and Deploy
|
|
||||||
|
|
||||||
on:
|
|
||||||
workflow_call:
|
|
||||||
secrets:
|
|
||||||
DOCKER_PASSWORD:
|
|
||||||
required: true
|
|
||||||
DOCKER_USERNAME:
|
|
||||||
required: true
|
|
||||||
DISCORD_WEBHOOK:
|
|
||||||
required: false
|
|
||||||
workflow_dispatch:
|
|
||||||
inputs:
|
|
||||||
branch_name:
|
|
||||||
description: 'Branch name to build Docker images for'
|
|
||||||
required: false
|
|
||||||
default: 'develop'
|
|
||||||
type: string
|
|
||||||
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
deploy-docker:
|
|
||||||
runs-on: ubuntu-22.04
|
|
||||||
if: github.repository == 'freqtrade/freqtrade'
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
with:
|
|
||||||
persist-credentials: false
|
|
||||||
|
|
||||||
- name: Set up Python
|
|
||||||
uses: actions/setup-python@v5
|
|
||||||
with:
|
|
||||||
python-version: "3.12"
|
|
||||||
|
|
||||||
- name: Extract branch name
|
|
||||||
id: extract-branch
|
|
||||||
env:
|
|
||||||
BRANCH_NAME_INPUT: ${{ github.event.inputs.branch_name }}
|
|
||||||
run: |
|
|
||||||
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
|
|
||||||
BRANCH_NAME="${BRANCH_NAME_INPUT}"
|
|
||||||
else
|
|
||||||
BRANCH_NAME="${GITHUB_REF##*/}"
|
|
||||||
fi
|
|
||||||
echo "GITHUB_REF='${GITHUB_REF}'"
|
|
||||||
echo "branch=${BRANCH_NAME}" >> "$GITHUB_OUTPUT"
|
|
||||||
|
|
||||||
- name: Dockerhub login
|
|
||||||
env:
|
|
||||||
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
|
|
||||||
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
|
|
||||||
run: |
|
|
||||||
echo "${DOCKER_PASSWORD}" | docker login --username ${DOCKER_USERNAME} --password-stdin
|
|
||||||
|
|
||||||
# We need docker experimental to pull the ARM image.
|
|
||||||
- name: Switch docker to experimental
|
|
||||||
run: |
|
|
||||||
docker version -f '{{.Server.Experimental}}'
|
|
||||||
echo $'{\n "experimental": true\n}' | sudo tee /etc/docker/daemon.json
|
|
||||||
sudo systemctl restart docker
|
|
||||||
docker version -f '{{.Server.Experimental}}'
|
|
||||||
|
|
||||||
- name: Set up QEMU
|
|
||||||
uses: docker/setup-qemu-action@29109295f81e9208d7d86ff1c6c12d2833863392 # v3.6.0
|
|
||||||
|
|
||||||
- name: Set up Docker Buildx
|
|
||||||
id: buildx
|
|
||||||
uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 #v3.11.1
|
|
||||||
|
|
||||||
- name: Available platforms
|
|
||||||
run: echo ${PLATFORMS}
|
|
||||||
env:
|
|
||||||
PLATFORMS: ${{ steps.buildx.outputs.platforms }}
|
|
||||||
|
|
||||||
- name: Build and test and push docker images
|
|
||||||
env:
|
|
||||||
BRANCH_NAME: ${{ steps.extract-branch.outputs.branch }}
|
|
||||||
run: |
|
|
||||||
build_helpers/publish_docker_multi.sh
|
|
||||||
|
|
||||||
deploy-arm:
|
|
||||||
name: "Deploy Docker"
|
|
||||||
permissions:
|
|
||||||
packages: write
|
|
||||||
needs: [ deploy-docker ]
|
|
||||||
# Only run on 64bit machines
|
|
||||||
runs-on: [self-hosted, linux, ARM64]
|
|
||||||
if: github.repository == 'freqtrade/freqtrade'
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
with:
|
|
||||||
persist-credentials: false
|
|
||||||
|
|
||||||
- name: Extract branch name
|
|
||||||
id: extract-branch
|
|
||||||
env:
|
|
||||||
BRANCH_NAME_INPUT: ${{ github.event.inputs.branch_name }}
|
|
||||||
run: |
|
|
||||||
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
|
|
||||||
BRANCH_NAME="${BRANCH_NAME_INPUT}"
|
|
||||||
else
|
|
||||||
BRANCH_NAME="${GITHUB_REF##*/}"
|
|
||||||
fi
|
|
||||||
echo "GITHUB_REF='${GITHUB_REF}'"
|
|
||||||
echo "branch=${BRANCH_NAME}" >> "$GITHUB_OUTPUT"
|
|
||||||
|
|
||||||
- name: Dockerhub login
|
|
||||||
env:
|
|
||||||
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
|
|
||||||
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
|
|
||||||
run: |
|
|
||||||
echo "${DOCKER_PASSWORD}" | docker login --username ${DOCKER_USERNAME} --password-stdin
|
|
||||||
|
|
||||||
- name: Build and test and push docker images
|
|
||||||
env:
|
|
||||||
BRANCH_NAME: ${{ steps.extract-branch.outputs.branch }}
|
|
||||||
GHCR_USERNAME: ${{ github.actor }}
|
|
||||||
GHCR_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
run: |
|
|
||||||
build_helpers/publish_docker_arm64.sh
|
|
||||||
|
|
||||||
- name: Discord notification
|
|
||||||
uses: rjstone/discord-webhook-notify@c2597273488aeda841dd1e891321952b51f7996f #v2.2.1
|
|
||||||
if: always() && ( github.event_name != 'pull_request' || github.event.pull_request.head.repo.fork == false) && (github.event_name != 'schedule')
|
|
||||||
with:
|
|
||||||
severity: info
|
|
||||||
details: Deploy Succeeded!
|
|
||||||
webhookUrl: ${{ secrets.DISCORD_WEBHOOK }}
|
|
||||||
23
.github/workflows/docker-update-readme.yml
vendored
@@ -1,23 +0,0 @@
|
|||||||
name: Update Docker Hub Description
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- stable
|
|
||||||
|
|
||||||
# disable permissions for all of the available permissions
|
|
||||||
permissions: {}
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
dockerHubDescription:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
with:
|
|
||||||
persist-credentials: false
|
|
||||||
|
|
||||||
- name: Docker Hub Description
|
|
||||||
uses: peter-evans/dockerhub-description@432a30c9e07499fd01da9f8a49f0faf9e0ca5b77 # v4.0.2
|
|
||||||
with:
|
|
||||||
username: ${{ secrets.DOCKER_USERNAME }}
|
|
||||||
password: ${{ secrets.DOCKER_PASSWORD }}
|
|
||||||
repository: freqtradeorg/freqtrade
|
|
||||||
17
.github/workflows/docker_update_readme.yml
vendored
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
name: Update Docker Hub Description
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- stable
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
dockerHubDescription:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
- name: Docker Hub Description
|
||||||
|
uses: peter-evans/dockerhub-description@v3
|
||||||
|
env:
|
||||||
|
DOCKERHUB_USERNAME: ${{ secrets.DOCKER_USERNAME }}
|
||||||
|
DOCKERHUB_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
|
||||||
|
DOCKERHUB_REPOSITORY: freqtradeorg/freqtrade
|
||||||
23
.github/workflows/draft-pdf.yml
vendored
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
on: [push]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
paper:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
name: Paper Draft
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
- name: Build draft PDF
|
||||||
|
uses: openjournals/openjournals-draft-action@master
|
||||||
|
with:
|
||||||
|
journal: joss
|
||||||
|
# This should be the path to the paper within your repo.
|
||||||
|
paper-path: docs/JOSS_paper/paper.md
|
||||||
|
- name: Upload
|
||||||
|
uses: actions/upload-artifact@v1
|
||||||
|
with:
|
||||||
|
name: paper
|
||||||
|
# This is the output path where Pandoc will write the compiled
|
||||||
|
# PDF. Note, this should be the same directory as the input
|
||||||
|
# paper.md
|
||||||
|
path: docs/JOSS_paper/paper.pdf
|
||||||
44
.github/workflows/pre-commit-update.yml
vendored
@@ -1,44 +0,0 @@
|
|||||||
name: Pre-commit auto-update
|
|
||||||
|
|
||||||
on:
|
|
||||||
schedule:
|
|
||||||
- cron: "0 3 * * 2"
|
|
||||||
# on demand
|
|
||||||
workflow_dispatch:
|
|
||||||
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
auto-update:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
with:
|
|
||||||
persist-credentials: false
|
|
||||||
|
|
||||||
- uses: actions/setup-python@v5
|
|
||||||
with:
|
|
||||||
python-version: "3.12"
|
|
||||||
|
|
||||||
|
|
||||||
- name: Install pre-commit
|
|
||||||
run: pip install pre-commit
|
|
||||||
|
|
||||||
- name: Run auto-update
|
|
||||||
run: pre-commit autoupdate
|
|
||||||
|
|
||||||
- uses: peter-evans/create-pull-request@271a8d0340265f705b14b6d32b9829c1cb33d45e # v7.0.8
|
|
||||||
with:
|
|
||||||
token: ${{ secrets.REPO_SCOPED_TOKEN }}
|
|
||||||
add-paths: .pre-commit-config.yaml
|
|
||||||
labels: |
|
|
||||||
Tech maintenance
|
|
||||||
Dependencies
|
|
||||||
branch: update/pre-commit-hooks
|
|
||||||
title: Update pre-commit hooks
|
|
||||||
commit-message: "chore: update pre-commit hooks"
|
|
||||||
committer: Freqtrade Bot <154552126+freqtrade-bot@users.noreply.github.com>
|
|
||||||
author: Freqtrade Bot <154552126+freqtrade-bot@users.noreply.github.com>
|
|
||||||
body: Update versions of pre-commit hooks to latest version.
|
|
||||||
delete-branch: true
|
|
||||||
8
.gitignore
vendored
@@ -83,9 +83,6 @@ instance/
|
|||||||
# Scrapy stuff:
|
# Scrapy stuff:
|
||||||
.scrapy
|
.scrapy
|
||||||
|
|
||||||
# memray
|
|
||||||
memray-*
|
|
||||||
|
|
||||||
# Sphinx documentation
|
# Sphinx documentation
|
||||||
docs/_build/
|
docs/_build/
|
||||||
# Mkdocs documentation
|
# Mkdocs documentation
|
||||||
@@ -111,8 +108,9 @@ target/
|
|||||||
#exceptions
|
#exceptions
|
||||||
!*.gitkeep
|
!*.gitkeep
|
||||||
!config_examples/config_binance.example.json
|
!config_examples/config_binance.example.json
|
||||||
|
!config_examples/config_bittrex.example.json
|
||||||
|
!config_examples/config_ftx.example.json
|
||||||
!config_examples/config_full.example.json
|
!config_examples/config_full.example.json
|
||||||
!config_examples/config_kraken.example.json
|
!config_examples/config_kraken.example.json
|
||||||
!config_examples/config_freqai.example.json
|
!config_examples/config_freqai.example.json
|
||||||
|
!config_examples/config_freqai-rl.example.json
|
||||||
docker-compose-*.yml
|
|
||||||
|
|||||||
@@ -1,55 +1,34 @@
|
|||||||
# See https://pre-commit.com for more information
|
# See https://pre-commit.com for more information
|
||||||
# See https://pre-commit.com/hooks.html for more hooks
|
# See https://pre-commit.com/hooks.html for more hooks
|
||||||
repos:
|
repos:
|
||||||
|
|
||||||
- repo: local
|
|
||||||
# Keep json schema in sync with the config schema
|
|
||||||
# This will write the files - and fail pre-commit if a file has been changed.
|
|
||||||
hooks:
|
|
||||||
- id: Extract config json schema
|
|
||||||
name: extract-config-json-schema
|
|
||||||
entry: "python build_helpers/extract_config_json_schema.py"
|
|
||||||
language: python
|
|
||||||
pass_filenames: false
|
|
||||||
additional_dependencies: ["python-rapidjson", "jsonschema"]
|
|
||||||
|
|
||||||
- repo: https://github.com/pycqa/flake8
|
- repo: https://github.com/pycqa/flake8
|
||||||
rev: "7.3.0"
|
rev: "4.0.1"
|
||||||
hooks:
|
hooks:
|
||||||
- id: flake8
|
- id: flake8
|
||||||
additional_dependencies: [Flake8-pyproject]
|
|
||||||
# stages: [push]
|
# stages: [push]
|
||||||
|
|
||||||
- repo: https://github.com/pre-commit/mirrors-mypy
|
- repo: https://github.com/pre-commit/mirrors-mypy
|
||||||
rev: "v1.16.1"
|
rev: "v0.942"
|
||||||
hooks:
|
hooks:
|
||||||
- id: mypy
|
- id: mypy
|
||||||
exclude: build_helpers
|
exclude: build_helpers
|
||||||
additional_dependencies:
|
additional_dependencies:
|
||||||
- types-cachetools==6.0.0.20250525
|
- types-cachetools==5.2.1
|
||||||
- types-filelock==3.2.7
|
- types-filelock==3.2.7
|
||||||
- types-requests==2.32.4.20250611
|
- types-requests==2.28.11
|
||||||
- types-tabulate==0.9.0.20241207
|
- types-tabulate==0.8.11
|
||||||
- types-python-dateutil==2.9.0.20250516
|
- types-python-dateutil==2.8.19
|
||||||
- SQLAlchemy==2.0.41
|
|
||||||
# stages: [push]
|
# stages: [push]
|
||||||
|
|
||||||
- repo: https://github.com/pycqa/isort
|
- repo: https://github.com/pycqa/isort
|
||||||
rev: "6.0.1"
|
rev: "5.10.1"
|
||||||
hooks:
|
hooks:
|
||||||
- id: isort
|
- id: isort
|
||||||
name: isort (python)
|
name: isort (python)
|
||||||
# stages: [push]
|
# stages: [push]
|
||||||
|
|
||||||
- repo: https://github.com/charliermarsh/ruff-pre-commit
|
|
||||||
# Ruff version.
|
|
||||||
rev: 'v0.12.1'
|
|
||||||
hooks:
|
|
||||||
- id: ruff
|
|
||||||
- id: ruff-format
|
|
||||||
|
|
||||||
- repo: https://github.com/pre-commit/pre-commit-hooks
|
- repo: https://github.com/pre-commit/pre-commit-hooks
|
||||||
rev: v5.0.0
|
rev: v2.4.0
|
||||||
hooks:
|
hooks:
|
||||||
- id: end-of-file-fixer
|
- id: end-of-file-fixer
|
||||||
exclude: |
|
exclude: |
|
||||||
@@ -67,21 +46,3 @@ repos:
|
|||||||
(?x)^(
|
(?x)^(
|
||||||
.*\.md
|
.*\.md
|
||||||
)$
|
)$
|
||||||
|
|
||||||
- repo: https://github.com/stefmolin/exif-stripper
|
|
||||||
rev: 1.0.0
|
|
||||||
hooks:
|
|
||||||
- id: strip-exif
|
|
||||||
|
|
||||||
- repo: https://github.com/codespell-project/codespell
|
|
||||||
rev: v2.4.1
|
|
||||||
hooks:
|
|
||||||
- id: codespell
|
|
||||||
additional_dependencies:
|
|
||||||
- tomli
|
|
||||||
|
|
||||||
# Ensure github actions remain safe
|
|
||||||
- repo: https://github.com/woodruffw/zizmor-pre-commit
|
|
||||||
rev: v1.11.0
|
|
||||||
hooks:
|
|
||||||
- id: zizmor
|
|
||||||
|
|||||||
@@ -1,14 +1,8 @@
|
|||||||
# .readthedocs.yml
|
# .readthedocs.yml
|
||||||
version: 2
|
|
||||||
|
|
||||||
build:
|
build:
|
||||||
os: "ubuntu-22.04"
|
image: latest
|
||||||
tools:
|
|
||||||
python: "3.11"
|
|
||||||
|
|
||||||
python:
|
python:
|
||||||
install:
|
version: 3.8
|
||||||
- requirements: docs/requirements-docs.txt
|
setup_py_install: false
|
||||||
|
|
||||||
mkdocs:
|
|
||||||
configuration: mkdocs.yml
|
|
||||||
|
|||||||
11
.vscode/extensions.json
vendored
@@ -1,11 +0,0 @@
|
|||||||
{
|
|
||||||
"recommendations": [
|
|
||||||
"ms-python.python",
|
|
||||||
"ms-python.vscode-pylance",
|
|
||||||
"charliermarsh.ruff",
|
|
||||||
"davidanson.vscode-markdownlint",
|
|
||||||
"ms-azuretools.vscode-docker",
|
|
||||||
"vscode-icons-team.vscode-icons",
|
|
||||||
"github.vscode-github-actions",
|
|
||||||
]
|
|
||||||
}
|
|
||||||
@@ -45,17 +45,16 @@ pytest tests/test_<file_name>.py::test_<method_name>
|
|||||||
|
|
||||||
### 2. Test if your code is PEP8 compliant
|
### 2. Test if your code is PEP8 compliant
|
||||||
|
|
||||||
#### Run Ruff
|
#### Run Flake8
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
ruff check .
|
flake8 freqtrade tests scripts
|
||||||
```
|
```
|
||||||
|
|
||||||
We receive a lot of code that fails the `ruff` checks.
|
We receive a lot of code that fails the `flake8` checks.
|
||||||
To help with that, we encourage you to install the git pre-commit
|
To help with that, we encourage you to install the git pre-commit
|
||||||
hook that will warn you when you try to commit code that fails these checks.
|
hook that will warn you when you try to commit code that fails these checks.
|
||||||
|
Guide for installing them is [here](http://flake8.pycqa.org/en/latest/user/using-hooks.html).
|
||||||
you can manually run pre-commit with `pre-commit run -a`.
|
|
||||||
|
|
||||||
##### Additional styles applied
|
##### Additional styles applied
|
||||||
|
|
||||||
@@ -72,12 +71,12 @@ you can manually run pre-commit with `pre-commit run -a`.
|
|||||||
mypy freqtrade
|
mypy freqtrade
|
||||||
```
|
```
|
||||||
|
|
||||||
### 4. Ensure formatting is correct
|
### 4. Ensure all imports are correct
|
||||||
|
|
||||||
#### Run ruff
|
#### Run isort
|
||||||
|
|
||||||
``` bash
|
``` bash
|
||||||
ruff format .
|
isort .
|
||||||
```
|
```
|
||||||
|
|
||||||
## (Core)-Committer Guide
|
## (Core)-Committer Guide
|
||||||
@@ -125,7 +124,7 @@ Exceptions:
|
|||||||
|
|
||||||
Contributors may be given commit privileges. Preference will be given to those with:
|
Contributors may be given commit privileges. Preference will be given to those with:
|
||||||
|
|
||||||
1. Past contributions to Freqtrade and other related open-source projects. Contributions to Freqtrade include both code (both accepted and pending) and friendly participation in the issue tracker and Pull request reviews. Both quantity and quality are considered.
|
1. Past contributions to Freqtrade and other related open-source projects. Contributions to Freqtrade include both code (both accepted and pending) and friendly participation in the issue tracker and Pull request reviews. Quantity and quality are considered.
|
||||||
1. A coding style that the other core committers find simple, minimal, and clean.
|
1. A coding style that the other core committers find simple, minimal, and clean.
|
||||||
1. Access to resources for cross-platform development and testing.
|
1. Access to resources for cross-platform development and testing.
|
||||||
1. Time to devote to the project regularly.
|
1. Time to devote to the project regularly.
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
FROM python:3.13.5-slim-bookworm as base
|
FROM python:3.10.7-slim-bullseye as base
|
||||||
|
|
||||||
# Setup env
|
# Setup env
|
||||||
ENV LANG C.UTF-8
|
ENV LANG C.UTF-8
|
||||||
@@ -11,7 +11,7 @@ ENV FT_APP_ENV="docker"
|
|||||||
# Prepare environment
|
# Prepare environment
|
||||||
RUN mkdir /freqtrade \
|
RUN mkdir /freqtrade \
|
||||||
&& apt-get update \
|
&& apt-get update \
|
||||||
&& apt-get -y install sudo libatlas3-base curl sqlite3 libgomp1 \
|
&& apt-get -y install sudo libatlas3-base curl sqlite3 libhdf5-serial-dev libgomp1 \
|
||||||
&& apt-get clean \
|
&& apt-get clean \
|
||||||
&& useradd -u 1000 -G sudo -U -m -s /bin/bash ftuser \
|
&& useradd -u 1000 -G sudo -U -m -s /bin/bash ftuser \
|
||||||
&& chown ftuser:ftuser /freqtrade \
|
&& chown ftuser:ftuser /freqtrade \
|
||||||
@@ -25,7 +25,7 @@ FROM base as python-deps
|
|||||||
RUN apt-get update \
|
RUN apt-get update \
|
||||||
&& apt-get -y install build-essential libssl-dev git libffi-dev libgfortran5 pkg-config cmake gcc \
|
&& apt-get -y install build-essential libssl-dev git libffi-dev libgfortran5 pkg-config cmake gcc \
|
||||||
&& apt-get clean \
|
&& apt-get clean \
|
||||||
&& pip install --upgrade pip wheel
|
&& pip install --upgrade pip
|
||||||
|
|
||||||
# Install TA-lib
|
# Install TA-lib
|
||||||
COPY build_helpers/* /tmp/
|
COPY build_helpers/* /tmp/
|
||||||
@@ -35,7 +35,7 @@ ENV LD_LIBRARY_PATH /usr/local/lib
|
|||||||
# Install dependencies
|
# Install dependencies
|
||||||
COPY --chown=ftuser:ftuser requirements.txt requirements-hyperopt.txt /freqtrade/
|
COPY --chown=ftuser:ftuser requirements.txt requirements-hyperopt.txt /freqtrade/
|
||||||
USER ftuser
|
USER ftuser
|
||||||
RUN pip install --user --no-cache-dir "numpy<3.0" \
|
RUN pip install --user --no-cache-dir numpy \
|
||||||
&& pip install --user --no-cache-dir -r requirements-hyperopt.txt
|
&& pip install --user --no-cache-dir -r requirements-hyperopt.txt
|
||||||
|
|
||||||
# Copy dependencies to runtime-image
|
# Copy dependencies to runtime-image
|
||||||
|
|||||||
@@ -5,5 +5,3 @@ recursive-include freqtrade/templates/ *.j2 *.ipynb
|
|||||||
include freqtrade/exchange/binance_leverage_tiers.json
|
include freqtrade/exchange/binance_leverage_tiers.json
|
||||||
include freqtrade/rpc/api_server/ui/fallback_file.html
|
include freqtrade/rpc/api_server/ui/fallback_file.html
|
||||||
include freqtrade/rpc/api_server/ui/favicon.ico
|
include freqtrade/rpc/api_server/ui/favicon.ico
|
||||||
|
|
||||||
prune tests
|
|
||||||
|
|||||||
49
README.md
@@ -1,7 +1,6 @@
|
|||||||
# 
|
# 
|
||||||
|
|
||||||
[](https://github.com/freqtrade/freqtrade/actions/)
|
[](https://github.com/freqtrade/freqtrade/actions/)
|
||||||
[](https://doi.org/10.21105/joss.04864)
|
|
||||||
[](https://coveralls.io/github/freqtrade/freqtrade?branch=develop)
|
[](https://coveralls.io/github/freqtrade/freqtrade?branch=develop)
|
||||||
[](https://www.freqtrade.io)
|
[](https://www.freqtrade.io)
|
||||||
[](https://codeclimate.com/github/freqtrade/freqtrade/maintainability)
|
[](https://codeclimate.com/github/freqtrade/freqtrade/maintainability)
|
||||||
@@ -28,24 +27,19 @@ hesitate to read the source code and understand the mechanism of this bot.
|
|||||||
Please read the [exchange specific notes](docs/exchanges.md) to learn about eventual, special configurations needed for each exchange.
|
Please read the [exchange specific notes](docs/exchanges.md) to learn about eventual, special configurations needed for each exchange.
|
||||||
|
|
||||||
- [X] [Binance](https://www.binance.com/)
|
- [X] [Binance](https://www.binance.com/)
|
||||||
- [X] [Bitmart](https://bitmart.com/)
|
- [X] [Bittrex](https://bittrex.com/)
|
||||||
- [X] [BingX](https://bingx.com/invite/0EM9RX)
|
- [X] [FTX](https://ftx.com/#a=2258149)
|
||||||
- [X] [Bybit](https://bybit.com/)
|
|
||||||
- [X] [Gate.io](https://www.gate.io/ref/6266643)
|
- [X] [Gate.io](https://www.gate.io/ref/6266643)
|
||||||
- [X] [HTX](https://www.htx.com/)
|
- [X] [Huobi](http://huobi.com/)
|
||||||
- [X] [Hyperliquid](https://hyperliquid.xyz/) (A decentralized exchange, or DEX)
|
|
||||||
- [X] [Kraken](https://kraken.com/)
|
- [X] [Kraken](https://kraken.com/)
|
||||||
- [X] [OKX](https://okx.com/)
|
- [X] [OKX](https://okx.com/) (Former OKEX)
|
||||||
- [X] [MyOKX](https://okx.com/) (OKX EEA)
|
|
||||||
- [ ] [potentially many others](https://github.com/ccxt/ccxt/). _(We cannot guarantee they will work)_
|
- [ ] [potentially many others](https://github.com/ccxt/ccxt/). _(We cannot guarantee they will work)_
|
||||||
|
|
||||||
### Supported Futures Exchanges (experimental)
|
### Supported Futures Exchanges (experimental)
|
||||||
|
|
||||||
- [X] [Binance](https://www.binance.com/)
|
- [X] [Binance](https://www.binance.com/)
|
||||||
- [X] [Gate.io](https://www.gate.io/ref/6266643)
|
- [X] [Gate.io](https://www.gate.io/ref/6266643)
|
||||||
- [X] [Hyperliquid](https://hyperliquid.xyz/) (A decentralized exchange, or DEX)
|
- [X] [OKX](https://okx.com/).
|
||||||
- [X] [OKX](https://okx.com/)
|
|
||||||
- [X] [Bybit](https://bybit.com/)
|
|
||||||
|
|
||||||
Please make sure to read the [exchange specific notes](docs/exchanges.md), as well as the [trading with leverage](docs/leverage.md) documentation before diving in.
|
Please make sure to read the [exchange specific notes](docs/exchanges.md), as well as the [trading with leverage](docs/leverage.md) documentation before diving in.
|
||||||
|
|
||||||
@@ -64,12 +58,13 @@ Please find the complete documentation on the [freqtrade website](https://www.fr
|
|||||||
|
|
||||||
## Features
|
## Features
|
||||||
|
|
||||||
- [x] **Based on Python 3.10+**: 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] **Persistence**: Persistence is achieved through sqlite.
|
||||||
- [x] **Dry-run**: Run the bot without paying money.
|
- [x] **Dry-run**: Run the bot without paying money.
|
||||||
- [x] **Backtesting**: Run a simulation of your buy/sell strategy.
|
- [x] **Backtesting**: Run a simulation of your buy/sell strategy.
|
||||||
- [x] **Strategy Optimization by machine learning**: Use machine learning to optimize your buy/sell strategy parameters with real exchange data.
|
- [x] **Strategy Optimization by machine learning**: Use machine learning to optimize your buy/sell strategy parameters with real exchange data.
|
||||||
- [X] **Adaptive prediction modeling**: Build a smart strategy with FreqAI that self-trains to the market via adaptive machine learning methods. [Learn more](https://www.freqtrade.io/en/stable/freqai/)
|
- [X] **Adaptive prediction modeling**: Build a smart strategy with FreqAI that self-trains to the market via adaptive machine learning methods. [Learn more](https://www.freqtrade.io/en/stable/freqai/)
|
||||||
|
- [x] **Edge position sizing** Calculate your win rate, risk reward ratio, the best stoploss and adjust your position size before taking a position for each specific market. [Learn more](https://www.freqtrade.io/en/stable/edge/).
|
||||||
- [x] **Whitelist crypto-currencies**: Select which crypto-currency you want to trade or use dynamic whitelists.
|
- [x] **Whitelist crypto-currencies**: Select which crypto-currency you want to trade or use dynamic whitelists.
|
||||||
- [x] **Blacklist crypto-currencies**: Select which crypto-currency you want to avoid.
|
- [x] **Blacklist crypto-currencies**: Select which crypto-currency you want to avoid.
|
||||||
- [x] **Builtin WebUI**: Builtin web UI to manage your bot.
|
- [x] **Builtin WebUI**: Builtin web UI to manage your bot.
|
||||||
@@ -89,52 +84,44 @@ For further (native) installation methods, please refer to the [Installation doc
|
|||||||
|
|
||||||
```
|
```
|
||||||
usage: freqtrade [-h] [-V]
|
usage: freqtrade [-h] [-V]
|
||||||
{trade,create-userdir,new-config,show-config,new-strategy,download-data,convert-data,convert-trade-data,trades-to-ohlcv,list-data,backtesting,backtesting-show,backtesting-analysis,edge,hyperopt,hyperopt-list,hyperopt-show,list-exchanges,list-markets,list-pairs,list-strategies,list-hyperoptloss,list-freqaimodels,list-timeframes,show-trades,test-pairlist,convert-db,install-ui,plot-dataframe,plot-profit,webserver,strategy-updater,lookahead-analysis,recursive-analysis}
|
{trade,create-userdir,new-config,new-strategy,download-data,convert-data,convert-trade-data,list-data,backtesting,edge,hyperopt,hyperopt-list,hyperopt-show,list-exchanges,list-hyperopts,list-markets,list-pairs,list-strategies,list-timeframes,show-trades,test-pairlist,install-ui,plot-dataframe,plot-profit,webserver}
|
||||||
...
|
...
|
||||||
|
|
||||||
Free, open source crypto trading bot
|
Free, open source crypto trading bot
|
||||||
|
|
||||||
positional arguments:
|
positional arguments:
|
||||||
{trade,create-userdir,new-config,show-config,new-strategy,download-data,convert-data,convert-trade-data,trades-to-ohlcv,list-data,backtesting,backtesting-show,backtesting-analysis,edge,hyperopt,hyperopt-list,hyperopt-show,list-exchanges,list-markets,list-pairs,list-strategies,list-hyperoptloss,list-freqaimodels,list-timeframes,show-trades,test-pairlist,convert-db,install-ui,plot-dataframe,plot-profit,webserver,strategy-updater,lookahead-analysis,recursive-analysis}
|
{trade,create-userdir,new-config,new-strategy,download-data,convert-data,convert-trade-data,list-data,backtesting,edge,hyperopt,hyperopt-list,hyperopt-show,list-exchanges,list-hyperopts,list-markets,list-pairs,list-strategies,list-timeframes,show-trades,test-pairlist,install-ui,plot-dataframe,plot-profit,webserver}
|
||||||
trade Trade module.
|
trade Trade module.
|
||||||
create-userdir Create user-data directory.
|
create-userdir Create user-data directory.
|
||||||
new-config Create new config
|
new-config Create new config
|
||||||
show-config Show resolved config
|
|
||||||
new-strategy Create new strategy
|
new-strategy Create new strategy
|
||||||
download-data Download backtesting data.
|
download-data Download backtesting data.
|
||||||
convert-data Convert candle (OHLCV) data from one format to
|
convert-data Convert candle (OHLCV) data from one format to
|
||||||
another.
|
another.
|
||||||
convert-trade-data Convert trade data from one format to another.
|
convert-trade-data Convert trade data from one format to another.
|
||||||
trades-to-ohlcv Convert trade data to OHLCV data.
|
|
||||||
list-data List downloaded data.
|
list-data List downloaded data.
|
||||||
backtesting Backtesting module.
|
backtesting Backtesting module.
|
||||||
backtesting-show Show past Backtest results
|
edge Edge module.
|
||||||
backtesting-analysis
|
|
||||||
Backtest Analysis module.
|
|
||||||
hyperopt Hyperopt module.
|
hyperopt Hyperopt module.
|
||||||
hyperopt-list List Hyperopt results
|
hyperopt-list List Hyperopt results
|
||||||
hyperopt-show Show details of Hyperopt results
|
hyperopt-show Show details of Hyperopt results
|
||||||
list-exchanges Print available exchanges.
|
list-exchanges Print available exchanges.
|
||||||
|
list-hyperopts Print available hyperopt classes.
|
||||||
list-markets Print markets on exchange.
|
list-markets Print markets on exchange.
|
||||||
list-pairs Print pairs on exchange.
|
list-pairs Print pairs on exchange.
|
||||||
list-strategies Print available strategies.
|
list-strategies Print available strategies.
|
||||||
list-hyperoptloss Print available hyperopt loss functions.
|
|
||||||
list-freqaimodels Print available freqAI models.
|
|
||||||
list-timeframes Print available timeframes for the exchange.
|
list-timeframes Print available timeframes for the exchange.
|
||||||
show-trades Show trades.
|
show-trades Show trades.
|
||||||
test-pairlist Test your pairlist configuration.
|
test-pairlist Test your pairlist configuration.
|
||||||
convert-db Migrate database to different system
|
|
||||||
install-ui Install FreqUI
|
install-ui Install FreqUI
|
||||||
plot-dataframe Plot candles with indicators.
|
plot-dataframe Plot candles with indicators.
|
||||||
plot-profit Generate plot showing profits.
|
plot-profit Generate plot showing profits.
|
||||||
webserver Webserver module.
|
webserver Webserver module.
|
||||||
strategy-updater updates outdated strategy files to the current version
|
|
||||||
lookahead-analysis Check for potential look ahead bias.
|
|
||||||
recursive-analysis Check for potential recursive formula issue.
|
|
||||||
|
|
||||||
options:
|
optional arguments:
|
||||||
-h, --help show this help message and exit
|
-h, --help show this help message and exit
|
||||||
-V, --version show program's version number and exit
|
-V, --version show program's version number and exit
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
### Telegram RPC commands
|
### Telegram RPC commands
|
||||||
@@ -177,10 +164,6 @@ first. If it hasn't been reported, please
|
|||||||
ensure you follow the template guide so that the team can assist you as
|
ensure you follow the template guide so that the team can assist you as
|
||||||
quickly as possible.
|
quickly as possible.
|
||||||
|
|
||||||
For every [issue](https://github.com/freqtrade/freqtrade/issues/new/choose) created, kindly follow up and mark satisfaction or reminder to close issue when equilibrium ground is reached.
|
|
||||||
|
|
||||||
--Maintain github's [community policy](https://docs.github.com/en/site-policy/github-terms/github-community-code-of-conduct)--
|
|
||||||
|
|
||||||
### [Feature Requests](https://github.com/freqtrade/freqtrade/labels/enhancement)
|
### [Feature Requests](https://github.com/freqtrade/freqtrade/labels/enhancement)
|
||||||
|
|
||||||
Have you a great idea to improve the bot you want to share? Please,
|
Have you a great idea to improve the bot you want to share? Please,
|
||||||
@@ -219,9 +202,9 @@ To run this bot we recommend you a cloud instance with a minimum of:
|
|||||||
|
|
||||||
### Software requirements
|
### Software requirements
|
||||||
|
|
||||||
- [Python >= 3.10](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/)
|
- [pip](https://pip.pypa.io/en/stable/installing/)
|
||||||
- [git](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git)
|
- [git](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git)
|
||||||
- [TA-Lib](https://ta-lib.github.io/ta-lib-python/)
|
- [TA-Lib](https://mrjbq7.github.io/ta-lib/install.html)
|
||||||
- [virtualenv](https://virtualenv.pypa.io/en/stable/installation.html) (Recommended)
|
- [virtualenv](https://virtualenv.pypa.io/en/stable/installation.html) (Recommended)
|
||||||
- [Docker](https://www.docker.com/products/docker) (Recommended)
|
- [Docker](https://www.docker.com/products/docker) (Recommended)
|
||||||
|
|||||||
BIN
build_helpers/TA_Lib-0.4.25-cp310-cp310-win_amd64.whl
Normal file
BIN
build_helpers/TA_Lib-0.4.25-cp38-cp38-win_amd64.whl
Normal file
BIN
build_helpers/TA_Lib-0.4.25-cp39-cp39-win_amd64.whl
Normal file
@@ -1,28 +0,0 @@
|
|||||||
#!/usr/bin/env python3
|
|
||||||
import json
|
|
||||||
import os
|
|
||||||
from pathlib import Path
|
|
||||||
|
|
||||||
import ccxt
|
|
||||||
|
|
||||||
|
|
||||||
key = os.environ.get("FREQTRADE__EXCHANGE__KEY")
|
|
||||||
secret = os.environ.get("FREQTRADE__EXCHANGE__SECRET")
|
|
||||||
|
|
||||||
proxy = os.environ.get("CI_WEB_PROXY")
|
|
||||||
|
|
||||||
exchange = ccxt.binance(
|
|
||||||
{
|
|
||||||
"apiKey": key,
|
|
||||||
"secret": secret,
|
|
||||||
"httpsProxy": proxy,
|
|
||||||
"options": {"defaultType": "swap"},
|
|
||||||
}
|
|
||||||
)
|
|
||||||
_ = exchange.load_markets()
|
|
||||||
|
|
||||||
lev_tiers = exchange.fetch_leverage_tiers()
|
|
||||||
|
|
||||||
# Assumes this is running in the root of the repository.
|
|
||||||
file = Path("freqtrade/exchange/binance_leverage_tiers.json")
|
|
||||||
json.dump(dict(sorted(lev_tiers.items())), file.open("w"), indent=2)
|
|
||||||
@@ -1,53 +0,0 @@
|
|||||||
import subprocess # noqa: S404, RUF100
|
|
||||||
from pathlib import Path
|
|
||||||
|
|
||||||
|
|
||||||
subcommands = [
|
|
||||||
"trade",
|
|
||||||
"create-userdir",
|
|
||||||
"new-config",
|
|
||||||
"show-config",
|
|
||||||
"new-strategy",
|
|
||||||
"download-data",
|
|
||||||
"convert-data",
|
|
||||||
"convert-trade-data",
|
|
||||||
"trades-to-ohlcv",
|
|
||||||
"list-data",
|
|
||||||
"backtesting",
|
|
||||||
"backtesting-show",
|
|
||||||
"backtesting-analysis",
|
|
||||||
"edge",
|
|
||||||
"hyperopt",
|
|
||||||
"hyperopt-list",
|
|
||||||
"hyperopt-show",
|
|
||||||
"list-exchanges",
|
|
||||||
"list-markets",
|
|
||||||
"list-pairs",
|
|
||||||
"list-strategies",
|
|
||||||
"list-hyperoptloss",
|
|
||||||
"list-freqaimodels",
|
|
||||||
"list-timeframes",
|
|
||||||
"show-trades",
|
|
||||||
"test-pairlist",
|
|
||||||
"convert-db",
|
|
||||||
"install-ui",
|
|
||||||
"plot-dataframe",
|
|
||||||
"plot-profit",
|
|
||||||
"webserver",
|
|
||||||
"strategy-updater",
|
|
||||||
"lookahead-analysis",
|
|
||||||
"recursive-analysis",
|
|
||||||
]
|
|
||||||
|
|
||||||
result = subprocess.run(["freqtrade", "--help"], capture_output=True, text=True)
|
|
||||||
|
|
||||||
with Path("docs/commands/main.md").open("w") as f:
|
|
||||||
f.write(f"```\n{result.stdout}\n```\n")
|
|
||||||
|
|
||||||
|
|
||||||
for command in subcommands:
|
|
||||||
print(f"Running for {command}")
|
|
||||||
result = subprocess.run(["freqtrade", command, "--help"], capture_output=True, text=True)
|
|
||||||
|
|
||||||
with Path(f"docs/commands/{command}.md").open("w") as f:
|
|
||||||
f.write(f"```\n{result.stdout}\n```\n")
|
|
||||||
@@ -1,30 +0,0 @@
|
|||||||
"""Script to extract the configuration json schema from config_schema.py file."""
|
|
||||||
|
|
||||||
from pathlib import Path
|
|
||||||
|
|
||||||
import rapidjson
|
|
||||||
|
|
||||||
|
|
||||||
def extract_config_json_schema():
|
|
||||||
try:
|
|
||||||
# Try to import from the installed package
|
|
||||||
from freqtrade.config_schema import CONF_SCHEMA
|
|
||||||
except ImportError:
|
|
||||||
# If freqtrade is not installed, add the parent directory to sys.path
|
|
||||||
# to import directly from the source
|
|
||||||
import sys
|
|
||||||
|
|
||||||
script_dir = Path(__file__).parent
|
|
||||||
freqtrade_dir = script_dir.parent
|
|
||||||
sys.path.insert(0, str(freqtrade_dir))
|
|
||||||
|
|
||||||
# Now try to import from the source
|
|
||||||
from freqtrade.config_schema import CONF_SCHEMA
|
|
||||||
|
|
||||||
schema_filename = Path(__file__).parent / "schema.json"
|
|
||||||
with schema_filename.open("w") as f:
|
|
||||||
rapidjson.dump(CONF_SCHEMA, f, indent=2)
|
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
|
||||||
extract_config_json_schema()
|
|
||||||
@@ -1,15 +0,0 @@
|
|||||||
#!/usr/bin/env python3
|
|
||||||
from freqtrade import __version__ as ft_version
|
|
||||||
from freqtrade_client import __version__ as client_version
|
|
||||||
|
|
||||||
|
|
||||||
def main():
|
|
||||||
if ft_version != client_version:
|
|
||||||
print(f"Versions do not match: \nft: {ft_version} \nclient: {client_version}")
|
|
||||||
exit(1)
|
|
||||||
print(f"Versions match: ft: {ft_version}, client: {client_version}")
|
|
||||||
exit(0)
|
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
|
||||||
main()
|
|
||||||
@@ -8,9 +8,8 @@ if [ -n "$2" ] || [ ! -f "${INSTALL_LOC}/lib/libta_lib.a" ]; then
|
|||||||
tar zxvf ta-lib-0.4.0-src.tar.gz
|
tar zxvf ta-lib-0.4.0-src.tar.gz
|
||||||
cd ta-lib \
|
cd ta-lib \
|
||||||
&& sed -i.bak "s|0.00000001|0.000000000000000001 |g" src/ta_func/ta_utility.h \
|
&& sed -i.bak "s|0.00000001|0.000000000000000001 |g" src/ta_func/ta_utility.h \
|
||||||
&& echo "Downloading gcc config.guess and config.sub" \
|
&& curl 'http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD' -o config.guess \
|
||||||
&& curl -s 'https://raw.githubusercontent.com/gcc-mirror/gcc/master/config.guess' -o config.guess \
|
&& curl 'http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD' -o config.sub \
|
||||||
&& curl -s 'https://raw.githubusercontent.com/gcc-mirror/gcc/master/config.sub' -o config.sub \
|
|
||||||
&& ./configure --prefix=${INSTALL_LOC}/ \
|
&& ./configure --prefix=${INSTALL_LOC}/ \
|
||||||
&& make
|
&& make
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
|
|||||||
@@ -1,10 +1,18 @@
|
|||||||
# vendored Wheels compiled via https://github.com/xmatthias/ta-lib-python/tree/ta_bundled_040
|
# Downloads don't work automatically, since the URL is regenerated via javascript.
|
||||||
|
# Downloaded from https://www.lfd.uci.edu/~gohlke/pythonlibs/#ta-lib
|
||||||
|
|
||||||
python -m pip install --upgrade pip
|
python -m pip install --upgrade pip wheel
|
||||||
python -c "import sys; print(f'{sys.version_info.major}.{sys.version_info.minor}')"
|
|
||||||
|
|
||||||
pip install -U wheel "numpy<3.0"
|
$pyv = python -c "import sys; print(f'{sys.version_info.major}.{sys.version_info.minor}')"
|
||||||
pip install --only-binary ta-lib --find-links=build_helpers\ ta-lib
|
|
||||||
|
|
||||||
|
if ($pyv -eq '3.8') {
|
||||||
|
pip install build_helpers\TA_Lib-0.4.25-cp38-cp38-win_amd64.whl
|
||||||
|
}
|
||||||
|
if ($pyv -eq '3.9') {
|
||||||
|
pip install build_helpers\TA_Lib-0.4.25-cp39-cp39-win_amd64.whl
|
||||||
|
}
|
||||||
|
if ($pyv -eq '3.10') {
|
||||||
|
pip install build_helpers\TA_Lib-0.4.25-cp310-cp310-win_amd64.whl
|
||||||
|
}
|
||||||
pip install -r requirements-dev.txt
|
pip install -r requirements-dev.txt
|
||||||
pip install -e .
|
pip install -e .
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
# File used in CI to ensure pre-commit dependencies are kept up-to-date.
|
# File used in CI to ensure pre-commit dependencies are kept uptodate.
|
||||||
|
|
||||||
import sys
|
import sys
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
@@ -6,30 +6,23 @@ from pathlib import Path
|
|||||||
import yaml
|
import yaml
|
||||||
|
|
||||||
|
|
||||||
pre_commit_file = Path(".pre-commit-config.yaml")
|
pre_commit_file = Path('.pre-commit-config.yaml')
|
||||||
require_dev = Path("requirements-dev.txt")
|
require_dev = Path('requirements-dev.txt')
|
||||||
require = Path("requirements.txt")
|
|
||||||
|
|
||||||
with require_dev.open("r") as rfile:
|
with require_dev.open('r') as rfile:
|
||||||
requirements = rfile.readlines()
|
requirements = rfile.readlines()
|
||||||
|
|
||||||
with require.open("r") as rfile:
|
|
||||||
requirements.extend(rfile.readlines())
|
|
||||||
|
|
||||||
# Extract types only
|
# Extract types only
|
||||||
type_reqs = [
|
type_reqs = [r.strip('\n') for r in requirements if r.startswith('types-')]
|
||||||
r.strip("\n") for r in requirements if r.startswith("types-") or r.startswith("SQLAlchemy")
|
|
||||||
]
|
|
||||||
|
|
||||||
with pre_commit_file.open("r") as file:
|
with pre_commit_file.open('r') as file:
|
||||||
f = yaml.load(file, Loader=yaml.SafeLoader)
|
f = yaml.load(file, Loader=yaml.FullLoader)
|
||||||
|
|
||||||
|
|
||||||
mypy_repo = [
|
mypy_repo = [repo for repo in f['repos'] if repo['repo']
|
||||||
repo for repo in f["repos"] if repo["repo"] == "https://github.com/pre-commit/mirrors-mypy"
|
== 'https://github.com/pre-commit/mirrors-mypy']
|
||||||
]
|
|
||||||
|
|
||||||
hooks = mypy_repo[0]["hooks"][0]["additional_dependencies"]
|
hooks = mypy_repo[0]['hooks'][0]['additional_dependencies']
|
||||||
|
|
||||||
errors = []
|
errors = []
|
||||||
for hook in hooks:
|
for hook in hooks:
|
||||||
|
|||||||
@@ -3,22 +3,16 @@
|
|||||||
# Use BuildKit, otherwise building on ARM fails
|
# Use BuildKit, otherwise building on ARM fails
|
||||||
export DOCKER_BUILDKIT=1
|
export DOCKER_BUILDKIT=1
|
||||||
|
|
||||||
IMAGE_NAME=freqtradeorg/freqtrade
|
|
||||||
CACHE_IMAGE=freqtradeorg/freqtrade_cache
|
|
||||||
GHCR_IMAGE_NAME=ghcr.io/freqtrade/freqtrade
|
|
||||||
|
|
||||||
# Replace / with _ to create a valid tag
|
# Replace / with _ to create a valid tag
|
||||||
TAG=$(echo "${BRANCH_NAME}" | sed -e "s/\//_/g")
|
TAG=$(echo "${BRANCH_NAME}" | sed -e "s/\//_/g")
|
||||||
TAG_PLOT=${TAG}_plot
|
TAG_PLOT=${TAG}_plot
|
||||||
TAG_FREQAI=${TAG}_freqai
|
TAG_FREQAI=${TAG}_freqai
|
||||||
TAG_FREQAI_RL=${TAG_FREQAI}rl
|
|
||||||
TAG_FREQAI_TORCH=${TAG_FREQAI}torch
|
|
||||||
TAG_PI="${TAG}_pi"
|
TAG_PI="${TAG}_pi"
|
||||||
|
|
||||||
TAG_ARM=${TAG}_arm
|
TAG_ARM=${TAG}_arm
|
||||||
TAG_PLOT_ARM=${TAG_PLOT}_arm
|
TAG_PLOT_ARM=${TAG_PLOT}_arm
|
||||||
TAG_FREQAI_ARM=${TAG_FREQAI}_arm
|
TAG_FREQAI_ARM=${TAG_FREQAI}_arm
|
||||||
TAG_FREQAI_RL_ARM=${TAG_FREQAI_RL}_arm
|
CACHE_IMAGE=freqtradeorg/freqtrade_cache
|
||||||
|
|
||||||
echo "Running for ${TAG}"
|
echo "Running for ${TAG}"
|
||||||
|
|
||||||
@@ -42,19 +36,17 @@ if [ $? -ne 0 ]; then
|
|||||||
echo "failed building multiarch images"
|
echo "failed building multiarch images"
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
docker build --build-arg sourceimage=freqtrade --build-arg sourcetag=${TAG_ARM} -t freqtrade:${TAG_PLOT_ARM} -f docker/Dockerfile.plot .
|
|
||||||
docker build --build-arg sourceimage=freqtrade --build-arg sourcetag=${TAG_ARM} -t freqtrade:${TAG_FREQAI_ARM} -f docker/Dockerfile.freqai .
|
|
||||||
docker build --build-arg sourceimage=freqtrade --build-arg sourcetag=${TAG_FREQAI_ARM} -t freqtrade:${TAG_FREQAI_RL_ARM} -f docker/Dockerfile.freqai_rl .
|
|
||||||
|
|
||||||
# Tag image for upload and next build step
|
# Tag image for upload and next build step
|
||||||
docker tag freqtrade:$TAG_ARM ${CACHE_IMAGE}:$TAG_ARM
|
docker tag freqtrade:$TAG_ARM ${CACHE_IMAGE}:$TAG_ARM
|
||||||
|
|
||||||
|
docker build --cache-from freqtrade:${TAG_ARM} --build-arg sourceimage=${CACHE_IMAGE} --build-arg sourcetag=${TAG_ARM} -t freqtrade:${TAG_PLOT_ARM} -f docker/Dockerfile.plot .
|
||||||
|
docker build --cache-from freqtrade:${TAG_ARM} --build-arg sourceimage=${CACHE_IMAGE} --build-arg sourcetag=${TAG_ARM} -t freqtrade:${TAG_FREQAI_ARM} -f docker/Dockerfile.freqai .
|
||||||
|
|
||||||
docker tag freqtrade:$TAG_PLOT_ARM ${CACHE_IMAGE}:$TAG_PLOT_ARM
|
docker tag freqtrade:$TAG_PLOT_ARM ${CACHE_IMAGE}:$TAG_PLOT_ARM
|
||||||
docker tag freqtrade:$TAG_FREQAI_ARM ${CACHE_IMAGE}:$TAG_FREQAI_ARM
|
docker tag freqtrade:$TAG_FREQAI_ARM ${CACHE_IMAGE}:$TAG_FREQAI_ARM
|
||||||
docker tag freqtrade:$TAG_FREQAI_RL_ARM ${CACHE_IMAGE}:$TAG_FREQAI_RL_ARM
|
|
||||||
|
|
||||||
# Run backtest
|
# Run backtest
|
||||||
docker run --rm -v $(pwd)/tests/testdata/config.tests.json:/freqtrade/config.json:ro -v $(pwd)/tests:/tests freqtrade:${TAG_ARM} backtesting --datadir /tests/testdata --strategy-path /tests/strategy/strats/ --strategy StrategyTestV3
|
docker run --rm -v $(pwd)/config_examples/config_bittrex.example.json:/freqtrade/config.json:ro -v $(pwd)/tests:/tests freqtrade:${TAG_ARM} backtesting --datadir /tests/testdata --strategy-path /tests/strategy/strats/ --strategy StrategyTestV3
|
||||||
|
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
echo "failed running backtest"
|
echo "failed running backtest"
|
||||||
@@ -63,9 +55,9 @@ fi
|
|||||||
|
|
||||||
docker images
|
docker images
|
||||||
|
|
||||||
|
# docker push ${IMAGE_NAME}
|
||||||
docker push ${CACHE_IMAGE}:$TAG_PLOT_ARM
|
docker push ${CACHE_IMAGE}:$TAG_PLOT_ARM
|
||||||
docker push ${CACHE_IMAGE}:$TAG_FREQAI_ARM
|
docker push ${CACHE_IMAGE}:$TAG_FREQAI_ARM
|
||||||
docker push ${CACHE_IMAGE}:$TAG_FREQAI_RL_ARM
|
|
||||||
docker push ${CACHE_IMAGE}:$TAG_ARM
|
docker push ${CACHE_IMAGE}:$TAG_ARM
|
||||||
|
|
||||||
# Create multi-arch image
|
# Create multi-arch image
|
||||||
@@ -73,47 +65,22 @@ docker push ${CACHE_IMAGE}:$TAG_ARM
|
|||||||
# Otherwise installation might fail.
|
# Otherwise installation might fail.
|
||||||
echo "create manifests"
|
echo "create manifests"
|
||||||
|
|
||||||
docker manifest create ${IMAGE_NAME}:${TAG} ${CACHE_IMAGE}:${TAG} ${CACHE_IMAGE}:${TAG_ARM} ${IMAGE_NAME}:${TAG_PI}
|
docker manifest create --amend ${IMAGE_NAME}:${TAG} ${CACHE_IMAGE}:${TAG_ARM} ${IMAGE_NAME}:${TAG_PI} ${CACHE_IMAGE}:${TAG}
|
||||||
docker manifest push -p ${IMAGE_NAME}:${TAG}
|
docker manifest push -p ${IMAGE_NAME}:${TAG}
|
||||||
|
|
||||||
docker manifest create ${IMAGE_NAME}:${TAG_PLOT} ${CACHE_IMAGE}:${TAG_PLOT} ${CACHE_IMAGE}:${TAG_PLOT_ARM}
|
docker manifest create ${IMAGE_NAME}:${TAG_PLOT} ${CACHE_IMAGE}:${TAG_PLOT_ARM} ${CACHE_IMAGE}:${TAG_PLOT}
|
||||||
docker manifest push -p ${IMAGE_NAME}:${TAG_PLOT}
|
docker manifest push -p ${IMAGE_NAME}:${TAG_PLOT}
|
||||||
|
|
||||||
docker manifest create ${IMAGE_NAME}:${TAG_FREQAI} ${CACHE_IMAGE}:${TAG_FREQAI} ${CACHE_IMAGE}:${TAG_FREQAI_ARM}
|
docker manifest create ${IMAGE_NAME}:${TAG_FREQAI} ${CACHE_IMAGE}:${TAG_FREQAI_ARM} ${CACHE_IMAGE}:${TAG_FREQAI}
|
||||||
docker manifest push -p ${IMAGE_NAME}:${TAG_FREQAI}
|
docker manifest push -p ${IMAGE_NAME}:${TAG_FREQAI}
|
||||||
|
|
||||||
docker manifest create ${IMAGE_NAME}:${TAG_FREQAI_RL} ${CACHE_IMAGE}:${TAG_FREQAI_RL} ${CACHE_IMAGE}:${TAG_FREQAI_RL_ARM}
|
|
||||||
docker manifest push -p ${IMAGE_NAME}:${TAG_FREQAI_RL}
|
|
||||||
|
|
||||||
# Create special Torch tag - which is identical to the RL tag.
|
|
||||||
docker manifest create ${IMAGE_NAME}:${TAG_FREQAI_TORCH} ${CACHE_IMAGE}:${TAG_FREQAI_RL} ${CACHE_IMAGE}:${TAG_FREQAI_RL_ARM}
|
|
||||||
docker manifest push -p ${IMAGE_NAME}:${TAG_FREQAI_TORCH}
|
|
||||||
|
|
||||||
# copy images to ghcr.io
|
|
||||||
|
|
||||||
alias crane="docker run --rm -i -v $(pwd)/.crane:/home/nonroot/.docker/ gcr.io/go-containerregistry/crane"
|
|
||||||
mkdir .crane
|
|
||||||
chmod a+rwx .crane
|
|
||||||
|
|
||||||
echo "${GHCR_TOKEN}" | crane auth login ghcr.io -u "${GHCR_USERNAME}" --password-stdin
|
|
||||||
|
|
||||||
crane copy ${IMAGE_NAME}:${TAG_FREQAI_RL} ${GHCR_IMAGE_NAME}:${TAG_FREQAI_RL}
|
|
||||||
crane copy ${IMAGE_NAME}:${TAG_FREQAI_RL} ${GHCR_IMAGE_NAME}:${TAG_FREQAI_TORCH}
|
|
||||||
crane copy ${IMAGE_NAME}:${TAG_FREQAI} ${GHCR_IMAGE_NAME}:${TAG_FREQAI}
|
|
||||||
crane copy ${IMAGE_NAME}:${TAG_PLOT} ${GHCR_IMAGE_NAME}:${TAG_PLOT}
|
|
||||||
crane copy ${IMAGE_NAME}:${TAG} ${GHCR_IMAGE_NAME}:${TAG}
|
|
||||||
|
|
||||||
# Tag as latest for develop builds
|
# Tag as latest for develop builds
|
||||||
if [ "${TAG}" = "develop" ]; then
|
if [ "${TAG}" = "develop" ]; then
|
||||||
echo 'Tagging image as latest'
|
|
||||||
docker manifest create ${IMAGE_NAME}:latest ${CACHE_IMAGE}:${TAG_ARM} ${IMAGE_NAME}:${TAG_PI} ${CACHE_IMAGE}:${TAG}
|
docker manifest create ${IMAGE_NAME}:latest ${CACHE_IMAGE}:${TAG_ARM} ${IMAGE_NAME}:${TAG_PI} ${CACHE_IMAGE}:${TAG}
|
||||||
docker manifest push -p ${IMAGE_NAME}:latest
|
docker manifest push -p ${IMAGE_NAME}:latest
|
||||||
|
|
||||||
crane copy ${IMAGE_NAME}:latest ${GHCR_IMAGE_NAME}:latest
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
docker images
|
docker images
|
||||||
rm -rf .crane
|
|
||||||
|
|
||||||
# Cleanup old images from arm64 node.
|
# Cleanup old images from arm64 node.
|
||||||
docker image prune -a --force --filter "until=24h"
|
docker image prune -a --force --filter "until=24h"
|
||||||
|
|||||||
@@ -2,17 +2,15 @@
|
|||||||
|
|
||||||
# The below assumes a correctly setup docker buildx environment
|
# The below assumes a correctly setup docker buildx environment
|
||||||
|
|
||||||
IMAGE_NAME=freqtradeorg/freqtrade
|
|
||||||
CACHE_IMAGE=freqtradeorg/freqtrade_cache
|
|
||||||
# Replace / with _ to create a valid tag
|
# Replace / with _ to create a valid tag
|
||||||
TAG=$(echo "${BRANCH_NAME}" | sed -e "s/\//_/g")
|
TAG=$(echo "${BRANCH_NAME}" | sed -e "s/\//_/g")
|
||||||
TAG_PLOT=${TAG}_plot
|
TAG_PLOT=${TAG}_plot
|
||||||
TAG_FREQAI=${TAG}_freqai
|
TAG_FREQAI=${TAG}_freqai
|
||||||
TAG_FREQAI_RL=${TAG_FREQAI}rl
|
|
||||||
TAG_PI="${TAG}_pi"
|
TAG_PI="${TAG}_pi"
|
||||||
|
|
||||||
PI_PLATFORM="linux/arm/v7"
|
PI_PLATFORM="linux/arm/v7"
|
||||||
echo "Running for ${TAG}"
|
echo "Running for ${TAG}"
|
||||||
|
CACHE_IMAGE=freqtradeorg/freqtrade_cache
|
||||||
CACHE_TAG=${CACHE_IMAGE}:${TAG_PI}_cache
|
CACHE_TAG=${CACHE_IMAGE}:${TAG_PI}_cache
|
||||||
|
|
||||||
# Add commit and commit_message to docker container
|
# Add commit and commit_message to docker container
|
||||||
@@ -27,10 +25,7 @@ if [ "${GITHUB_EVENT_NAME}" = "schedule" ]; then
|
|||||||
--cache-to=type=registry,ref=${CACHE_TAG} \
|
--cache-to=type=registry,ref=${CACHE_TAG} \
|
||||||
-f docker/Dockerfile.armhf \
|
-f docker/Dockerfile.armhf \
|
||||||
--platform ${PI_PLATFORM} \
|
--platform ${PI_PLATFORM} \
|
||||||
-t ${IMAGE_NAME}:${TAG_PI} \
|
-t ${IMAGE_NAME}:${TAG_PI} --push .
|
||||||
--push \
|
|
||||||
--provenance=false \
|
|
||||||
.
|
|
||||||
else
|
else
|
||||||
echo "event ${GITHUB_EVENT_NAME}: building with cache"
|
echo "event ${GITHUB_EVENT_NAME}: building with cache"
|
||||||
# Build regular image
|
# Build regular image
|
||||||
@@ -39,16 +34,12 @@ else
|
|||||||
|
|
||||||
# Pull last build to avoid rebuilding the whole image
|
# Pull last build to avoid rebuilding the whole image
|
||||||
# docker pull --platform ${PI_PLATFORM} ${IMAGE_NAME}:${TAG}
|
# docker pull --platform ${PI_PLATFORM} ${IMAGE_NAME}:${TAG}
|
||||||
# disable provenance due to https://github.com/docker/buildx/issues/1509
|
|
||||||
docker buildx build \
|
docker buildx build \
|
||||||
--cache-from=type=registry,ref=${CACHE_TAG} \
|
--cache-from=type=registry,ref=${CACHE_TAG} \
|
||||||
--cache-to=type=registry,ref=${CACHE_TAG} \
|
--cache-to=type=registry,ref=${CACHE_TAG} \
|
||||||
-f docker/Dockerfile.armhf \
|
-f docker/Dockerfile.armhf \
|
||||||
--platform ${PI_PLATFORM} \
|
--platform ${PI_PLATFORM} \
|
||||||
-t ${IMAGE_NAME}:${TAG_PI} \
|
-t ${IMAGE_NAME}:${TAG_PI} --push .
|
||||||
--push \
|
|
||||||
--provenance=false \
|
|
||||||
.
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
@@ -58,16 +49,14 @@ fi
|
|||||||
# Tag image for upload and next build step
|
# Tag image for upload and next build step
|
||||||
docker tag freqtrade:$TAG ${CACHE_IMAGE}:$TAG
|
docker tag freqtrade:$TAG ${CACHE_IMAGE}:$TAG
|
||||||
|
|
||||||
docker build --build-arg sourceimage=freqtrade --build-arg sourcetag=${TAG} -t freqtrade:${TAG_PLOT} -f docker/Dockerfile.plot .
|
docker build --cache-from freqtrade:${TAG} --build-arg sourceimage=${CACHE_IMAGE} --build-arg sourcetag=${TAG} -t freqtrade:${TAG_PLOT} -f docker/Dockerfile.plot .
|
||||||
docker build --build-arg sourceimage=freqtrade --build-arg sourcetag=${TAG} -t freqtrade:${TAG_FREQAI} -f docker/Dockerfile.freqai .
|
docker build --cache-from freqtrade:${TAG} --build-arg sourceimage=${CACHE_IMAGE} --build-arg sourcetag=${TAG} -t freqtrade:${TAG_FREQAI} -f docker/Dockerfile.freqai .
|
||||||
docker build --build-arg sourceimage=freqtrade --build-arg sourcetag=${TAG_FREQAI} -t freqtrade:${TAG_FREQAI_RL} -f docker/Dockerfile.freqai_rl .
|
|
||||||
|
|
||||||
docker tag freqtrade:$TAG_PLOT ${CACHE_IMAGE}:$TAG_PLOT
|
docker tag freqtrade:$TAG_PLOT ${CACHE_IMAGE}:$TAG_PLOT
|
||||||
docker tag freqtrade:$TAG_FREQAI ${CACHE_IMAGE}:$TAG_FREQAI
|
docker tag freqtrade:$TAG_FREQAI ${CACHE_IMAGE}:$TAG_FREQAI
|
||||||
docker tag freqtrade:$TAG_FREQAI_RL ${CACHE_IMAGE}:$TAG_FREQAI_RL
|
|
||||||
|
|
||||||
# Run backtest
|
# Run backtest
|
||||||
docker run --rm -v $(pwd)/tests/testdata/config.tests.json:/freqtrade/config.json:ro -v $(pwd)/tests:/tests freqtrade:${TAG} backtesting --datadir /tests/testdata --strategy-path /tests/strategy/strats/ --strategy StrategyTestV3
|
docker run --rm -v $(pwd)/config_examples/config_bittrex.example.json:/freqtrade/config.json:ro -v $(pwd)/tests:/tests freqtrade:${TAG} backtesting --datadir /tests/testdata --strategy-path /tests/strategy/strats/ --strategy StrategyTestV3
|
||||||
|
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
echo "failed running backtest"
|
echo "failed running backtest"
|
||||||
@@ -76,10 +65,11 @@ fi
|
|||||||
|
|
||||||
docker images
|
docker images
|
||||||
|
|
||||||
docker push ${CACHE_IMAGE}:$TAG
|
docker push ${CACHE_IMAGE}
|
||||||
docker push ${CACHE_IMAGE}:$TAG_PLOT
|
docker push ${CACHE_IMAGE}:$TAG_PLOT
|
||||||
docker push ${CACHE_IMAGE}:$TAG_FREQAI
|
docker push ${CACHE_IMAGE}:$TAG_FREQAI
|
||||||
docker push ${CACHE_IMAGE}:$TAG_FREQAI_RL
|
docker push ${CACHE_IMAGE}:$TAG
|
||||||
|
|
||||||
|
|
||||||
docker images
|
docker images
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +1,7 @@
|
|||||||
{
|
{
|
||||||
"$schema": "https://schema.freqtrade.io/schema.json",
|
|
||||||
"max_open_trades": 3,
|
"max_open_trades": 3,
|
||||||
"stake_currency": "USDT",
|
"stake_currency": "BTC",
|
||||||
"stake_amount": 30,
|
"stake_amount": 0.05,
|
||||||
"tradable_balance_ratio": 0.99,
|
"tradable_balance_ratio": 0.99,
|
||||||
"fiat_display_currency": "USD",
|
"fiat_display_currency": "USD",
|
||||||
"timeframe": "5m",
|
"timeframe": "5m",
|
||||||
@@ -37,29 +36,43 @@
|
|||||||
"ccxt_async_config": {
|
"ccxt_async_config": {
|
||||||
},
|
},
|
||||||
"pair_whitelist": [
|
"pair_whitelist": [
|
||||||
"ALGO/USDT",
|
"ALGO/BTC",
|
||||||
"ATOM/USDT",
|
"ATOM/BTC",
|
||||||
"BAT/USDT",
|
"BAT/BTC",
|
||||||
"BCH/USDT",
|
"BCH/BTC",
|
||||||
"BRD/USDT",
|
"BRD/BTC",
|
||||||
"EOS/USDT",
|
"EOS/BTC",
|
||||||
"ETH/USDT",
|
"ETH/BTC",
|
||||||
"IOTA/USDT",
|
"IOTA/BTC",
|
||||||
"LINK/USDT",
|
"LINK/BTC",
|
||||||
"LTC/USDT",
|
"LTC/BTC",
|
||||||
"NEO/USDT",
|
"NEO/BTC",
|
||||||
"NXS/USDT",
|
"NXS/BTC",
|
||||||
"XMR/USDT",
|
"XMR/BTC",
|
||||||
"XRP/USDT",
|
"XRP/BTC",
|
||||||
"XTZ/USDT"
|
"XTZ/BTC"
|
||||||
],
|
],
|
||||||
"pair_blacklist": [
|
"pair_blacklist": [
|
||||||
"BNB/.*"
|
"BNB/BTC"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"pairlists": [
|
"pairlists": [
|
||||||
{"method": "StaticPairList"}
|
{"method": "StaticPairList"}
|
||||||
],
|
],
|
||||||
|
"edge": {
|
||||||
|
"enabled": false,
|
||||||
|
"process_throttle_secs": 3600,
|
||||||
|
"calculate_since_number_of_days": 7,
|
||||||
|
"allowed_risk": 0.01,
|
||||||
|
"stoploss_range_min": -0.01,
|
||||||
|
"stoploss_range_max": -0.1,
|
||||||
|
"stoploss_range_step": -0.01,
|
||||||
|
"minimum_winrate": 0.60,
|
||||||
|
"minimum_expectancy": 0.20,
|
||||||
|
"min_trade_number": 10,
|
||||||
|
"max_trade_duration_minute": 1440,
|
||||||
|
"remove_pumps": false
|
||||||
|
},
|
||||||
"telegram": {
|
"telegram": {
|
||||||
"enabled": false,
|
"enabled": false,
|
||||||
"token": "your_telegram_token",
|
"token": "your_telegram_token",
|
||||||
|
|||||||
@@ -29,11 +29,14 @@
|
|||||||
"order_book_top": 1
|
"order_book_top": 1
|
||||||
},
|
},
|
||||||
"exchange": {
|
"exchange": {
|
||||||
"name": "binance",
|
"name": "bittrex",
|
||||||
"key": "your_exchange_key",
|
"key": "your_exchange_key",
|
||||||
"secret": "your_exchange_secret",
|
"secret": "your_exchange_secret",
|
||||||
"ccxt_config": {},
|
"ccxt_config": {"enableRateLimit": true},
|
||||||
"ccxt_async_config": {},
|
"ccxt_async_config": {
|
||||||
|
"enableRateLimit": true,
|
||||||
|
"rateLimit": 500
|
||||||
|
},
|
||||||
"pair_whitelist": [
|
"pair_whitelist": [
|
||||||
"ETH/BTC",
|
"ETH/BTC",
|
||||||
"LTC/BTC",
|
"LTC/BTC",
|
||||||
@@ -53,6 +56,20 @@
|
|||||||
"pairlists": [
|
"pairlists": [
|
||||||
{"method": "StaticPairList"}
|
{"method": "StaticPairList"}
|
||||||
],
|
],
|
||||||
|
"edge": {
|
||||||
|
"enabled": false,
|
||||||
|
"process_throttle_secs": 3600,
|
||||||
|
"calculate_since_number_of_days": 7,
|
||||||
|
"allowed_risk": 0.01,
|
||||||
|
"stoploss_range_min": -0.01,
|
||||||
|
"stoploss_range_max": -0.1,
|
||||||
|
"stoploss_range_step": -0.01,
|
||||||
|
"minimum_winrate": 0.60,
|
||||||
|
"minimum_expectancy": 0.20,
|
||||||
|
"min_trade_number": 10,
|
||||||
|
"max_trade_duration_minute": 1440,
|
||||||
|
"remove_pumps": false
|
||||||
|
},
|
||||||
"telegram": {
|
"telegram": {
|
||||||
"enabled": false,
|
"enabled": false,
|
||||||
"token": "your_telegram_token",
|
"token": "your_telegram_token",
|
||||||
@@ -1,5 +1,4 @@
|
|||||||
{
|
{
|
||||||
"$schema": "https://schema.freqtrade.io/schema.json",
|
|
||||||
"trading_mode": "futures",
|
"trading_mode": "futures",
|
||||||
"margin_mode": "isolated",
|
"margin_mode": "isolated",
|
||||||
"max_open_trades": 5,
|
"max_open_trades": 5,
|
||||||
@@ -19,11 +18,16 @@
|
|||||||
"name": "binance",
|
"name": "binance",
|
||||||
"key": "",
|
"key": "",
|
||||||
"secret": "",
|
"secret": "",
|
||||||
"ccxt_config": {},
|
"ccxt_config": {
|
||||||
"ccxt_async_config": {},
|
"enableRateLimit": true
|
||||||
|
},
|
||||||
|
"ccxt_async_config": {
|
||||||
|
"enableRateLimit": true,
|
||||||
|
"rateLimit": 200
|
||||||
|
},
|
||||||
"pair_whitelist": [
|
"pair_whitelist": [
|
||||||
"1INCH/USDT:USDT",
|
"1INCH/USDT",
|
||||||
"ALGO/USDT:USDT"
|
"ALGO/USDT"
|
||||||
],
|
],
|
||||||
"pair_blacklist": []
|
"pair_blacklist": []
|
||||||
},
|
},
|
||||||
@@ -49,11 +53,11 @@
|
|||||||
],
|
],
|
||||||
"freqai": {
|
"freqai": {
|
||||||
"enabled": true,
|
"enabled": true,
|
||||||
"purge_old_models": 2,
|
"purge_old_models": true,
|
||||||
"train_period_days": 15,
|
"train_period_days": 15,
|
||||||
"backtest_period_days": 7,
|
"backtest_period_days": 7,
|
||||||
"live_retrain_hours": 0,
|
"live_retrain_hours": 0,
|
||||||
"identifier": "unique-id",
|
"identifier": "uniqe-id",
|
||||||
"feature_parameters": {
|
"feature_parameters": {
|
||||||
"include_timeframes": [
|
"include_timeframes": [
|
||||||
"3m",
|
"3m",
|
||||||
@@ -61,8 +65,8 @@
|
|||||||
"1h"
|
"1h"
|
||||||
],
|
],
|
||||||
"include_corr_pairlist": [
|
"include_corr_pairlist": [
|
||||||
"BTC/USDT:USDT",
|
"BTC/USDT",
|
||||||
"ETH/USDT:USDT"
|
"ETH/USDT"
|
||||||
],
|
],
|
||||||
"label_period_candles": 20,
|
"label_period_candles": 20,
|
||||||
"include_shifted_candles": 2,
|
"include_shifted_candles": 2,
|
||||||
@@ -80,7 +84,9 @@
|
|||||||
"test_size": 0.33,
|
"test_size": 0.33,
|
||||||
"random_state": 1
|
"random_state": 1
|
||||||
},
|
},
|
||||||
"model_training_parameters": {}
|
"model_training_parameters": {
|
||||||
|
"n_estimators": 1000
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"bot_name": "",
|
"bot_name": "",
|
||||||
"force_entry_enable": true,
|
"force_entry_enable": true,
|
||||||
|
|||||||
@@ -1,15 +1,15 @@
|
|||||||
{
|
{
|
||||||
"max_open_trades": 3,
|
"max_open_trades": 3,
|
||||||
"stake_currency": "BTC",
|
"stake_currency": "USD",
|
||||||
"stake_amount": 0.05,
|
"stake_amount": 50,
|
||||||
"tradable_balance_ratio": 0.99,
|
"tradable_balance_ratio": 0.99,
|
||||||
"fiat_display_currency": "USD",
|
"fiat_display_currency": "USD",
|
||||||
"timeframe": "5m",
|
"timeframe": "5m",
|
||||||
"dry_run": true,
|
"dry_run": true,
|
||||||
"cancel_open_orders_on_exit": false,
|
"cancel_open_orders_on_exit": false,
|
||||||
"unfilledtimeout": {
|
"unfilledtimeout": {
|
||||||
"entry": 5,
|
"entry": 10,
|
||||||
"exit": 5,
|
"exit": 10,
|
||||||
"exit_timeout_count": 0,
|
"exit_timeout_count": 0,
|
||||||
"unit": "minutes"
|
"unit": "minutes"
|
||||||
},
|
},
|
||||||
@@ -23,33 +23,55 @@
|
|||||||
"bids_to_ask_delta": 1
|
"bids_to_ask_delta": 1
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"exit_pricing":{
|
"exit_pricing": {
|
||||||
"price_side": "same",
|
"price_side": "same",
|
||||||
"use_order_book": true,
|
"use_order_book": true,
|
||||||
"order_book_top": 1
|
"order_book_top": 1
|
||||||
},
|
},
|
||||||
"exchange": {
|
"exchange": {
|
||||||
"name": "gate",
|
"name": "ftx",
|
||||||
"key": "your_exchange_key",
|
"key": "your_exchange_key",
|
||||||
"secret": "your_exchange_secret",
|
"secret": "your_exchange_secret",
|
||||||
"ccxt_config": {},
|
"ccxt_config": {},
|
||||||
"ccxt_async_config": {},
|
"ccxt_async_config": {},
|
||||||
"pair_whitelist": [
|
"pair_whitelist": [
|
||||||
"ETH/BTC",
|
"BTC/USD",
|
||||||
"LTC/BTC",
|
"ETH/USD",
|
||||||
"ETC/BTC",
|
"BNB/USD",
|
||||||
"XLM/BTC",
|
"USDT/USD",
|
||||||
"XRP/BTC",
|
"LTC/USD",
|
||||||
"ADA/BTC",
|
"SRM/USD",
|
||||||
"DOT/BTC"
|
"SXP/USD",
|
||||||
|
"XRP/USD",
|
||||||
|
"DOGE/USD",
|
||||||
|
"1INCH/USD",
|
||||||
|
"CHZ/USD",
|
||||||
|
"MATIC/USD",
|
||||||
|
"LINK/USD",
|
||||||
|
"OXY/USD",
|
||||||
|
"SUSHI/USD"
|
||||||
],
|
],
|
||||||
"pair_blacklist": [
|
"pair_blacklist": [
|
||||||
"DOGE/BTC"
|
"FTT/USD"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"pairlists": [
|
"pairlists": [
|
||||||
{"method": "StaticPairList"}
|
{"method": "StaticPairList"}
|
||||||
],
|
],
|
||||||
|
"edge": {
|
||||||
|
"enabled": false,
|
||||||
|
"process_throttle_secs": 3600,
|
||||||
|
"calculate_since_number_of_days": 7,
|
||||||
|
"allowed_risk": 0.01,
|
||||||
|
"stoploss_range_min": -0.01,
|
||||||
|
"stoploss_range_max": -0.1,
|
||||||
|
"stoploss_range_step": -0.01,
|
||||||
|
"minimum_winrate": 0.60,
|
||||||
|
"minimum_expectancy": 0.20,
|
||||||
|
"min_trade_number": 10,
|
||||||
|
"max_trade_duration_minute": 1440,
|
||||||
|
"remove_pumps": false
|
||||||
|
},
|
||||||
"telegram": {
|
"telegram": {
|
||||||
"enabled": false,
|
"enabled": false,
|
||||||
"token": "your_telegram_token",
|
"token": "your_telegram_token",
|
||||||
@@ -1,5 +1,4 @@
|
|||||||
{
|
{
|
||||||
"$schema": "https://schema.freqtrade.io/schema.json",
|
|
||||||
"max_open_trades": 3,
|
"max_open_trades": 3,
|
||||||
"stake_currency": "BTC",
|
"stake_currency": "BTC",
|
||||||
"stake_amount": 0.05,
|
"stake_amount": 0.05,
|
||||||
@@ -61,7 +60,6 @@
|
|||||||
"force_entry": "market",
|
"force_entry": "market",
|
||||||
"stoploss": "market",
|
"stoploss": "market",
|
||||||
"stoploss_on_exchange": false,
|
"stoploss_on_exchange": false,
|
||||||
"stoploss_price_type": "last",
|
|
||||||
"stoploss_on_exchange_interval": 60,
|
"stoploss_on_exchange_interval": 60,
|
||||||
"stoploss_on_exchange_limit_ratio": 0.99
|
"stoploss_on_exchange_limit_ratio": 0.99
|
||||||
},
|
},
|
||||||
@@ -71,7 +69,6 @@
|
|||||||
},
|
},
|
||||||
"pairlists": [
|
"pairlists": [
|
||||||
{"method": "StaticPairList"},
|
{"method": "StaticPairList"},
|
||||||
{"method": "FullTradesFilter"},
|
|
||||||
{
|
{
|
||||||
"method": "VolumePairList",
|
"method": "VolumePairList",
|
||||||
"number_assets": 20,
|
"number_assets": 20,
|
||||||
@@ -91,6 +88,7 @@
|
|||||||
],
|
],
|
||||||
"exchange": {
|
"exchange": {
|
||||||
"name": "binance",
|
"name": "binance",
|
||||||
|
"sandbox": false,
|
||||||
"key": "your_exchange_key",
|
"key": "your_exchange_key",
|
||||||
"secret": "your_exchange_secret",
|
"secret": "your_exchange_secret",
|
||||||
"password": "",
|
"password": "",
|
||||||
@@ -121,6 +119,20 @@
|
|||||||
"outdated_offset": 5,
|
"outdated_offset": 5,
|
||||||
"markets_refresh_interval": 60
|
"markets_refresh_interval": 60
|
||||||
},
|
},
|
||||||
|
"edge": {
|
||||||
|
"enabled": false,
|
||||||
|
"process_throttle_secs": 3600,
|
||||||
|
"calculate_since_number_of_days": 7,
|
||||||
|
"allowed_risk": 0.01,
|
||||||
|
"stoploss_range_min": -0.01,
|
||||||
|
"stoploss_range_max": -0.1,
|
||||||
|
"stoploss_range_step": -0.01,
|
||||||
|
"minimum_winrate": 0.60,
|
||||||
|
"minimum_expectancy": 0.20,
|
||||||
|
"min_trade_number": 10,
|
||||||
|
"max_trade_duration_minute": 1440,
|
||||||
|
"remove_pumps": false
|
||||||
|
},
|
||||||
"telegram": {
|
"telegram": {
|
||||||
"enabled": false,
|
"enabled": false,
|
||||||
"token": "your_telegram_token",
|
"token": "your_telegram_token",
|
||||||
@@ -192,7 +204,6 @@
|
|||||||
"strategy_path": "user_data/strategies/",
|
"strategy_path": "user_data/strategies/",
|
||||||
"recursive_strategy_search": false,
|
"recursive_strategy_search": false,
|
||||||
"add_config_files": [],
|
"add_config_files": [],
|
||||||
"reduce_df_footprint": false,
|
"dataformat_ohlcv": "json",
|
||||||
"dataformat_ohlcv": "feather",
|
"dataformat_trades": "jsongz"
|
||||||
"dataformat_trades": "feather"
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
{
|
{
|
||||||
"$schema": "https://schema.freqtrade.io/schema.json",
|
|
||||||
"max_open_trades": 5,
|
"max_open_trades": 5,
|
||||||
"stake_currency": "EUR",
|
"stake_currency": "EUR",
|
||||||
"stake_amount": 10,
|
"stake_amount": 10,
|
||||||
@@ -65,6 +64,20 @@
|
|||||||
"pairlists": [
|
"pairlists": [
|
||||||
{"method": "StaticPairList"}
|
{"method": "StaticPairList"}
|
||||||
],
|
],
|
||||||
|
"edge": {
|
||||||
|
"enabled": false,
|
||||||
|
"process_throttle_secs": 3600,
|
||||||
|
"calculate_since_number_of_days": 7,
|
||||||
|
"allowed_risk": 0.01,
|
||||||
|
"stoploss_range_min": -0.01,
|
||||||
|
"stoploss_range_max": -0.1,
|
||||||
|
"stoploss_range_step": -0.01,
|
||||||
|
"minimum_winrate": 0.60,
|
||||||
|
"minimum_expectancy": 0.20,
|
||||||
|
"min_trade_number": 10,
|
||||||
|
"max_trade_duration_minute": 1440,
|
||||||
|
"remove_pumps": false
|
||||||
|
},
|
||||||
"telegram": {
|
"telegram": {
|
||||||
"enabled": false,
|
"enabled": false,
|
||||||
"token": "your_telegram_token",
|
"token": "your_telegram_token",
|
||||||
|
|||||||
@@ -1,19 +1,11 @@
|
|||||||
---
|
---
|
||||||
|
version: '3'
|
||||||
services:
|
services:
|
||||||
freqtrade:
|
freqtrade:
|
||||||
image: freqtradeorg/freqtrade:stable
|
image: freqtradeorg/freqtrade:stable
|
||||||
# image: freqtradeorg/freqtrade:develop
|
# image: freqtradeorg/freqtrade:develop
|
||||||
# Use plotting image
|
# Use plotting image
|
||||||
# image: freqtradeorg/freqtrade:develop_plot
|
# image: freqtradeorg/freqtrade:develop_plot
|
||||||
# # Enable GPU Image and GPU Resources (only relevant for freqAI)
|
|
||||||
# # Make sure to uncomment the whole deploy section
|
|
||||||
# deploy:
|
|
||||||
# resources:
|
|
||||||
# reservations:
|
|
||||||
# devices:
|
|
||||||
# - driver: nvidia
|
|
||||||
# count: 1
|
|
||||||
# capabilities: [gpu]
|
|
||||||
# Build step - only needed when additional dependencies are needed
|
# Build step - only needed when additional dependencies are needed
|
||||||
# build:
|
# build:
|
||||||
# context: .
|
# context: .
|
||||||
@@ -24,7 +16,7 @@ services:
|
|||||||
- "./user_data:/freqtrade/user_data"
|
- "./user_data:/freqtrade/user_data"
|
||||||
# Expose api on port 8080 (localhost only)
|
# Expose api on port 8080 (localhost only)
|
||||||
# Please read the https://www.freqtrade.io/en/stable/rest-api/ documentation
|
# Please read the https://www.freqtrade.io/en/stable/rest-api/ documentation
|
||||||
# for more information.
|
# before enabling this.
|
||||||
ports:
|
ports:
|
||||||
- "127.0.0.1:8080:8080"
|
- "127.0.0.1:8080:8080"
|
||||||
# Default command used when running `docker compose up`
|
# Default command used when running `docker compose up`
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
FROM python:3.11.13-slim-bookworm as base
|
FROM python:3.9.12-slim-bullseye as base
|
||||||
|
|
||||||
# Setup env
|
# Setup env
|
||||||
ENV LANG C.UTF-8
|
ENV LANG C.UTF-8
|
||||||
@@ -11,13 +11,12 @@ ENV FT_APP_ENV="docker"
|
|||||||
# Prepare environment
|
# Prepare environment
|
||||||
RUN mkdir /freqtrade \
|
RUN mkdir /freqtrade \
|
||||||
&& apt-get update \
|
&& apt-get update \
|
||||||
&& apt-get -y install sudo libatlas3-base libopenblas-dev curl sqlite3 libutf8proc-dev libsnappy-dev \
|
&& apt-get -y install sudo libatlas3-base curl sqlite3 libhdf5-dev \
|
||||||
&& apt-get clean \
|
&& apt-get clean \
|
||||||
&& useradd -u 1000 -G sudo -U -m ftuser \
|
&& useradd -u 1000 -G sudo -U -m ftuser \
|
||||||
&& chown ftuser:ftuser /freqtrade \
|
&& chown ftuser:ftuser /freqtrade \
|
||||||
# Allow sudoers
|
# Allow sudoers
|
||||||
&& echo "ftuser ALL=(ALL) NOPASSWD: /bin/chown" >> /etc/sudoers \
|
&& echo "ftuser ALL=(ALL) NOPASSWD: /bin/chown" >> /etc/sudoers
|
||||||
&& pip install --upgrade pip
|
|
||||||
|
|
||||||
WORKDIR /freqtrade
|
WORKDIR /freqtrade
|
||||||
|
|
||||||
@@ -26,16 +25,18 @@ FROM base as python-deps
|
|||||||
RUN apt-get update \
|
RUN apt-get update \
|
||||||
&& apt-get -y install build-essential libssl-dev libffi-dev libgfortran5 pkg-config cmake gcc \
|
&& apt-get -y install build-essential libssl-dev libffi-dev libgfortran5 pkg-config cmake gcc \
|
||||||
&& apt-get clean \
|
&& apt-get clean \
|
||||||
|
&& pip install --upgrade pip \
|
||||||
&& echo "[global]\nextra-index-url=https://www.piwheels.org/simple" > /etc/pip.conf
|
&& echo "[global]\nextra-index-url=https://www.piwheels.org/simple" > /etc/pip.conf
|
||||||
|
|
||||||
# Install TA-lib
|
# Install TA-lib
|
||||||
COPY build_helpers/* /tmp/
|
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
|
# Install dependencies
|
||||||
COPY --chown=ftuser:ftuser requirements.txt /freqtrade/
|
COPY --chown=ftuser:ftuser requirements.txt /freqtrade/
|
||||||
USER ftuser
|
USER ftuser
|
||||||
RUN pip install --user --no-cache-dir "numpy<3.0" \
|
RUN pip install --user --no-cache-dir numpy \
|
||||||
&& pip install --user --no-index --find-links /tmp/ pyarrow TA-Lib \
|
|
||||||
&& pip install --user --no-cache-dir -r requirements.txt
|
&& pip install --user --no-cache-dir -r requirements.txt
|
||||||
|
|
||||||
# Copy dependencies to runtime-image
|
# Copy dependencies to runtime-image
|
||||||
|
|||||||
@@ -1,8 +0,0 @@
|
|||||||
ARG sourceimage=freqtradeorg/freqtrade
|
|
||||||
ARG sourcetag=develop_freqai
|
|
||||||
FROM ${sourceimage}:${sourcetag}
|
|
||||||
|
|
||||||
# Install dependencies
|
|
||||||
COPY requirements-freqai.txt requirements-freqai-rl.txt /freqtrade/
|
|
||||||
|
|
||||||
RUN pip install -r requirements-freqai-rl.txt --user --no-cache-dir
|
|
||||||
@@ -1,8 +1,8 @@
|
|||||||
FROM freqtradeorg/freqtrade:develop_plot
|
FROM freqtradeorg/freqtrade:develop_plot
|
||||||
|
|
||||||
|
|
||||||
# Pin prompt-toolkit to avoid questionary version conflict
|
# Pin jupyter-client to avoid tornado version conflict
|
||||||
RUN pip install jupyterlab "prompt-toolkit<=3.0.36" jupyter-client --user --no-cache-dir
|
RUN pip install jupyterlab jupyter-client==7.3.4 --user --no-cache-dir
|
||||||
|
|
||||||
# Empty the ENTRYPOINT to allow all commands
|
# Empty the ENTRYPOINT to allow all commands
|
||||||
ENTRYPOINT []
|
ENTRYPOINT []
|
||||||
|
|||||||
@@ -1,35 +0,0 @@
|
|||||||
---
|
|
||||||
services:
|
|
||||||
freqtrade:
|
|
||||||
image: freqtradeorg/freqtrade:stable_freqaitorch
|
|
||||||
# # Enable GPU Image and GPU Resources
|
|
||||||
# # Make sure to uncomment the whole deploy section
|
|
||||||
# deploy:
|
|
||||||
# resources:
|
|
||||||
# reservations:
|
|
||||||
# devices:
|
|
||||||
# - driver: nvidia
|
|
||||||
# count: 1
|
|
||||||
# capabilities: [gpu]
|
|
||||||
|
|
||||||
# Build step - only needed when additional dependencies are needed
|
|
||||||
# build:
|
|
||||||
# context: .
|
|
||||||
# dockerfile: "./docker/Dockerfile.custom"
|
|
||||||
restart: unless-stopped
|
|
||||||
container_name: freqtrade
|
|
||||||
volumes:
|
|
||||||
- "./user_data:/freqtrade/user_data"
|
|
||||||
# Expose api on port 8080 (localhost only)
|
|
||||||
# Please read the https://www.freqtrade.io/en/stable/rest-api/ documentation
|
|
||||||
# for more information.
|
|
||||||
ports:
|
|
||||||
- "127.0.0.1:8080:8080"
|
|
||||||
# Default command used when running `docker compose up`
|
|
||||||
command: >
|
|
||||||
trade
|
|
||||||
--logfile /freqtrade/user_data/logs/freqtrade.log
|
|
||||||
--db-url sqlite:////freqtrade/user_data/tradesv3.sqlite
|
|
||||||
--config /freqtrade/user_data/config.json
|
|
||||||
--freqaimodel XGBoostRegressor
|
|
||||||
--strategy FreqaiExampleStrategy
|
|
||||||
@@ -1,11 +1,12 @@
|
|||||||
---
|
---
|
||||||
|
version: '3'
|
||||||
services:
|
services:
|
||||||
ft_jupyterlab:
|
ft_jupyterlab:
|
||||||
build:
|
build:
|
||||||
context: ..
|
context: ..
|
||||||
dockerfile: docker/Dockerfile.jupyter
|
dockerfile: docker/Dockerfile.jupyter
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
# container_name: freqtrade
|
container_name: freqtrade
|
||||||
ports:
|
ports:
|
||||||
- "127.0.0.1:8888:8888"
|
- "127.0.0.1:8888:8888"
|
||||||
volumes:
|
volumes:
|
||||||
|
|||||||
BIN
docs/JOSS_paper/assets/freqai_algo.jpg
Normal file
|
After Width: | Height: | Size: 345 KiB |
BIN
docs/JOSS_paper/assets/freqai_algorithm-diagram.jpg
Normal file
|
After Width: | Height: | Size: 490 KiB |
15
docs/JOSS_paper/note_to_editors.txt
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
Dear Editors,
|
||||||
|
We present a paper for ``FreqAI`` a machine learning sandbox for researchers and citizen scientists alike.
|
||||||
|
There are a large number of authors, however all have contributed in a significant way to this paper.
|
||||||
|
For clarity the contribution of each author is outlined:
|
||||||
|
|
||||||
|
- Robert Caulk : Conception and software development
|
||||||
|
- Elin Tornquist : Theoretical brainstorming, data analysis, tool dev
|
||||||
|
- Matthias Voppichler : Software architecture and code review
|
||||||
|
- Andrew R. Lawless : Extensive testing, feature brainstorming
|
||||||
|
- Ryan McMullan : Extensive testing, feature brainstorming
|
||||||
|
- Wagner Costa Santos : Major backtesting developments, extensive testing
|
||||||
|
- Pascal Schmidt : Extensive testing, feature brainstorming
|
||||||
|
- Timothy C. Pogue : Webhooks forecast sharing
|
||||||
|
- Stefan P. Gehring : Extensive testing, feature brainstorming
|
||||||
|
- Johan van der Vlugt : Extensive testing, feature brainstorming
|
||||||
207
docs/JOSS_paper/paper.bib
Normal file
@@ -0,0 +1,207 @@
|
|||||||
|
@article{scikit-learn,
|
||||||
|
title={Scikit-learn: Machine Learning in {P}ython},
|
||||||
|
author={Pedregosa, F. and Varoquaux, G. and Gramfort, A. and Michel, V.
|
||||||
|
and Thirion, B. and Grisel, O. and Blondel, M. and Prettenhofer, P.
|
||||||
|
and Weiss, R. and Dubourg, V. and Vanderplas, J. and Passos, A. and
|
||||||
|
Cournapeau, D. and Brucher, M. and Perrot, M. and Duchesnay, E.},
|
||||||
|
journal={Journal of Machine Learning Research},
|
||||||
|
volume={12},
|
||||||
|
pages={2825--2830},
|
||||||
|
year={2011}
|
||||||
|
}
|
||||||
|
|
||||||
|
@inproceedings{catboost,
|
||||||
|
author = {Prokhorenkova, Liudmila and Gusev, Gleb and Vorobev, Aleksandr and Dorogush, Anna Veronika and Gulin, Andrey},
|
||||||
|
title = {CatBoost: Unbiased Boosting with Categorical Features},
|
||||||
|
year = {2018},
|
||||||
|
publisher = {Curran Associates Inc.},
|
||||||
|
address = {Red Hook, NY, USA},
|
||||||
|
abstract = {This paper presents the key algorithmic techniques behind CatBoost, a new gradient boosting toolkit. Their combination leads to CatBoost outperforming other publicly available boosting implementations in terms of quality on a variety of datasets. Two critical algorithmic advances introduced in CatBoost are the implementation of ordered boosting, a permutation-driven alternative to the classic algorithm, and an innovative algorithm for processing categorical features. Both techniques were created to fight a prediction shift caused by a special kind of target leakage present in all currently existing implementations of gradient boosting algorithms. In this paper, we provide a detailed analysis of this problem and demonstrate that proposed algorithms solve it effectively, leading to excellent empirical results.},
|
||||||
|
booktitle = {Proceedings of the 32nd International Conference on Neural Information Processing Systems},
|
||||||
|
pages = {6639–6649},
|
||||||
|
numpages = {11},
|
||||||
|
location = {Montr\'{e}al, Canada},
|
||||||
|
series = {NIPS'18}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@article{lightgbm,
|
||||||
|
title={Lightgbm: A highly efficient gradient boosting decision tree},
|
||||||
|
author={Ke, Guolin and Meng, Qi and Finley, Thomas and Wang, Taifeng and Chen, Wei and Ma, Weidong and Ye, Qiwei and Liu, Tie-Yan},
|
||||||
|
journal={Advances in neural information processing systems},
|
||||||
|
volume={30},
|
||||||
|
pages={3146--3154},
|
||||||
|
year={2017}
|
||||||
|
}
|
||||||
|
|
||||||
|
@inproceedings{xgboost,
|
||||||
|
author = {Chen, Tianqi and Guestrin, Carlos},
|
||||||
|
title = {{XGBoost}: A Scalable Tree Boosting System},
|
||||||
|
booktitle = {Proceedings of the 22nd ACM SIGKDD International Conference on Knowledge Discovery and Data Mining},
|
||||||
|
series = {KDD '16},
|
||||||
|
year = {2016},
|
||||||
|
isbn = {978-1-4503-4232-2},
|
||||||
|
location = {San Francisco, California, USA},
|
||||||
|
pages = {785--794},
|
||||||
|
numpages = {10},
|
||||||
|
url = {http://doi.acm.org/10.1145/2939672.2939785},
|
||||||
|
doi = {10.1145/2939672.2939785},
|
||||||
|
acmid = {2939785},
|
||||||
|
publisher = {ACM},
|
||||||
|
address = {New York, NY, USA},
|
||||||
|
keywords = {large-scale machine learning},
|
||||||
|
}
|
||||||
|
|
||||||
|
@article{stable-baselines3,
|
||||||
|
author = {Antonin Raffin and Ashley Hill and Adam Gleave and Anssi Kanervisto and Maximilian Ernestus and Noah Dormann},
|
||||||
|
title = {Stable-Baselines3: Reliable Reinforcement Learning Implementations},
|
||||||
|
journal = {Journal of Machine Learning Research},
|
||||||
|
year = {2021},
|
||||||
|
volume = {22},
|
||||||
|
number = {268},
|
||||||
|
pages = {1-8},
|
||||||
|
url = {http://jmlr.org/papers/v22/20-1364.html}
|
||||||
|
}
|
||||||
|
|
||||||
|
@misc{openai,
|
||||||
|
title={OpenAI Gym},
|
||||||
|
author={Greg Brockman and Vicki Cheung and Ludwig Pettersson and Jonas Schneider and John Schulman and Jie Tang and Wojciech Zaremba},
|
||||||
|
year={2016},
|
||||||
|
eprint={1606.01540},
|
||||||
|
archivePrefix={arXiv},
|
||||||
|
primaryClass={cs.LG}
|
||||||
|
}
|
||||||
|
|
||||||
|
@misc{tensorflow,
|
||||||
|
title={ {TensorFlow}: Large-Scale Machine Learning on Heterogeneous Systems},
|
||||||
|
url={https://www.tensorflow.org/},
|
||||||
|
note={Software available from tensorflow.org},
|
||||||
|
author={
|
||||||
|
Mart\'{i}n~Abadi and
|
||||||
|
Ashish~Agarwal and
|
||||||
|
Paul~Barham and
|
||||||
|
Eugene~Brevdo and
|
||||||
|
Zhifeng~Chen and
|
||||||
|
Craig~Citro and
|
||||||
|
Greg~S.~Corrado and
|
||||||
|
Andy~Davis and
|
||||||
|
Jeffrey~Dean and
|
||||||
|
Matthieu~Devin and
|
||||||
|
Sanjay~Ghemawat and
|
||||||
|
Ian~Goodfellow and
|
||||||
|
Andrew~Harp and
|
||||||
|
Geoffrey~Irving and
|
||||||
|
Michael~Isard and
|
||||||
|
Yangqing Jia and
|
||||||
|
Rafal~Jozefowicz and
|
||||||
|
Lukasz~Kaiser and
|
||||||
|
Manjunath~Kudlur and
|
||||||
|
Josh~Levenberg and
|
||||||
|
Dandelion~Man\'{e} and
|
||||||
|
Rajat~Monga and
|
||||||
|
Sherry~Moore and
|
||||||
|
Derek~Murray and
|
||||||
|
Chris~Olah and
|
||||||
|
Mike~Schuster and
|
||||||
|
Jonathon~Shlens and
|
||||||
|
Benoit~Steiner and
|
||||||
|
Ilya~Sutskever and
|
||||||
|
Kunal~Talwar and
|
||||||
|
Paul~Tucker and
|
||||||
|
Vincent~Vanhoucke and
|
||||||
|
Vijay~Vasudevan and
|
||||||
|
Fernanda~Vi\'{e}gas and
|
||||||
|
Oriol~Vinyals and
|
||||||
|
Pete~Warden and
|
||||||
|
Martin~Wattenberg and
|
||||||
|
Martin~Wicke and
|
||||||
|
Yuan~Yu and
|
||||||
|
Xiaoqiang~Zheng},
|
||||||
|
year={2015},
|
||||||
|
}
|
||||||
|
|
||||||
|
@incollection{pytorch,
|
||||||
|
title = {PyTorch: An Imperative Style, High-Performance Deep Learning Library},
|
||||||
|
author = {Paszke, Adam and Gross, Sam and Massa, Francisco and Lerer, Adam and Bradbury, James and Chanan, Gregory and Killeen, Trevor and Lin, Zeming and Gimelshein, Natalia and Antiga, Luca and Desmaison, Alban and Kopf, Andreas and Yang, Edward and DeVito, Zachary and Raison, Martin and Tejani, Alykhan and Chilamkurthy, Sasank and Steiner, Benoit and Fang, Lu and Bai, Junjie and Chintala, Soumith},
|
||||||
|
booktitle = {Advances in Neural Information Processing Systems 32},
|
||||||
|
editor = {H. Wallach and H. Larochelle and A. Beygelzimer and F. d\textquotesingle Alch\'{e}-Buc and E. Fox and R. Garnett},
|
||||||
|
pages = {8024--8035},
|
||||||
|
year = {2019},
|
||||||
|
publisher = {Curran Associates, Inc.},
|
||||||
|
url = {http://papers.neurips.cc/paper/9015-pytorch-an-imperative-style-high-performance-deep-learning-library.pdf}
|
||||||
|
}
|
||||||
|
|
||||||
|
@ARTICLE{scipy,
|
||||||
|
author = {Virtanen, Pauli and Gommers, Ralf and Oliphant, Travis E. and
|
||||||
|
Haberland, Matt and Reddy, Tyler and Cournapeau, David and
|
||||||
|
Burovski, Evgeni and Peterson, Pearu and Weckesser, Warren and
|
||||||
|
Bright, Jonathan and {van der Walt}, St{\'e}fan J. and
|
||||||
|
Brett, Matthew and Wilson, Joshua and Millman, K. Jarrod and
|
||||||
|
Mayorov, Nikolay and Nelson, Andrew R. J. and Jones, Eric and
|
||||||
|
Kern, Robert and Larson, Eric and Carey, C J and
|
||||||
|
Polat, {\.I}lhan and Feng, Yu and Moore, Eric W. and
|
||||||
|
{VanderPlas}, Jake and Laxalde, Denis and Perktold, Josef and
|
||||||
|
Cimrman, Robert and Henriksen, Ian and Quintero, E. A. and
|
||||||
|
Harris, Charles R. and Archibald, Anne M. and
|
||||||
|
Ribeiro, Ant{\^o}nio H. and Pedregosa, Fabian and
|
||||||
|
{van Mulbregt}, Paul and {SciPy 1.0 Contributors}},
|
||||||
|
title = {{{SciPy} 1.0: Fundamental Algorithms for Scientific
|
||||||
|
Computing in Python}},
|
||||||
|
journal = {Nature Methods},
|
||||||
|
year = {2020},
|
||||||
|
volume = {17},
|
||||||
|
pages = {261--272},
|
||||||
|
adsurl = {https://rdcu.be/b08Wh},
|
||||||
|
doi = {10.1038/s41592-019-0686-2},
|
||||||
|
}
|
||||||
|
|
||||||
|
@Article{numpy,
|
||||||
|
title = {Array programming with {NumPy}},
|
||||||
|
author = {Charles R. Harris and K. Jarrod Millman and St{\'{e}}fan J.
|
||||||
|
van der Walt and Ralf Gommers and Pauli Virtanen and David
|
||||||
|
Cournapeau and Eric Wieser and Julian Taylor and Sebastian
|
||||||
|
Berg and Nathaniel J. Smith and Robert Kern and Matti Picus
|
||||||
|
and Stephan Hoyer and Marten H. van Kerkwijk and Matthew
|
||||||
|
Brett and Allan Haldane and Jaime Fern{\'{a}}ndez del
|
||||||
|
R{\'{i}}o and Mark Wiebe and Pearu Peterson and Pierre
|
||||||
|
G{\'{e}}rard-Marchant and Kevin Sheppard and Tyler Reddy and
|
||||||
|
Warren Weckesser and Hameer Abbasi and Christoph Gohlke and
|
||||||
|
Travis E. Oliphant},
|
||||||
|
year = {2020},
|
||||||
|
month = sep,
|
||||||
|
journal = {Nature},
|
||||||
|
volume = {585},
|
||||||
|
number = {7825},
|
||||||
|
pages = {357--362},
|
||||||
|
doi = {10.1038/s41586-020-2649-2},
|
||||||
|
publisher = {Springer Science and Business Media {LLC}},
|
||||||
|
url = {https://doi.org/10.1038/s41586-020-2649-2}
|
||||||
|
}
|
||||||
|
|
||||||
|
@inproceedings{pandas,
|
||||||
|
title={Data structures for statistical computing in python},
|
||||||
|
author={McKinney, Wes and others},
|
||||||
|
booktitle={Proceedings of the 9th Python in Science Conference},
|
||||||
|
volume={445},
|
||||||
|
pages={51--56},
|
||||||
|
year={2010},
|
||||||
|
organization={Austin, TX},
|
||||||
|
doi={10.25080/Majora-92bf1922-00a}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@online{finrl,
|
||||||
|
title = {AI4Finance-Foundation},
|
||||||
|
year = 2022,
|
||||||
|
url = {https://github.com/AI4Finance-Foundation/FinRL},
|
||||||
|
urldate = {2022-09-30}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@online{tensortrade,
|
||||||
|
title = {tensortrade},
|
||||||
|
year = 2022,
|
||||||
|
url = {https://tensortradex.readthedocs.io/en/latest/L},
|
||||||
|
urldate = {2022-09-30}
|
||||||
|
}
|
||||||
941
docs/JOSS_paper/paper.jats
Normal file
@@ -0,0 +1,941 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8" ?>
|
||||||
|
<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Publishing DTD v1.2 20190208//EN"
|
||||||
|
"JATS-publishing1.dtd">
|
||||||
|
<article xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink" dtd-version="1.2" article-type="other">
|
||||||
|
<front>
|
||||||
|
<journal-meta>
|
||||||
|
<journal-id></journal-id>
|
||||||
|
<journal-title-group>
|
||||||
|
<journal-title>Journal of Open Source Software</journal-title>
|
||||||
|
<abbrev-journal-title>JOSS</abbrev-journal-title>
|
||||||
|
</journal-title-group>
|
||||||
|
<issn publication-format="electronic">2475-9066</issn>
|
||||||
|
<publisher>
|
||||||
|
<publisher-name>Open Journals</publisher-name>
|
||||||
|
</publisher>
|
||||||
|
</journal-meta>
|
||||||
|
<article-meta>
|
||||||
|
<article-id pub-id-type="publisher-id">0</article-id>
|
||||||
|
<article-id pub-id-type="doi">N/A</article-id>
|
||||||
|
<title-group>
|
||||||
|
<article-title><monospace>FreqAI</monospace>: generalizing adaptive
|
||||||
|
modeling for chaotic time-series market forecasts</article-title>
|
||||||
|
</title-group>
|
||||||
|
<contrib-group>
|
||||||
|
<contrib contrib-type="author">
|
||||||
|
<contrib-id contrib-id-type="orcid">0000-0001-5618-8629</contrib-id>
|
||||||
|
<name>
|
||||||
|
<surname>Ph.D</surname>
|
||||||
|
<given-names>Robert A. Caulk</given-names>
|
||||||
|
</name>
|
||||||
|
<xref ref-type="aff" rid="aff-1"/>
|
||||||
|
<xref ref-type="aff" rid="aff-2"/>
|
||||||
|
</contrib>
|
||||||
|
<contrib contrib-type="author">
|
||||||
|
<contrib-id contrib-id-type="orcid">0000-0003-3289-8604</contrib-id>
|
||||||
|
<name>
|
||||||
|
<surname>Ph.D</surname>
|
||||||
|
<given-names>Elin Törnquist</given-names>
|
||||||
|
</name>
|
||||||
|
<xref ref-type="aff" rid="aff-1"/>
|
||||||
|
<xref ref-type="aff" rid="aff-2"/>
|
||||||
|
</contrib>
|
||||||
|
<contrib contrib-type="author">
|
||||||
|
<name>
|
||||||
|
<surname>Voppichler</surname>
|
||||||
|
<given-names>Matthias</given-names>
|
||||||
|
</name>
|
||||||
|
<xref ref-type="aff" rid="aff-2"/>
|
||||||
|
</contrib>
|
||||||
|
<contrib contrib-type="author">
|
||||||
|
<name>
|
||||||
|
<surname>Lawless</surname>
|
||||||
|
<given-names>Andrew R.</given-names>
|
||||||
|
</name>
|
||||||
|
<xref ref-type="aff" rid="aff-2"/>
|
||||||
|
</contrib>
|
||||||
|
<contrib contrib-type="author">
|
||||||
|
<name>
|
||||||
|
<surname>McMullan</surname>
|
||||||
|
<given-names>Ryan</given-names>
|
||||||
|
</name>
|
||||||
|
<xref ref-type="aff" rid="aff-2"/>
|
||||||
|
</contrib>
|
||||||
|
<contrib contrib-type="author">
|
||||||
|
<name>
|
||||||
|
<surname>Santos</surname>
|
||||||
|
<given-names>Wagner Costa</given-names>
|
||||||
|
</name>
|
||||||
|
<xref ref-type="aff" rid="aff-1"/>
|
||||||
|
<xref ref-type="aff" rid="aff-2"/>
|
||||||
|
</contrib>
|
||||||
|
<contrib contrib-type="author">
|
||||||
|
<name>
|
||||||
|
<surname>Pogue</surname>
|
||||||
|
<given-names>Timothy C.</given-names>
|
||||||
|
</name>
|
||||||
|
<xref ref-type="aff" rid="aff-1"/>
|
||||||
|
<xref ref-type="aff" rid="aff-2"/>
|
||||||
|
</contrib>
|
||||||
|
<contrib contrib-type="author">
|
||||||
|
<name>
|
||||||
|
<surname>van der Vlugt</surname>
|
||||||
|
<given-names>Johan</given-names>
|
||||||
|
</name>
|
||||||
|
<xref ref-type="aff" rid="aff-2"/>
|
||||||
|
</contrib>
|
||||||
|
<contrib contrib-type="author">
|
||||||
|
<name>
|
||||||
|
<surname>Gehring</surname>
|
||||||
|
<given-names>Stefan P.</given-names>
|
||||||
|
</name>
|
||||||
|
<xref ref-type="aff" rid="aff-2"/>
|
||||||
|
</contrib>
|
||||||
|
<contrib contrib-type="author">
|
||||||
|
<name>
|
||||||
|
<surname>Schmidt</surname>
|
||||||
|
<given-names>Pascal</given-names>
|
||||||
|
</name>
|
||||||
|
<xref ref-type="aff" rid="aff-2"/>
|
||||||
|
</contrib>
|
||||||
|
<aff id="aff-1">
|
||||||
|
<institution-wrap>
|
||||||
|
<institution>Emergent Methods LLC, Arvada Colorado, 80005,
|
||||||
|
USA</institution>
|
||||||
|
</institution-wrap>
|
||||||
|
</aff>
|
||||||
|
<aff id="aff-2">
|
||||||
|
<institution-wrap>
|
||||||
|
<institution>Freqtrade open source project</institution>
|
||||||
|
</institution-wrap>
|
||||||
|
</aff>
|
||||||
|
</contrib-group>
|
||||||
|
<volume>¿VOL?</volume>
|
||||||
|
<issue>¿ISSUE?</issue>
|
||||||
|
<fpage>¿PAGE?</fpage>
|
||||||
|
<permissions>
|
||||||
|
<copyright-statement>Authors of papers retain copyright and release the
|
||||||
|
work under a Creative Commons Attribution 4.0 International License (CC
|
||||||
|
BY 4.0)</copyright-statement>
|
||||||
|
<copyright-year>2022</copyright-year>
|
||||||
|
<copyright-holder>The article authors</copyright-holder>
|
||||||
|
<license license-type="open-access" xlink:href="https://creativecommons.org/licenses/by/4.0/">
|
||||||
|
<license-p>Authors of papers retain copyright and release the work under
|
||||||
|
a Creative Commons Attribution 4.0 International License (CC BY
|
||||||
|
4.0)</license-p>
|
||||||
|
</license>
|
||||||
|
</permissions>
|
||||||
|
<kwd-group kwd-group-type="author">
|
||||||
|
<kwd>Python</kwd>
|
||||||
|
<kwd>Machine Learning</kwd>
|
||||||
|
<kwd>adaptive modeling</kwd>
|
||||||
|
<kwd>chaotic systems</kwd>
|
||||||
|
<kwd>time-series forecasting</kwd>
|
||||||
|
</kwd-group>
|
||||||
|
</article-meta>
|
||||||
|
</front>
|
||||||
|
<body>
|
||||||
|
<sec id="statement-of-need">
|
||||||
|
<title>Statement of need</title>
|
||||||
|
<p>Forecasting chaotic time-series based systems, such as
|
||||||
|
equity/cryptocurrency markets, requires a broad set of tools geared
|
||||||
|
toward testing a wide range of hypotheses. Fortunately, a recent
|
||||||
|
maturation of robust machine learning libraries
|
||||||
|
(e.g. <monospace>scikit-learn</monospace>), has opened up a wide range
|
||||||
|
of research possibilities. Scientists from a diverse range of fields
|
||||||
|
can now easily prototype their studies on an abundance of established
|
||||||
|
machine learning algorithms. Similarly, these user-friendly libraries
|
||||||
|
enable “citzen scientists” to use their basic Python skills for
|
||||||
|
data-exploration. However, leveraging these machine learning libraries
|
||||||
|
on historical and live chaotic data sources can be logistically
|
||||||
|
difficult and expensive. Additionally, robust data-collection,
|
||||||
|
storage, and handling presents a disparate challenge.
|
||||||
|
<ext-link ext-link-type="uri" xlink:href="https://www.freqtrade.io/en/latest/freqai/"><monospace>FreqAI</monospace></ext-link>
|
||||||
|
aims to provide a generalized and extensible open-sourced framework
|
||||||
|
geared toward live deployments of adaptive modeling for market
|
||||||
|
forecasting. The <monospace>FreqAI</monospace> framework is
|
||||||
|
effectively a sandbox for the rich world of open-source machine
|
||||||
|
learning libraries. Inside the <monospace>FreqAI</monospace> sandbox,
|
||||||
|
users find they can combine a wide variety of third-party libraries to
|
||||||
|
test creative hypotheses on a free live 24/7 chaotic data source -
|
||||||
|
cryptocurrency exchange data.</p>
|
||||||
|
</sec>
|
||||||
|
<sec id="summary">
|
||||||
|
<title>Summary</title>
|
||||||
|
<p><ext-link ext-link-type="uri" xlink:href="https://www.freqtrade.io/en/latest/freqai/"><monospace>FreqAI</monospace></ext-link>
|
||||||
|
evolved from a desire to test and compare a range of adaptive
|
||||||
|
time-series forecasting methods on chaotic data. Cryptocurrency
|
||||||
|
markets provide a unique data source since they are operational 24/7
|
||||||
|
and the data is freely available. Luckily, an existing open-source
|
||||||
|
software,
|
||||||
|
<ext-link ext-link-type="uri" xlink:href="https://www.freqtrade.io/en/stable/"><monospace>Freqtrade</monospace></ext-link>,
|
||||||
|
had already matured under a range of talented developers to support
|
||||||
|
robust data collection/storage, as well as robust live environmental
|
||||||
|
interactions for standard algorithmic trading.
|
||||||
|
<monospace>Freqtrade</monospace> also provides a set of data
|
||||||
|
analysis/visualization tools for the evaluation of historical
|
||||||
|
performance as well as live environmental feedback.
|
||||||
|
<monospace>FreqAI</monospace> builds on top of
|
||||||
|
<monospace>Freqtrade</monospace> to include a user-friendly well
|
||||||
|
tested interface for integrating external machine learning libraries
|
||||||
|
for adaptive time-series forecasting. Beyond enabling the integration
|
||||||
|
of existing libraries, <monospace>FreqAI</monospace> hosts a range of
|
||||||
|
custom algorithms and methodologies aimed at improving computational
|
||||||
|
and predictive performances. Thus, <monospace>FreqAI</monospace>
|
||||||
|
contains a range of unique features which can be easily tested in
|
||||||
|
combination with all the existing Python-accessible machine learning
|
||||||
|
libraries to generate novel research on live and historical data.</p>
|
||||||
|
<p>The high-level overview of the software is depicted in Figure
|
||||||
|
1.</p>
|
||||||
|
<p><named-content content-type="image">freqai-algo</named-content>
|
||||||
|
<italic>Abstracted overview of FreqAI algorithm</italic></p>
|
||||||
|
<sec id="connecting-machine-learning-libraries">
|
||||||
|
<title>Connecting machine learning libraries</title>
|
||||||
|
<p>Although the <monospace>FreqAI</monospace> framework is designed
|
||||||
|
to accommodate any Python library in the “Model training” and
|
||||||
|
“Feature set engineering” portions of the software (Figure 1), it
|
||||||
|
already boasts a wide range of well documented examples based on
|
||||||
|
various combinations of:</p>
|
||||||
|
<list list-type="bullet">
|
||||||
|
<list-item>
|
||||||
|
<p>scikit-learn
|
||||||
|
(<xref alt="Pedregosa et al., 2011" rid="ref-scikit-learn" ref-type="bibr">Pedregosa
|
||||||
|
et al., 2011</xref>), Catboost
|
||||||
|
(<xref alt="Prokhorenkova et al., 2018" rid="ref-catboost" ref-type="bibr">Prokhorenkova
|
||||||
|
et al., 2018</xref>), LightGBM
|
||||||
|
(<xref alt="Ke et al., 2017" rid="ref-lightgbm" ref-type="bibr">Ke
|
||||||
|
et al., 2017</xref>), XGBoost
|
||||||
|
(<xref alt="Chen & Guestrin, 2016" rid="ref-xgboost" ref-type="bibr">Chen
|
||||||
|
& Guestrin, 2016</xref>), stable_baselines3
|
||||||
|
(<xref alt="Raffin et al., 2021" rid="ref-stable-baselines3" ref-type="bibr">Raffin
|
||||||
|
et al., 2021</xref>), openai gym
|
||||||
|
(<xref alt="Brockman et al., 2016" rid="ref-openai" ref-type="bibr">Brockman
|
||||||
|
et al., 2016</xref>), tensorflow
|
||||||
|
(<xref alt="Abadi et al., 2015" rid="ref-tensorflow" ref-type="bibr">Abadi
|
||||||
|
et al., 2015</xref>), pytorch
|
||||||
|
(<xref alt="Paszke et al., 2019" rid="ref-pytorch" ref-type="bibr">Paszke
|
||||||
|
et al., 2019</xref>), Scipy
|
||||||
|
(<xref alt="Virtanen et al., 2020" rid="ref-scipy" ref-type="bibr">Virtanen
|
||||||
|
et al., 2020</xref>), Numpy
|
||||||
|
(<xref alt="Harris et al., 2020" rid="ref-numpy" ref-type="bibr">Harris
|
||||||
|
et al., 2020</xref>), and pandas
|
||||||
|
(<xref alt="McKinney & others, 2010" rid="ref-pandas" ref-type="bibr">McKinney
|
||||||
|
& others, 2010</xref>).</p>
|
||||||
|
</list-item>
|
||||||
|
</list>
|
||||||
|
<p>These mature projects contain a wide range of peer-reviewed and
|
||||||
|
industry standard methods, including:</p>
|
||||||
|
<list list-type="bullet">
|
||||||
|
<list-item>
|
||||||
|
<p>Regression, Classification, Neural Networks, Reinforcement
|
||||||
|
Learning, Support Vector Machines, Principal Component Analysis,
|
||||||
|
point clustering, and much more.</p>
|
||||||
|
</list-item>
|
||||||
|
</list>
|
||||||
|
<p>which are all leveraged in <monospace>FreqAI</monospace> for
|
||||||
|
users to use as templates or extend with their own methods.</p>
|
||||||
|
</sec>
|
||||||
|
<sec id="furnishing-novel-methods-and-features">
|
||||||
|
<title>Furnishing novel methods and features</title>
|
||||||
|
<p>Beyond the industry standard methods available through external
|
||||||
|
libraries - <monospace>FreqAI</monospace> includes novel methods
|
||||||
|
which are not available anywhere else in the open-source (or
|
||||||
|
scientific) world. For example, <monospace>FreqAI</monospace>
|
||||||
|
provides :</p>
|
||||||
|
<list list-type="bullet">
|
||||||
|
<list-item>
|
||||||
|
<p>a custom algorithm/methodology for adaptive modeling</p>
|
||||||
|
</list-item>
|
||||||
|
<list-item>
|
||||||
|
<p>rapid and self-monitored feature engineering tools</p>
|
||||||
|
</list-item>
|
||||||
|
<list-item>
|
||||||
|
<p>unique model features/indicators</p>
|
||||||
|
</list-item>
|
||||||
|
<list-item>
|
||||||
|
<p>optimized data collection algorithms</p>
|
||||||
|
</list-item>
|
||||||
|
<list-item>
|
||||||
|
<p>safely integrated outlier detection methods</p>
|
||||||
|
</list-item>
|
||||||
|
<list-item>
|
||||||
|
<p>websocket communicated forecasts</p>
|
||||||
|
</list-item>
|
||||||
|
</list>
|
||||||
|
<p>Of particular interest for researchers,
|
||||||
|
<monospace>FreqAI</monospace> provides the option of large scale
|
||||||
|
experimentation via an optimized websocket communications
|
||||||
|
interface.</p>
|
||||||
|
</sec>
|
||||||
|
<sec id="optimizing-the-back-end">
|
||||||
|
<title>Optimizing the back-end</title>
|
||||||
|
<p><monospace>FreqAI</monospace> aims to make it simple for users to
|
||||||
|
combine all the above tools to run studies based in two distinct
|
||||||
|
modules:</p>
|
||||||
|
<list list-type="bullet">
|
||||||
|
<list-item>
|
||||||
|
<p>backtesting studies</p>
|
||||||
|
</list-item>
|
||||||
|
<list-item>
|
||||||
|
<p>live-deployments</p>
|
||||||
|
</list-item>
|
||||||
|
</list>
|
||||||
|
<p>Both of these modules and their respective data management
|
||||||
|
systems are built on top of
|
||||||
|
<ext-link ext-link-type="uri" xlink:href="https://www.freqtrade.io/en/latest/"><monospace>Freqtrade</monospace></ext-link>,
|
||||||
|
a mature and actively developed cryptocurrency trading software.
|
||||||
|
This means that <monospace>FreqAI</monospace> benefits from a wide
|
||||||
|
range of tangential/disparate feature developments such as:</p>
|
||||||
|
<list list-type="bullet">
|
||||||
|
<list-item>
|
||||||
|
<p>FreqUI, a graphical interface for backtesting and live
|
||||||
|
monitoring</p>
|
||||||
|
</list-item>
|
||||||
|
<list-item>
|
||||||
|
<p>telegram control</p>
|
||||||
|
</list-item>
|
||||||
|
<list-item>
|
||||||
|
<p>robust database handling</p>
|
||||||
|
</list-item>
|
||||||
|
<list-item>
|
||||||
|
<p>futures/leverage trading</p>
|
||||||
|
</list-item>
|
||||||
|
<list-item>
|
||||||
|
<p>dollar cost averaging</p>
|
||||||
|
</list-item>
|
||||||
|
<list-item>
|
||||||
|
<p>trading strategy handling</p>
|
||||||
|
</list-item>
|
||||||
|
<list-item>
|
||||||
|
<p>a variety of free data sources via CCXT (FTX, Binance, Kucoin
|
||||||
|
etc.)</p>
|
||||||
|
</list-item>
|
||||||
|
</list>
|
||||||
|
<p>These features derive from a strong external developer community
|
||||||
|
that shares in the benefit and stability of a communal CI
|
||||||
|
(Continuous Integration) system. Beyond the developer community,
|
||||||
|
<monospace>FreqAI</monospace> benefits strongly from the userbase of
|
||||||
|
<monospace>Freqtrade</monospace>, where most
|
||||||
|
<monospace>FreqAI</monospace> beta-testers/developers originated.
|
||||||
|
This symbiotic relationship between <monospace>Freqtrade</monospace>
|
||||||
|
and <monospace>FreqAI</monospace> ignited a thoroughly tested
|
||||||
|
<ext-link ext-link-type="uri" xlink:href="https://github.com/freqtrade/freqtrade/pull/6832"><monospace>beta</monospace></ext-link>,
|
||||||
|
which demanded a four month beta and
|
||||||
|
<ext-link ext-link-type="uri" xlink:href="https://www.freqtrade.io/en/latest/freqai/">comprehensive
|
||||||
|
documentation</ext-link> containing:</p>
|
||||||
|
<list list-type="bullet">
|
||||||
|
<list-item>
|
||||||
|
<p>numerous example scripts</p>
|
||||||
|
</list-item>
|
||||||
|
<list-item>
|
||||||
|
<p>a full parameter table</p>
|
||||||
|
</list-item>
|
||||||
|
<list-item>
|
||||||
|
<p>methodological descriptions</p>
|
||||||
|
</list-item>
|
||||||
|
<list-item>
|
||||||
|
<p>high-resolution diagrams/figures</p>
|
||||||
|
</list-item>
|
||||||
|
<list-item>
|
||||||
|
<p>detailed parameter setting recommendations</p>
|
||||||
|
</list-item>
|
||||||
|
</list>
|
||||||
|
</sec>
|
||||||
|
<sec id="providing-a-reproducible-foundation-for-researchers">
|
||||||
|
<title>Providing a reproducible foundation for researchers</title>
|
||||||
|
<p><monospace>FreqAI</monospace> provides an extensible, robust,
|
||||||
|
framework for researchers and citizen data scientists. The
|
||||||
|
<monospace>FreqAI</monospace> sandbox enables rapid conception and
|
||||||
|
testing of exotic hypotheses. From a research perspective,
|
||||||
|
<monospace>FreqAI</monospace> handles the multitude of logistics
|
||||||
|
associated with live deployments, historical backtesting, and
|
||||||
|
feature engineering. With <monospace>FreqAI</monospace>, researchers
|
||||||
|
can focus on their primary interests of feature engineering and
|
||||||
|
hypothesis testing rather than figuring out how to collect and
|
||||||
|
handle data. Further - the well maintained and easily installed
|
||||||
|
open-source framework of <monospace>FreqAI</monospace> enables
|
||||||
|
reproducible scientific studies. This reproducibility component is
|
||||||
|
essential to general scientific advancement in time-series
|
||||||
|
forecasting for chaotic systems.</p>
|
||||||
|
</sec>
|
||||||
|
</sec>
|
||||||
|
<sec id="technical-details">
|
||||||
|
<title>Technical details</title>
|
||||||
|
<p>Typical users configure <monospace>FreqAI</monospace> via two
|
||||||
|
files:</p>
|
||||||
|
<list list-type="order">
|
||||||
|
<list-item>
|
||||||
|
<p>A <monospace>configuration</monospace> file
|
||||||
|
(<monospace>--config</monospace>) which provides access to the
|
||||||
|
full parameter list available
|
||||||
|
<ext-link ext-link-type="uri" xlink:href="https://www.freqtrade.io/en/latest/freqai/">here</ext-link>:</p>
|
||||||
|
</list-item>
|
||||||
|
</list>
|
||||||
|
<list list-type="bullet">
|
||||||
|
<list-item>
|
||||||
|
<p>control high-level feature engineering</p>
|
||||||
|
</list-item>
|
||||||
|
<list-item>
|
||||||
|
<p>customize adaptive modeling techniques</p>
|
||||||
|
</list-item>
|
||||||
|
<list-item>
|
||||||
|
<p>set any model training parameters available in third-party
|
||||||
|
libraries</p>
|
||||||
|
</list-item>
|
||||||
|
<list-item>
|
||||||
|
<p>manage adaptive modeling parameters (retrain frequency,
|
||||||
|
training window size, continual learning, etc.)</p>
|
||||||
|
</list-item>
|
||||||
|
</list>
|
||||||
|
<list list-type="order">
|
||||||
|
<list-item>
|
||||||
|
<label>2.</label>
|
||||||
|
<p>A strategy file (<monospace>--strategy</monospace>) where
|
||||||
|
users:</p>
|
||||||
|
</list-item>
|
||||||
|
</list>
|
||||||
|
<list list-type="bullet">
|
||||||
|
<list-item>
|
||||||
|
<p>list of the base training features</p>
|
||||||
|
</list-item>
|
||||||
|
<list-item>
|
||||||
|
<p>set standard technical-analysis strategies</p>
|
||||||
|
</list-item>
|
||||||
|
<list-item>
|
||||||
|
<p>control trade entry/exit criteria</p>
|
||||||
|
</list-item>
|
||||||
|
</list>
|
||||||
|
<p>With these two files, most users can exploit a wide range of
|
||||||
|
pre-existing integrations in <monospace>Catboost</monospace> and 7
|
||||||
|
other libraries with a simple command:</p>
|
||||||
|
<preformat>freqtrade trade --config config_freqai.example.json --strategy FreqaiExampleStrategy --freqaimodel CatboostRegressor</preformat>
|
||||||
|
<p>Advanced users will edit one of the existing
|
||||||
|
<monospace>--freqaimodel</monospace> files, which are simply an
|
||||||
|
children of the <monospace>IFreqaiModel</monospace> (details below).
|
||||||
|
Within these files, advanced users can customize training procedures,
|
||||||
|
prediction procedures, outlier detection methods, data preparation,
|
||||||
|
data saving methods, etc. This is all configured in a way where they
|
||||||
|
can customize as little or as much as they want. This flexible
|
||||||
|
customization is owed to the foundational architecture in
|
||||||
|
<monospace>FreqAI</monospace>, which is comprised of three distinct
|
||||||
|
Python objects:</p>
|
||||||
|
<list list-type="bullet">
|
||||||
|
<list-item>
|
||||||
|
<p><monospace>IFreqaiModel</monospace></p>
|
||||||
|
<list list-type="bullet">
|
||||||
|
<list-item>
|
||||||
|
<p>A singular long-lived object containing all the necessary
|
||||||
|
logic to collect data, store data, process data, engineer
|
||||||
|
features, run training, and inference models.</p>
|
||||||
|
</list-item>
|
||||||
|
</list>
|
||||||
|
</list-item>
|
||||||
|
<list-item>
|
||||||
|
<p><monospace>FreqaiDataKitchen</monospace></p>
|
||||||
|
<list list-type="bullet">
|
||||||
|
<list-item>
|
||||||
|
<p>A short-lived object which is uniquely created for each
|
||||||
|
asset/model. Beyond metadata, it also contains a variety of
|
||||||
|
data processing tools.</p>
|
||||||
|
</list-item>
|
||||||
|
</list>
|
||||||
|
</list-item>
|
||||||
|
<list-item>
|
||||||
|
<p><monospace>FreqaiDataDrawer</monospace></p>
|
||||||
|
<list list-type="bullet">
|
||||||
|
<list-item>
|
||||||
|
<p>Singular long-lived object containing all the historical
|
||||||
|
predictions, models, and save/load methods.</p>
|
||||||
|
</list-item>
|
||||||
|
</list>
|
||||||
|
</list-item>
|
||||||
|
</list>
|
||||||
|
<p>These objects interact with one another with one goal in mind - to
|
||||||
|
provide a clean data set to machine learning experts/enthusiasts at
|
||||||
|
the user endpoint. These power-users interact with an inherited
|
||||||
|
<monospace>IFreqaiModel</monospace> that allows them to dig as deep or
|
||||||
|
as shallow as they wish into the inheritence tree. Typical power-users
|
||||||
|
focus their efforts on customizing training procedures and testing
|
||||||
|
exotic functionalities available in third-party libraries. Thus,
|
||||||
|
power-users are freed from the algorithmic weight associated with data
|
||||||
|
management, and can instead focus their energy on testing creative
|
||||||
|
hypotheses. Meanwhile, some users choose to override deeper
|
||||||
|
functionalities within <monospace>IFreqaiModel</monospace> to help
|
||||||
|
them craft unique data structures and training procedures.</p>
|
||||||
|
<p>The class structure and algorithmic details are depicted in the
|
||||||
|
following diagram:</p>
|
||||||
|
<p><named-content content-type="image">image</named-content>
|
||||||
|
<italic>Class diagram summarizing object interactions in
|
||||||
|
FreqAI</italic></p>
|
||||||
|
</sec>
|
||||||
|
<sec id="online-documentation">
|
||||||
|
<title>Online documentation</title>
|
||||||
|
<p>The documentation for
|
||||||
|
<ext-link ext-link-type="uri" xlink:href="https://www.freqtrade.io/en/latest/freqai/"><monospace>FreqAI</monospace></ext-link>
|
||||||
|
is available online at
|
||||||
|
<ext-link ext-link-type="uri" xlink:href="https://www.freqtrade.io/en/latest/freqai/">https://www.freqtrade.io/en/latest/freqai/</ext-link>
|
||||||
|
and covers a wide range of materials:</p>
|
||||||
|
<list list-type="bullet">
|
||||||
|
<list-item>
|
||||||
|
<p>Quick-start with a single command and example files -
|
||||||
|
(beginners)</p>
|
||||||
|
</list-item>
|
||||||
|
<list-item>
|
||||||
|
<p>Introduction to the feature engineering interface and basic
|
||||||
|
configurations - (intermediate users)</p>
|
||||||
|
</list-item>
|
||||||
|
<list-item>
|
||||||
|
<p>Parameter table with indepth descriptions and default parameter
|
||||||
|
setting recommendations - (intermediate users)</p>
|
||||||
|
</list-item>
|
||||||
|
<list-item>
|
||||||
|
<p>Data analysis and post-processing - (advanced users)</p>
|
||||||
|
</list-item>
|
||||||
|
<list-item>
|
||||||
|
<p>Methodological considerations complemented by high resolution
|
||||||
|
figures - (advanced users)</p>
|
||||||
|
</list-item>
|
||||||
|
<list-item>
|
||||||
|
<p>Instructions for integrating third party machine learning
|
||||||
|
libraries into custom prediction models - (advanced users)</p>
|
||||||
|
</list-item>
|
||||||
|
<list-item>
|
||||||
|
<p>Software architectural description with class diagram -
|
||||||
|
(developers)</p>
|
||||||
|
</list-item>
|
||||||
|
<list-item>
|
||||||
|
<p>File structure descriptions - (developers)</p>
|
||||||
|
</list-item>
|
||||||
|
</list>
|
||||||
|
<p>The docs direct users to a variety of pre-made examples which
|
||||||
|
integrate <monospace>Catboost</monospace>,
|
||||||
|
<monospace>LightGBM</monospace>, <monospace>XGBoost</monospace>,
|
||||||
|
<monospace>Sklearn</monospace>,
|
||||||
|
<monospace>stable_baselines3</monospace>,
|
||||||
|
<monospace>torch</monospace>, <monospace>tensorflow</monospace>.
|
||||||
|
Meanwhile, developers will also find thorough docstrings and type
|
||||||
|
hinting throughout the source code to aid in code readability and
|
||||||
|
customization.</p>
|
||||||
|
<p><monospace>FreqAI</monospace> also benefits from a strong support
|
||||||
|
network of users and developers on the
|
||||||
|
<ext-link ext-link-type="uri" xlink:href="https://discord.gg/w6nDM6cM4y"><monospace>Freqtrade</monospace>
|
||||||
|
discord</ext-link> as well as on the
|
||||||
|
<ext-link ext-link-type="uri" xlink:href="https://discord.gg/xE4RMg4QYw"><monospace>FreqAI</monospace>
|
||||||
|
discord</ext-link>. Within the <monospace>FreqAI</monospace> discord,
|
||||||
|
users will find a deep and easily searched knowledge base containing
|
||||||
|
common errors. But more importantly, users in the
|
||||||
|
<monospace>FreqAI</monospace> discord share anectdotal and
|
||||||
|
quantitative observations which compare performance between various
|
||||||
|
third-party libraries and methods.</p>
|
||||||
|
</sec>
|
||||||
|
<sec id="state-of-the-field">
|
||||||
|
<title>State of the field</title>
|
||||||
|
<p>There are two other open-source tools which are geared toward
|
||||||
|
helping users build models for time-series forecasts on market based
|
||||||
|
data. However, each of these tools suffer from a non-generalized
|
||||||
|
frameworks that do not permit comparison of methods and libraries.
|
||||||
|
Additionally, they do not permit easy live-deployments or
|
||||||
|
adaptive-modeling methods. For example, two open-sourced projects
|
||||||
|
called
|
||||||
|
<ext-link ext-link-type="uri" xlink:href="https://tensortradex.readthedocs.io/en/latest/"><monospace>tensortrade</monospace></ext-link>
|
||||||
|
(<xref alt="Tensortrade, 2022" rid="ref-tensortrade" ref-type="bibr"><italic>Tensortrade</italic>,
|
||||||
|
2022</xref>) and
|
||||||
|
<ext-link ext-link-type="uri" xlink:href="https://github.com/AI4Finance-Foundation/FinRL"><monospace>FinRL</monospace></ext-link>
|
||||||
|
(<xref alt="AI4Finance-Foundation, 2022" rid="ref-finrl" ref-type="bibr"><italic>AI4Finance-Foundation</italic>,
|
||||||
|
2022</xref>) limit users to the exploration of reinforcement learning
|
||||||
|
on historical data. These softwares also do not provide robust live
|
||||||
|
deployments, they do not furnish novel feature engineering algorithms,
|
||||||
|
and they do not provide custom data analysis tools.
|
||||||
|
<monospace>FreqAI</monospace> fills the gap.</p>
|
||||||
|
</sec>
|
||||||
|
<sec id="on-going-research">
|
||||||
|
<title>On-going research</title>
|
||||||
|
<p>Emergent Methods, based in Arvada CO, is actively using
|
||||||
|
<monospace>FreqAI</monospace> to perform large scale experiments aimed
|
||||||
|
at comparing machine learning libraries in live and historical
|
||||||
|
environments. Past projects include backtesting parametric sweeps,
|
||||||
|
while active projects include a 3 week live deployment comparison
|
||||||
|
between <monospace>CatboosRegressor</monospace>,
|
||||||
|
<monospace>LightGBMRegressor</monospace>, and
|
||||||
|
<monospace>XGBoostRegressor</monospace>. Results from these studies
|
||||||
|
are on track for publication in scientific journals as well as more
|
||||||
|
general data science blogs (e.g. Medium).</p>
|
||||||
|
</sec>
|
||||||
|
<sec id="installing-and-running-freqai">
|
||||||
|
<title>Installing and running <monospace>FreqAI</monospace></title>
|
||||||
|
<p><monospace>FreqAI</monospace> is automatically installed with
|
||||||
|
<monospace>Freqtrade</monospace> using the following commands on linux
|
||||||
|
systems:</p>
|
||||||
|
<preformat>git clone git@github.com:freqtrade/freqtrade.git
|
||||||
|
cd freqtrade
|
||||||
|
./setup.sh -i</preformat>
|
||||||
|
<p>However, <monospace>FreqAI</monospace> also benefits from
|
||||||
|
<monospace>Freqtrade</monospace> docker distributions, and can be run
|
||||||
|
with docker by pulling the stable or develop images from
|
||||||
|
<monospace>Freqtrade</monospace> distributions.</p>
|
||||||
|
</sec>
|
||||||
|
<sec id="funding-sources">
|
||||||
|
<title>Funding sources</title>
|
||||||
|
<p><ext-link ext-link-type="uri" xlink:href="https://www.freqtrade.io/en/latest/freqai/"><monospace>FreqAI</monospace></ext-link>
|
||||||
|
has had no official sponsors, and is entirely grass roots. All
|
||||||
|
donations into the project (e.g. the GitHub sponsor system) are kept
|
||||||
|
inside the project to help support development of open-sourced and
|
||||||
|
communally beneficial features.</p>
|
||||||
|
</sec>
|
||||||
|
<sec id="acknowledgements">
|
||||||
|
<title>Acknowledgements</title>
|
||||||
|
<p>We would like to acknowledge various beta testers of
|
||||||
|
<monospace>FreqAI</monospace>:</p>
|
||||||
|
<list list-type="bullet">
|
||||||
|
<list-item>
|
||||||
|
<p>Richárd Józsa</p>
|
||||||
|
</list-item>
|
||||||
|
<list-item>
|
||||||
|
<p>Juha Nykänen</p>
|
||||||
|
</list-item>
|
||||||
|
<list-item>
|
||||||
|
<p>Salah Lamkadem</p>
|
||||||
|
</list-item>
|
||||||
|
</list>
|
||||||
|
<p>As well as various <monospace>Freqtrade</monospace>
|
||||||
|
<ext-link ext-link-type="uri" xlink:href="https://github.com/freqtrade/freqtrade/graphs/contributors">developers</ext-link>
|
||||||
|
maintaining tangential, yet essential, modules.</p>
|
||||||
|
</sec>
|
||||||
|
</body>
|
||||||
|
<back>
|
||||||
|
<ref-list>
|
||||||
|
<ref id="ref-scikit-learn">
|
||||||
|
<element-citation publication-type="article-journal">
|
||||||
|
<person-group person-group-type="author">
|
||||||
|
<name><surname>Pedregosa</surname><given-names>F.</given-names></name>
|
||||||
|
<name><surname>Varoquaux</surname><given-names>G.</given-names></name>
|
||||||
|
<name><surname>Gramfort</surname><given-names>A.</given-names></name>
|
||||||
|
<name><surname>Michel</surname><given-names>V.</given-names></name>
|
||||||
|
<name><surname>Thirion</surname><given-names>B.</given-names></name>
|
||||||
|
<name><surname>Grisel</surname><given-names>O.</given-names></name>
|
||||||
|
<name><surname>Blondel</surname><given-names>M.</given-names></name>
|
||||||
|
<name><surname>Prettenhofer</surname><given-names>P.</given-names></name>
|
||||||
|
<name><surname>Weiss</surname><given-names>R.</given-names></name>
|
||||||
|
<name><surname>Dubourg</surname><given-names>V.</given-names></name>
|
||||||
|
<name><surname>Vanderplas</surname><given-names>J.</given-names></name>
|
||||||
|
<name><surname>Passos</surname><given-names>A.</given-names></name>
|
||||||
|
<name><surname>Cournapeau</surname><given-names>D.</given-names></name>
|
||||||
|
<name><surname>Brucher</surname><given-names>M.</given-names></name>
|
||||||
|
<name><surname>Perrot</surname><given-names>M.</given-names></name>
|
||||||
|
<name><surname>Duchesnay</surname><given-names>E.</given-names></name>
|
||||||
|
</person-group>
|
||||||
|
<article-title>Scikit-learn: Machine learning in Python</article-title>
|
||||||
|
<source>Journal of Machine Learning Research</source>
|
||||||
|
<year iso-8601-date="2011">2011</year>
|
||||||
|
<volume>12</volume>
|
||||||
|
<fpage>2825</fpage>
|
||||||
|
<lpage>2830</lpage>
|
||||||
|
</element-citation>
|
||||||
|
</ref>
|
||||||
|
<ref id="ref-catboost">
|
||||||
|
<element-citation publication-type="paper-conference">
|
||||||
|
<person-group person-group-type="author">
|
||||||
|
<name><surname>Prokhorenkova</surname><given-names>Liudmila</given-names></name>
|
||||||
|
<name><surname>Gusev</surname><given-names>Gleb</given-names></name>
|
||||||
|
<name><surname>Vorobev</surname><given-names>Aleksandr</given-names></name>
|
||||||
|
<name><surname>Dorogush</surname><given-names>Anna Veronika</given-names></name>
|
||||||
|
<name><surname>Gulin</surname><given-names>Andrey</given-names></name>
|
||||||
|
</person-group>
|
||||||
|
<article-title>CatBoost: Unbiased boosting with categorical features</article-title>
|
||||||
|
<source>Proceedings of the 32nd international conference on neural information processing systems</source>
|
||||||
|
<publisher-name>Curran Associates Inc.</publisher-name>
|
||||||
|
<publisher-loc>Red Hook, NY, USA</publisher-loc>
|
||||||
|
<year iso-8601-date="2018">2018</year>
|
||||||
|
<fpage>6639</fpage>
|
||||||
|
<lpage>6649</lpage>
|
||||||
|
</element-citation>
|
||||||
|
</ref>
|
||||||
|
<ref id="ref-lightgbm">
|
||||||
|
<element-citation publication-type="article-journal">
|
||||||
|
<person-group person-group-type="author">
|
||||||
|
<name><surname>Ke</surname><given-names>Guolin</given-names></name>
|
||||||
|
<name><surname>Meng</surname><given-names>Qi</given-names></name>
|
||||||
|
<name><surname>Finley</surname><given-names>Thomas</given-names></name>
|
||||||
|
<name><surname>Wang</surname><given-names>Taifeng</given-names></name>
|
||||||
|
<name><surname>Chen</surname><given-names>Wei</given-names></name>
|
||||||
|
<name><surname>Ma</surname><given-names>Weidong</given-names></name>
|
||||||
|
<name><surname>Ye</surname><given-names>Qiwei</given-names></name>
|
||||||
|
<name><surname>Liu</surname><given-names>Tie-Yan</given-names></name>
|
||||||
|
</person-group>
|
||||||
|
<article-title>Lightgbm: A highly efficient gradient boosting decision tree</article-title>
|
||||||
|
<source>Advances in neural information processing systems</source>
|
||||||
|
<year iso-8601-date="2017">2017</year>
|
||||||
|
<volume>30</volume>
|
||||||
|
<fpage>3146</fpage>
|
||||||
|
<lpage>3154</lpage>
|
||||||
|
</element-citation>
|
||||||
|
</ref>
|
||||||
|
<ref id="ref-xgboost">
|
||||||
|
<element-citation publication-type="paper-conference">
|
||||||
|
<person-group person-group-type="author">
|
||||||
|
<name><surname>Chen</surname><given-names>Tianqi</given-names></name>
|
||||||
|
<name><surname>Guestrin</surname><given-names>Carlos</given-names></name>
|
||||||
|
</person-group>
|
||||||
|
<article-title>XGBoost: A scalable tree boosting system</article-title>
|
||||||
|
<source>Proceedings of the 22nd ACM SIGKDD international conference on knowledge discovery and data mining</source>
|
||||||
|
<publisher-name>ACM</publisher-name>
|
||||||
|
<publisher-loc>New York, NY, USA</publisher-loc>
|
||||||
|
<year iso-8601-date="2016">2016</year>
|
||||||
|
<isbn>978-1-4503-4232-2</isbn>
|
||||||
|
<uri>http://doi.acm.org/10.1145/2939672.2939785</uri>
|
||||||
|
<pub-id pub-id-type="doi">10.1145/2939672.2939785</pub-id>
|
||||||
|
<fpage>785</fpage>
|
||||||
|
<lpage>794</lpage>
|
||||||
|
</element-citation>
|
||||||
|
</ref>
|
||||||
|
<ref id="ref-stable-baselines3">
|
||||||
|
<element-citation publication-type="article-journal">
|
||||||
|
<person-group person-group-type="author">
|
||||||
|
<name><surname>Raffin</surname><given-names>Antonin</given-names></name>
|
||||||
|
<name><surname>Hill</surname><given-names>Ashley</given-names></name>
|
||||||
|
<name><surname>Gleave</surname><given-names>Adam</given-names></name>
|
||||||
|
<name><surname>Kanervisto</surname><given-names>Anssi</given-names></name>
|
||||||
|
<name><surname>Ernestus</surname><given-names>Maximilian</given-names></name>
|
||||||
|
<name><surname>Dormann</surname><given-names>Noah</given-names></name>
|
||||||
|
</person-group>
|
||||||
|
<article-title>Stable-Baselines3: Reliable reinforcement learning implementations</article-title>
|
||||||
|
<source>Journal of Machine Learning Research</source>
|
||||||
|
<year iso-8601-date="2021">2021</year>
|
||||||
|
<volume>22</volume>
|
||||||
|
<issue>268</issue>
|
||||||
|
<uri>http://jmlr.org/papers/v22/20-1364.html</uri>
|
||||||
|
<fpage>1</fpage>
|
||||||
|
<lpage>8</lpage>
|
||||||
|
</element-citation>
|
||||||
|
</ref>
|
||||||
|
<ref id="ref-openai">
|
||||||
|
<element-citation>
|
||||||
|
<person-group person-group-type="author">
|
||||||
|
<name><surname>Brockman</surname><given-names>Greg</given-names></name>
|
||||||
|
<name><surname>Cheung</surname><given-names>Vicki</given-names></name>
|
||||||
|
<name><surname>Pettersson</surname><given-names>Ludwig</given-names></name>
|
||||||
|
<name><surname>Schneider</surname><given-names>Jonas</given-names></name>
|
||||||
|
<name><surname>Schulman</surname><given-names>John</given-names></name>
|
||||||
|
<name><surname>Tang</surname><given-names>Jie</given-names></name>
|
||||||
|
<name><surname>Zaremba</surname><given-names>Wojciech</given-names></name>
|
||||||
|
</person-group>
|
||||||
|
<article-title>OpenAI gym</article-title>
|
||||||
|
<year iso-8601-date="2016">2016</year>
|
||||||
|
<uri>https://arxiv.org/abs/1606.01540</uri>
|
||||||
|
</element-citation>
|
||||||
|
</ref>
|
||||||
|
<ref id="ref-tensorflow">
|
||||||
|
<element-citation>
|
||||||
|
<person-group person-group-type="author">
|
||||||
|
<name><surname>Abadi</surname><given-names>Martín</given-names></name>
|
||||||
|
<name><surname>Agarwal</surname><given-names>Ashish</given-names></name>
|
||||||
|
<name><surname>Barham</surname><given-names>Paul</given-names></name>
|
||||||
|
<name><surname>Brevdo</surname><given-names>Eugene</given-names></name>
|
||||||
|
<name><surname>Chen</surname><given-names>Zhifeng</given-names></name>
|
||||||
|
<name><surname>Citro</surname><given-names>Craig</given-names></name>
|
||||||
|
<name><surname>Corrado</surname><given-names>Greg S.</given-names></name>
|
||||||
|
<name><surname>Davis</surname><given-names>Andy</given-names></name>
|
||||||
|
<name><surname>Dean</surname><given-names>Jeffrey</given-names></name>
|
||||||
|
<name><surname>Devin</surname><given-names>Matthieu</given-names></name>
|
||||||
|
<name><surname>Ghemawat</surname><given-names>Sanjay</given-names></name>
|
||||||
|
<name><surname>Goodfellow</surname><given-names>Ian</given-names></name>
|
||||||
|
<name><surname>Harp</surname><given-names>Andrew</given-names></name>
|
||||||
|
<name><surname>Irving</surname><given-names>Geoffrey</given-names></name>
|
||||||
|
<name><surname>Isard</surname><given-names>Michael</given-names></name>
|
||||||
|
<name><surname>Jia</surname><given-names>Yangqing</given-names></name>
|
||||||
|
<name><surname>Jozefowicz</surname><given-names>Rafal</given-names></name>
|
||||||
|
<name><surname>Kaiser</surname><given-names>Lukasz</given-names></name>
|
||||||
|
<name><surname>Kudlur</surname><given-names>Manjunath</given-names></name>
|
||||||
|
<name><surname>Levenberg</surname><given-names>Josh</given-names></name>
|
||||||
|
<name><surname>Mané</surname><given-names>Dandelion</given-names></name>
|
||||||
|
<name><surname>Monga</surname><given-names>Rajat</given-names></name>
|
||||||
|
<name><surname>Moore</surname><given-names>Sherry</given-names></name>
|
||||||
|
<name><surname>Murray</surname><given-names>Derek</given-names></name>
|
||||||
|
<name><surname>Olah</surname><given-names>Chris</given-names></name>
|
||||||
|
<name><surname>Schuster</surname><given-names>Mike</given-names></name>
|
||||||
|
<name><surname>Shlens</surname><given-names>Jonathon</given-names></name>
|
||||||
|
<name><surname>Steiner</surname><given-names>Benoit</given-names></name>
|
||||||
|
<name><surname>Sutskever</surname><given-names>Ilya</given-names></name>
|
||||||
|
<name><surname>Talwar</surname><given-names>Kunal</given-names></name>
|
||||||
|
<name><surname>Tucker</surname><given-names>Paul</given-names></name>
|
||||||
|
<name><surname>Vanhoucke</surname><given-names>Vincent</given-names></name>
|
||||||
|
<name><surname>Vasudevan</surname><given-names>Vijay</given-names></name>
|
||||||
|
<name><surname>Viégas</surname><given-names>Fernanda</given-names></name>
|
||||||
|
<name><surname>Vinyals</surname><given-names>Oriol</given-names></name>
|
||||||
|
<name><surname>Warden</surname><given-names>Pete</given-names></name>
|
||||||
|
<name><surname>Wattenberg</surname><given-names>Martin</given-names></name>
|
||||||
|
<name><surname>Wicke</surname><given-names>Martin</given-names></name>
|
||||||
|
<name><surname>Yu</surname><given-names>Yuan</given-names></name>
|
||||||
|
<name><surname>Zheng</surname><given-names>Xiaoqiang</given-names></name>
|
||||||
|
</person-group>
|
||||||
|
<article-title>TensorFlow: Large-scale machine learning on heterogeneous systems</article-title>
|
||||||
|
<year iso-8601-date="2015">2015</year>
|
||||||
|
<uri>https://www.tensorflow.org/</uri>
|
||||||
|
</element-citation>
|
||||||
|
</ref>
|
||||||
|
<ref id="ref-pytorch">
|
||||||
|
<element-citation publication-type="chapter">
|
||||||
|
<person-group person-group-type="author">
|
||||||
|
<name><surname>Paszke</surname><given-names>Adam</given-names></name>
|
||||||
|
<name><surname>Gross</surname><given-names>Sam</given-names></name>
|
||||||
|
<name><surname>Massa</surname><given-names>Francisco</given-names></name>
|
||||||
|
<name><surname>Lerer</surname><given-names>Adam</given-names></name>
|
||||||
|
<name><surname>Bradbury</surname><given-names>James</given-names></name>
|
||||||
|
<name><surname>Chanan</surname><given-names>Gregory</given-names></name>
|
||||||
|
<name><surname>Killeen</surname><given-names>Trevor</given-names></name>
|
||||||
|
<name><surname>Lin</surname><given-names>Zeming</given-names></name>
|
||||||
|
<name><surname>Gimelshein</surname><given-names>Natalia</given-names></name>
|
||||||
|
<name><surname>Antiga</surname><given-names>Luca</given-names></name>
|
||||||
|
<name><surname>Desmaison</surname><given-names>Alban</given-names></name>
|
||||||
|
<name><surname>Kopf</surname><given-names>Andreas</given-names></name>
|
||||||
|
<name><surname>Yang</surname><given-names>Edward</given-names></name>
|
||||||
|
<name><surname>DeVito</surname><given-names>Zachary</given-names></name>
|
||||||
|
<name><surname>Raison</surname><given-names>Martin</given-names></name>
|
||||||
|
<name><surname>Tejani</surname><given-names>Alykhan</given-names></name>
|
||||||
|
<name><surname>Chilamkurthy</surname><given-names>Sasank</given-names></name>
|
||||||
|
<name><surname>Steiner</surname><given-names>Benoit</given-names></name>
|
||||||
|
<name><surname>Fang</surname><given-names>Lu</given-names></name>
|
||||||
|
<name><surname>Bai</surname><given-names>Junjie</given-names></name>
|
||||||
|
<name><surname>Chintala</surname><given-names>Soumith</given-names></name>
|
||||||
|
</person-group>
|
||||||
|
<article-title>PyTorch: An imperative style, high-performance deep learning library</article-title>
|
||||||
|
<source>Advances in neural information processing systems 32</source>
|
||||||
|
<person-group person-group-type="editor">
|
||||||
|
<name><surname>Wallach</surname><given-names>H.</given-names></name>
|
||||||
|
<name><surname>Larochelle</surname><given-names>H.</given-names></name>
|
||||||
|
<name><surname>Beygelzimer</surname><given-names>A.</given-names></name>
|
||||||
|
<name><surname>dAlché-Buc</surname><given-names>F.</given-names></name>
|
||||||
|
<name><surname>Fox</surname><given-names>E.</given-names></name>
|
||||||
|
<name><surname>Garnett</surname><given-names>R.</given-names></name>
|
||||||
|
</person-group>
|
||||||
|
<publisher-name>Curran Associates, Inc.</publisher-name>
|
||||||
|
<year iso-8601-date="2019">2019</year>
|
||||||
|
<uri>http://papers.neurips.cc/paper/9015-pytorch-an-imperative-style-high-performance-deep-learning-library.pdf</uri>
|
||||||
|
<fpage>8024</fpage>
|
||||||
|
<lpage>8035</lpage>
|
||||||
|
</element-citation>
|
||||||
|
</ref>
|
||||||
|
<ref id="ref-scipy">
|
||||||
|
<element-citation publication-type="article-journal">
|
||||||
|
<person-group person-group-type="author">
|
||||||
|
<name><surname>Virtanen</surname><given-names>Pauli</given-names></name>
|
||||||
|
<name><surname>Gommers</surname><given-names>Ralf</given-names></name>
|
||||||
|
<name><surname>Oliphant</surname><given-names>Travis E.</given-names></name>
|
||||||
|
<name><surname>Haberland</surname><given-names>Matt</given-names></name>
|
||||||
|
<name><surname>Reddy</surname><given-names>Tyler</given-names></name>
|
||||||
|
<name><surname>Cournapeau</surname><given-names>David</given-names></name>
|
||||||
|
<name><surname>Burovski</surname><given-names>Evgeni</given-names></name>
|
||||||
|
<name><surname>Peterson</surname><given-names>Pearu</given-names></name>
|
||||||
|
<name><surname>Weckesser</surname><given-names>Warren</given-names></name>
|
||||||
|
<name><surname>Bright</surname><given-names>Jonathan</given-names></name>
|
||||||
|
<name><surname>van der Walt</surname><given-names>Stéfan J.</given-names></name>
|
||||||
|
<name><surname>Brett</surname><given-names>Matthew</given-names></name>
|
||||||
|
<name><surname>Wilson</surname><given-names>Joshua</given-names></name>
|
||||||
|
<name><surname>Millman</surname><given-names>K. Jarrod</given-names></name>
|
||||||
|
<name><surname>Mayorov</surname><given-names>Nikolay</given-names></name>
|
||||||
|
<name><surname>Nelson</surname><given-names>Andrew R. J.</given-names></name>
|
||||||
|
<name><surname>Jones</surname><given-names>Eric</given-names></name>
|
||||||
|
<name><surname>Kern</surname><given-names>Robert</given-names></name>
|
||||||
|
<name><surname>Larson</surname><given-names>Eric</given-names></name>
|
||||||
|
<name><surname>Carey</surname><given-names>C J</given-names></name>
|
||||||
|
<name><surname>Polat</surname><given-names>İlhan</given-names></name>
|
||||||
|
<name><surname>Feng</surname><given-names>Yu</given-names></name>
|
||||||
|
<name><surname>Moore</surname><given-names>Eric W.</given-names></name>
|
||||||
|
<name><surname>VanderPlas</surname><given-names>Jake</given-names></name>
|
||||||
|
<name><surname>Laxalde</surname><given-names>Denis</given-names></name>
|
||||||
|
<name><surname>Perktold</surname><given-names>Josef</given-names></name>
|
||||||
|
<name><surname>Cimrman</surname><given-names>Robert</given-names></name>
|
||||||
|
<name><surname>Henriksen</surname><given-names>Ian</given-names></name>
|
||||||
|
<name><surname>Quintero</surname><given-names>E. A.</given-names></name>
|
||||||
|
<name><surname>Harris</surname><given-names>Charles R.</given-names></name>
|
||||||
|
<name><surname>Archibald</surname><given-names>Anne M.</given-names></name>
|
||||||
|
<name><surname>Ribeiro</surname><given-names>Antônio H.</given-names></name>
|
||||||
|
<name><surname>Pedregosa</surname><given-names>Fabian</given-names></name>
|
||||||
|
<name><surname>van Mulbregt</surname><given-names>Paul</given-names></name>
|
||||||
|
<string-name>SciPy 1.0 Contributors</string-name>
|
||||||
|
</person-group>
|
||||||
|
<article-title>SciPy 1.0: Fundamental Algorithms for Scientific Computing in Python</article-title>
|
||||||
|
<source>Nature Methods</source>
|
||||||
|
<year iso-8601-date="2020">2020</year>
|
||||||
|
<volume>17</volume>
|
||||||
|
<pub-id pub-id-type="doi">10.1038/s41592-019-0686-2</pub-id>
|
||||||
|
<fpage>261</fpage>
|
||||||
|
<lpage>272</lpage>
|
||||||
|
</element-citation>
|
||||||
|
</ref>
|
||||||
|
<ref id="ref-numpy">
|
||||||
|
<element-citation publication-type="article-journal">
|
||||||
|
<person-group person-group-type="author">
|
||||||
|
<name><surname>Harris</surname><given-names>Charles R.</given-names></name>
|
||||||
|
<name><surname>Millman</surname><given-names>K. Jarrod</given-names></name>
|
||||||
|
<name><surname>Walt</surname><given-names>Stéfan J. van der</given-names></name>
|
||||||
|
<name><surname>Gommers</surname><given-names>Ralf</given-names></name>
|
||||||
|
<name><surname>Virtanen</surname><given-names>Pauli</given-names></name>
|
||||||
|
<name><surname>Cournapeau</surname><given-names>David</given-names></name>
|
||||||
|
<name><surname>Wieser</surname><given-names>Eric</given-names></name>
|
||||||
|
<name><surname>Taylor</surname><given-names>Julian</given-names></name>
|
||||||
|
<name><surname>Berg</surname><given-names>Sebastian</given-names></name>
|
||||||
|
<name><surname>Smith</surname><given-names>Nathaniel J.</given-names></name>
|
||||||
|
<name><surname>Kern</surname><given-names>Robert</given-names></name>
|
||||||
|
<name><surname>Picus</surname><given-names>Matti</given-names></name>
|
||||||
|
<name><surname>Hoyer</surname><given-names>Stephan</given-names></name>
|
||||||
|
<name><surname>Kerkwijk</surname><given-names>Marten H. van</given-names></name>
|
||||||
|
<name><surname>Brett</surname><given-names>Matthew</given-names></name>
|
||||||
|
<name><surname>Haldane</surname><given-names>Allan</given-names></name>
|
||||||
|
<name><surname>Río</surname><given-names>Jaime Fernández del</given-names></name>
|
||||||
|
<name><surname>Wiebe</surname><given-names>Mark</given-names></name>
|
||||||
|
<name><surname>Peterson</surname><given-names>Pearu</given-names></name>
|
||||||
|
<name><surname>Gérard-Marchant</surname><given-names>Pierre</given-names></name>
|
||||||
|
<name><surname>Sheppard</surname><given-names>Kevin</given-names></name>
|
||||||
|
<name><surname>Reddy</surname><given-names>Tyler</given-names></name>
|
||||||
|
<name><surname>Weckesser</surname><given-names>Warren</given-names></name>
|
||||||
|
<name><surname>Abbasi</surname><given-names>Hameer</given-names></name>
|
||||||
|
<name><surname>Gohlke</surname><given-names>Christoph</given-names></name>
|
||||||
|
<name><surname>Oliphant</surname><given-names>Travis E.</given-names></name>
|
||||||
|
</person-group>
|
||||||
|
<article-title>Array programming with NumPy</article-title>
|
||||||
|
<source>Nature</source>
|
||||||
|
<publisher-name>Springer Science; Business Media LLC</publisher-name>
|
||||||
|
<year iso-8601-date="2020-09">2020</year><month>09</month>
|
||||||
|
<volume>585</volume>
|
||||||
|
<issue>7825</issue>
|
||||||
|
<uri>https://doi.org/10.1038/s41586-020-2649-2</uri>
|
||||||
|
<pub-id pub-id-type="doi">10.1038/s41586-020-2649-2</pub-id>
|
||||||
|
<fpage>357</fpage>
|
||||||
|
<lpage>362</lpage>
|
||||||
|
</element-citation>
|
||||||
|
</ref>
|
||||||
|
<ref id="ref-pandas">
|
||||||
|
<element-citation publication-type="paper-conference">
|
||||||
|
<person-group person-group-type="author">
|
||||||
|
<name><surname>McKinney</surname><given-names>Wes</given-names></name>
|
||||||
|
<name><surname>others</surname></name>
|
||||||
|
</person-group>
|
||||||
|
<article-title>Data structures for statistical computing in python</article-title>
|
||||||
|
<source>Proceedings of the 9th python in science conference</source>
|
||||||
|
<publisher-name>Austin, TX</publisher-name>
|
||||||
|
<year iso-8601-date="2010">2010</year>
|
||||||
|
<volume>445</volume>
|
||||||
|
<fpage>51</fpage>
|
||||||
|
<lpage>56</lpage>
|
||||||
|
</element-citation>
|
||||||
|
</ref>
|
||||||
|
<ref id="ref-finrl">
|
||||||
|
<element-citation publication-type="webpage">
|
||||||
|
<article-title>AI4Finance-foundation</article-title>
|
||||||
|
<year iso-8601-date="2022">2022</year>
|
||||||
|
<date-in-citation content-type="access-date"><year iso-8601-date="2022-09-30">2022</year><month>09</month><day>30</day></date-in-citation>
|
||||||
|
<uri>https://github.com/AI4Finance-Foundation/FinRL</uri>
|
||||||
|
</element-citation>
|
||||||
|
</ref>
|
||||||
|
<ref id="ref-tensortrade">
|
||||||
|
<element-citation publication-type="webpage">
|
||||||
|
<article-title>Tensortrade</article-title>
|
||||||
|
<year iso-8601-date="2022">2022</year>
|
||||||
|
<date-in-citation content-type="access-date"><year iso-8601-date="2022-09-30">2022</year><month>09</month><day>30</day></date-in-citation>
|
||||||
|
<uri>https://tensortradex.readthedocs.io/en/latest/L</uri>
|
||||||
|
</element-citation>
|
||||||
|
</ref>
|
||||||
|
</ref-list>
|
||||||
|
</back>
|
||||||
|
</article>
|
||||||
212
docs/JOSS_paper/paper.md
Normal file
@@ -0,0 +1,212 @@
|
|||||||
|
---
|
||||||
|
title: '`FreqAI`: generalizing adaptive modeling for chaotic time-series market forecasts'
|
||||||
|
tags:
|
||||||
|
- Python
|
||||||
|
- Machine Learning
|
||||||
|
- adaptive modeling
|
||||||
|
- chaotic systems
|
||||||
|
- time-series forecasting
|
||||||
|
authors:
|
||||||
|
- name: Robert A. Caulk Ph.D
|
||||||
|
orcid: 0000-0001-5618-8629
|
||||||
|
affiliation: 1, 2
|
||||||
|
- name: Elin Törnquist Ph.D
|
||||||
|
orcid: 0000-0003-3289-8604
|
||||||
|
affiliation: 1, 2
|
||||||
|
- name: Matthias Voppichler
|
||||||
|
orcid:
|
||||||
|
affiliation: 2
|
||||||
|
- name: Andrew R. Lawless
|
||||||
|
orcid:
|
||||||
|
affiliation: 2
|
||||||
|
- name: Ryan McMullan
|
||||||
|
orcid:
|
||||||
|
affiliation: 2
|
||||||
|
- name: Wagner Costa Santos
|
||||||
|
orcid:
|
||||||
|
affiliation: 1, 2
|
||||||
|
- name: Timothy C. Pogue
|
||||||
|
orcid:
|
||||||
|
affiliation: 1, 2
|
||||||
|
- name: Johan van der Vlugt
|
||||||
|
orcid:
|
||||||
|
affiliation: 2
|
||||||
|
- name: Stefan P. Gehring
|
||||||
|
orcid:
|
||||||
|
affiliation: 2
|
||||||
|
- name: Pascal Schmidt
|
||||||
|
orcid: 0000-0001-9328-4345
|
||||||
|
affiliation: 2
|
||||||
|
|
||||||
|
<!-- affiliation: "1, 2" # (Multiple affiliations must be quoted) -->
|
||||||
|
affiliations:
|
||||||
|
- name: Emergent Methods LLC, Arvada Colorado, 80005, USA
|
||||||
|
index: 1
|
||||||
|
- name: Freqtrade open source project
|
||||||
|
index: 2
|
||||||
|
date: October 2022
|
||||||
|
bibliography: paper.bib
|
||||||
|
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
|
||||||
|
# Statement of need
|
||||||
|
|
||||||
|
Forecasting chaotic time-series based systems, such as equity/cryptocurrency markets, requires a broad set of tools geared toward testing a wide range of hypotheses. Fortunately, a recent maturation of robust machine learning libraries (e.g. `scikit-learn`), has opened up a wide range of research possibilities. Scientists from a diverse range of fields can now easily prototype their studies on an abundance of established machine learning algorithms. Similarly, these user-friendly libraries enable "citizen scientists" to use their basic Python skills for data-exploration. However, leveraging these machine learning libraries on historical and live chaotic data sources can be logistically difficult and expensive. Additionally, robust data-collection, storage, and handling presents a disparate challenge. [`FreqAI`](https://www.freqtrade.io/en/latest/freqai/) aims to provide a generalized and extensible open-sourced framework geared toward live deployments of adaptive modeling for market forecasting. The `FreqAI` framework is effectively a sandbox for the rich world of open-source machine learning libraries. Inside the `FreqAI` sandbox, users find they can combine a wide variety of third-party libraries to test creative hypotheses on a free live 24/7 chaotic data source - cryptocurrency exchange data.
|
||||||
|
|
||||||
|
|
||||||
|
# Summary
|
||||||
|
|
||||||
|
[`FreqAI`](https://www.freqtrade.io/en/latest/freqai/) evolved from a desire to test and compare a range of adaptive time-series forecasting methods on chaotic data. Cryptocurrency markets provide a unique data source since they are operational 24/7 and the data is freely available via a variety of open-sourced [exchange APIs](https://docs.ccxt.com/en/latest/manual.html#exchange-structure). Luckily, an existing open-source software, [`Freqtrade`](https://www.freqtrade.io/en/stable/), had already matured under a range of talented developers to support robust data collection/storage, as well as robust live environmental interactions for standard algorithmic trading. `Freqtrade` also provides a set of data analysis/visualization tools for the evaluation of historical performance as well as live environmental feedback. `FreqAI` builds on top of `Freqtrade` to include a user-friendly well tested interface for integrating external machine learning libraries for adaptive time-series forecasting. Beyond enabling the integration of existing libraries, `FreqAI` hosts a range of custom algorithms and methodologies aimed at improving computational and predictive performances. Thus, `FreqAI` contains a range of unique features which can be easily tested in combination with all the existing Python-accessible machine learning libraries to generate novel research on live and historical data.
|
||||||
|
|
||||||
|
The high-level overview of the software is depicted in Figure 1.
|
||||||
|
|
||||||
|

|
||||||
|
*Abstracted overview of FreqAI algorithm*
|
||||||
|
|
||||||
|
## Connecting machine learning libraries
|
||||||
|
|
||||||
|
Although the `FreqAI` framework is designed to accommodate any Python library in the "Model training" and "Feature set engineering" portions of the software (Figure 1), it already boasts a wide range of well documented examples based on various combinations of:
|
||||||
|
|
||||||
|
* scikit-learn [@scikit-learn], Catboost [@catboost], LightGBM [@lightgbm], XGBoost [@xgboost], stable_baselines3 [@stable-baselines3], openai gym [@openai], tensorflow [@tensorflow], pytorch [@pytorch], Scipy [@scipy], Numpy [@numpy], and pandas [@pandas].
|
||||||
|
|
||||||
|
These mature projects contain a wide range of peer-reviewed and industry standard methods, including:
|
||||||
|
|
||||||
|
* Regression, Classification, Neural Networks, Reinforcement Learning, Support Vector Machines, Principal Component Analysis, point clustering, and much more.
|
||||||
|
|
||||||
|
which are all leveraged in `FreqAI` for users to use as templates or extend with their own methods.
|
||||||
|
|
||||||
|
## Furnishing novel methods and features
|
||||||
|
|
||||||
|
Beyond the industry standard methods available through external libraries - `FreqAI` includes novel methods which are not available anywhere else in the open-source (or scientific) world. For example, `FreqAI` provides :
|
||||||
|
|
||||||
|
* a custom algorithm/methodology for adaptive modeling details [here](https://www.freqtrade.io/en/stable/freqai/#general-approach) and [here](https://www.freqtrade.io/en/stable/freqai-developers/#project-architecture)
|
||||||
|
* rapid and self-monitored feature engineering tools, details [here](https://www.freqtrade.io/en/stable/freqai-feature-engineering/#feature-engineering)
|
||||||
|
* unique model features/indicators, such as the [inlier metric](https://www.freqtrade.io/en/stable/freqai-feature-engineering/#inlier-metric)
|
||||||
|
* optimized data collection/storage algorithms, all code shown [here](https://github.com/freqtrade/freqtrade/blob/develop/freqtrade/freqai/data_drawer.py)
|
||||||
|
* safely integrated outlier detection methods, details [here](https://www.freqtrade.io/en/stable/freqai-feature-engineering/#outlier-detection)
|
||||||
|
* websocket communicated forecasts, details [here](https://www.freqtrade.io/en/stable/producer-consumer/)
|
||||||
|
|
||||||
|
Of particular interest for researchers, `FreqAI` provides the option of large scale experimentation via an optimized [websocket communications interface](https://www.freqtrade.io/en/stable/producer-consumer/).
|
||||||
|
|
||||||
|
## Optimizing the back-end
|
||||||
|
|
||||||
|
`FreqAI` aims to make it simple for users to combine all the above tools to run studies based in two distinct modules:
|
||||||
|
|
||||||
|
* backtesting studies
|
||||||
|
* live-deployments
|
||||||
|
|
||||||
|
Both of these modules and their respective data management systems are built on top of [`Freqtrade`](https://www.freqtrade.io/en/latest/), a mature and actively developed cryptocurrency trading software. This means that `FreqAI` benefits from a wide range of tangential/disparate feature developments such as:
|
||||||
|
|
||||||
|
* FreqUI, a graphical interface for backtesting and live monitoring
|
||||||
|
* telegram control
|
||||||
|
* robust database handling
|
||||||
|
* futures/leverage trading
|
||||||
|
* dollar cost averaging
|
||||||
|
* trading strategy handling
|
||||||
|
* a variety of free data sources via [CCXT](https://docs.ccxt.com/en/latest/manual.html#exchange-structure) (FTX, Binance, Kucoin etc.)
|
||||||
|
|
||||||
|
These features derive from a strong external developer community that shares in the benefit and stability of a communal CI (Continuous Integration) system. Beyond the developer community, `FreqAI` benefits strongly from the userbase of `Freqtrade`, where most `FreqAI` beta-testers/developers originated. This symbiotic relationship between `Freqtrade` and `FreqAI` ignited a thoroughly tested [`beta`](https://github.com/freqtrade/freqtrade/pull/6832), which demanded a four month beta and [comprehensive documentation](https://www.freqtrade.io/en/latest/freqai/) containing:
|
||||||
|
|
||||||
|
* numerous example scripts
|
||||||
|
* a full parameter table
|
||||||
|
* methodological descriptions
|
||||||
|
* high-resolution diagrams/figures
|
||||||
|
* detailed parameter setting recommendations
|
||||||
|
|
||||||
|
## Providing a reproducible foundation for researchers
|
||||||
|
|
||||||
|
`FreqAI` provides an extensible, robust, framework for researchers and citizen data scientists. The `FreqAI` sandbox enables rapid conception and testing of exotic hypotheses. From a research perspective, `FreqAI` handles the multitude of logistics associated with live deployments, historical backtesting, and feature engineering. With `FreqAI`, researchers can focus on their primary interests of feature engineering and hypothesis testing rather than figuring out how to collect and handle data. Further - the well maintained and easily installed open-source framework of `FreqAI` enables reproducible scientific studies. This reproducibility component is essential to general scientific advancement in time-series forecasting for chaotic systems.
|
||||||
|
|
||||||
|
# Technical details
|
||||||
|
|
||||||
|
Typical users configure `FreqAI` via two files:
|
||||||
|
|
||||||
|
1. A `configuration` file (`--config`) which provides access to the full parameter list available [here](https://www.freqtrade.io/en/latest/freqai/):
|
||||||
|
* control high-level feature engineering
|
||||||
|
* customize adaptive modeling techniques
|
||||||
|
* set any model training parameters available in third-party libraries
|
||||||
|
* manage adaptive modeling parameters (retrain frequency, training window size, continual learning, etc.)
|
||||||
|
|
||||||
|
2. A strategy file (`--strategy`) where users:
|
||||||
|
* list of the base training features
|
||||||
|
* set standard technical-analysis strategies
|
||||||
|
* control trade entry/exit criteria
|
||||||
|
|
||||||
|
With these two files, most users can exploit a wide range of pre-existing integrations in `Catboost` and 7 other libraries with a simple command:
|
||||||
|
|
||||||
|
```
|
||||||
|
freqtrade trade --config config_freqai.example.json --strategy FreqaiExampleStrategy --freqaimodel CatboostRegressor
|
||||||
|
```
|
||||||
|
|
||||||
|
Advanced users will edit one of the existing `--freqaimodel` files, which are simply an children of the `IFreqaiModel` (details below). Within these files, advanced users can customize training procedures, prediction procedures, outlier detection methods, data preparation, data saving methods, etc. This is all configured in a way where they can customize as little or as much as they want. This flexible customization is owed to the foundational architecture in `FreqAI`, which is comprised of three distinct Python objects:
|
||||||
|
|
||||||
|
* `IFreqaiModel`
|
||||||
|
* A singular long-lived object containing all the necessary logic to collect data, store data, process data, engineer features, run training, and inference models.
|
||||||
|
* `FreqaiDataKitchen`
|
||||||
|
* A short-lived object which is uniquely created for each asset/model. Beyond metadata, it also contains a variety of data processing tools.
|
||||||
|
* `FreqaiDataDrawer`
|
||||||
|
* Singular long-lived object containing all the historical predictions, models, and save/load methods.
|
||||||
|
|
||||||
|
These objects interact with one another with one goal in mind - to provide a clean data set to machine learning experts/enthusiasts at the user endpoint. These power-users interact with an inherited `IFreqaiModel` that allows them to dig as deep or as shallow as they wish into the inheritence tree. Typical power-users focus their efforts on customizing training procedures and testing exotic functionalities available in third-party libraries. Thus, power-users are freed from the algorithmic weight associated with data management, and can instead focus their energy on testing creative hypotheses. Meanwhile, some users choose to override deeper functionalities within `IFreqaiModel` to help them craft unique data structures and training procedures.
|
||||||
|
|
||||||
|
The class structure and algorithmic details are depicted in the following diagram:
|
||||||
|
|
||||||
|

|
||||||
|
*Class diagram summarizing object interactions in FreqAI*
|
||||||
|
|
||||||
|
# Online documentation
|
||||||
|
|
||||||
|
The documentation for [`FreqAI`](https://www.freqtrade.io/en/latest/freqai/) is available online at [https://www.freqtrade.io/en/latest/freqai/](https://www.freqtrade.io/en/latest/freqai/) and covers a wide range of materials:
|
||||||
|
|
||||||
|
* Quick-start with a single command and example files - (beginners)
|
||||||
|
* Introduction to the feature engineering interface and basic configurations - (intermediate users)
|
||||||
|
* Parameter table with indepth descriptions and default parameter setting recommendations - (intermediate users)
|
||||||
|
* Data analysis and post-processing - (advanced users)
|
||||||
|
* Methodological considerations complemented by high resolution figures - (advanced users)
|
||||||
|
* Instructions for integrating third party machine learning libraries into custom prediction models - (advanced users)
|
||||||
|
* Software architectural description with class diagram - (developers)
|
||||||
|
* File structure descriptions - (developers)
|
||||||
|
|
||||||
|
The docs direct users to a variety of pre-made examples which integrate `Catboost`, `LightGBM`, `XGBoost`, `Sklearn`, `stable_baselines3`, `torch`, `tensorflow`. Meanwhile, developers will also find thorough docstrings and type hinting throughout the source code to aid in code readability and customization.
|
||||||
|
|
||||||
|
`FreqAI` also benefits from a strong support network of users and developers on the [`Freqtrade` discord](https://discord.gg/w6nDM6cM4y) as well as on the [`FreqAI` discord](https://discord.gg/xE4RMg4QYw). Within the `FreqAI` discord, users will find a deep and easily searched knowledge base containing common errors. But more importantly, users in the `FreqAI` discord share anectdotal and quantitative observations which compare performance between various third-party libraries and methods.
|
||||||
|
|
||||||
|
# State of the field
|
||||||
|
|
||||||
|
There are two other open-source tools which are geared toward helping users build models for time-series forecasts on market based data. However, each of these tools suffer from a non-generalized frameworks that do not permit comparison of methods and libraries. Additionally, they do not permit easy live-deployments or adaptive-modeling methods. For example, two open-sourced projects called [`tensortrade`](https://tensortradex.readthedocs.io/en/latest/) [@tensortrade] and [`FinRL`](https://github.com/AI4Finance-Foundation/FinRL) [@finrl] limit users to the exploration of reinforcement learning on historical data. These softwares also do not provide robust live deployments, they do not furnish novel feature engineering algorithms, and they do not provide custom data analysis tools. `FreqAI` fills the gap.
|
||||||
|
|
||||||
|
# On-going research
|
||||||
|
|
||||||
|
Emergent Methods, based in Arvada CO, is actively using `FreqAI` to perform large scale experiments aimed at comparing machine learning libraries in live and historical environments. Past projects include backtesting parametric sweeps, while active projects include a 3 week live deployment comparison between `CatboostRegressor`, `LightGBMRegressor`, and `XGBoostRegressor`. Results from these studies are planned for submission to scientific journals as well as more general data science blogs (e.g. Medium).
|
||||||
|
|
||||||
|
# Installing and running `FreqAI`
|
||||||
|
|
||||||
|
`FreqAI` is automatically installed with `Freqtrade` using the following commands on linux systems:
|
||||||
|
|
||||||
|
```
|
||||||
|
git clone git@github.com:freqtrade/freqtrade.git
|
||||||
|
cd freqtrade
|
||||||
|
./setup.sh -i
|
||||||
|
```
|
||||||
|
|
||||||
|
However, `FreqAI` also benefits from `Freqtrade` docker distributions, and can be run with docker by pulling the stable or develop images from `Freqtrade` distributions.
|
||||||
|
|
||||||
|
# Funding sources
|
||||||
|
|
||||||
|
[`FreqAI`](https://www.freqtrade.io/en/latest/freqai/) has had no official sponsors, and is entirely grass roots. All donations into the project (e.g. the GitHub sponsor system) are kept inside the project to help support development of open-sourced and communally beneficial features.
|
||||||
|
|
||||||
|
# Acknowledgements
|
||||||
|
|
||||||
|
We would like to acknowledge various beta testers of `FreqAI`:
|
||||||
|
|
||||||
|
- Longlong Yu (lolongcovas)
|
||||||
|
- Richárd Józsa (richardjozsa)
|
||||||
|
- Juha Nykänen (suikula)
|
||||||
|
- Emre Suzen (aemr3)
|
||||||
|
- Salah Lamkadem (ikonx)
|
||||||
|
|
||||||
|
As well as various `Freqtrade` [developers](https://github.com/freqtrade/freqtrade/graphs/contributors) maintaining tangential, yet essential, modules.
|
||||||
|
|
||||||
|
# References
|
||||||
BIN
docs/JOSS_paper/paper.pdf
Normal file
@@ -18,31 +18,31 @@ freqtrade backtesting -c <config.json> --timeframe <tf> --strategy <strategy_nam
|
|||||||
```
|
```
|
||||||
|
|
||||||
This will tell freqtrade to output a pickled dictionary of strategy, pairs and corresponding
|
This will tell freqtrade to output a pickled dictionary of strategy, pairs and corresponding
|
||||||
DataFrame of the candles that resulted in entry and exit signals.
|
DataFrame of the candles that resulted in buy signals. Depending on how many buys your strategy
|
||||||
Depending on how many entries your strategy makes, this file may get quite large, so periodically check your `user_data/backtest_results` folder to delete old exports.
|
makes, this file may get quite large, so periodically check your `user_data/backtest_results`
|
||||||
|
folder to delete old exports.
|
||||||
|
|
||||||
Before running your next backtest, make sure you either delete your old backtest results or run
|
Before running your next backtest, make sure you either delete your old backtest results or run
|
||||||
backtesting with the `--cache none` option to make sure no cached results are used.
|
backtesting with the `--cache none` option to make sure no cached results are used.
|
||||||
|
|
||||||
If all goes well, you should now see a `backtest-result-{timestamp}_signals.pkl` and `backtest-result-{timestamp}_exited.pkl` files in the `user_data/backtest_results` folder.
|
If all goes well, you should now see a `backtest-result-{timestamp}_signals.pkl` file in the
|
||||||
|
`user_data/backtest_results` folder.
|
||||||
|
|
||||||
To analyze the entry/exit tags, we now need to use the `freqtrade backtesting-analysis` command
|
To analyze the entry/exit tags, we now need to use the `freqtrade backtesting-analysis` command
|
||||||
with `--analysis-groups` option provided with space-separated arguments:
|
with `--analysis-groups` option provided with space-separated arguments (default `0 1 2`):
|
||||||
|
|
||||||
``` bash
|
``` bash
|
||||||
freqtrade backtesting-analysis -c <config.json> --analysis-groups 0 1 2 3 4 5
|
freqtrade backtesting-analysis -c <config.json> --analysis-groups 0 1 2 3 4
|
||||||
```
|
```
|
||||||
|
|
||||||
This command will read from the last backtesting results. The `--analysis-groups` option is
|
This command will read from the last backtesting results. The `--analysis-groups` option is
|
||||||
used to specify the various tabular outputs showing the profit of each group or trade,
|
used to specify the various tabular outputs showing the profit fo each group or trade,
|
||||||
ranging from the simplest (0) to the most detailed per pair, per buy and per sell tag (4):
|
ranging from the simplest (0) to the most detailed per pair, per buy and per sell tag (4):
|
||||||
|
|
||||||
* 0: overall winrate and profit summary by enter_tag
|
|
||||||
* 1: profit summaries grouped by enter_tag
|
* 1: profit summaries grouped by enter_tag
|
||||||
* 2: profit summaries grouped by enter_tag and exit_tag
|
* 2: profit summaries grouped by enter_tag and exit_tag
|
||||||
* 3: profit summaries grouped by pair and enter_tag
|
* 3: profit summaries grouped by pair and enter_tag
|
||||||
* 4: profit summaries grouped by pair, enter_ and exit_tag (this can get quite large)
|
* 4: profit summaries grouped by pair, enter_ and exit_tag (this can get quite large)
|
||||||
* 5: profit summaries grouped by exit_tag
|
|
||||||
|
|
||||||
More options are available by running with the `-h` option.
|
More options are available by running with the `-h` option.
|
||||||
|
|
||||||
@@ -100,119 +100,3 @@ freqtrade backtesting-analysis -c <config.json> --analysis-groups 0 2 --enter-re
|
|||||||
The indicators have to be present in your strategy's main DataFrame (either for your main
|
The indicators have to be present in your strategy's main DataFrame (either for your main
|
||||||
timeframe or for informative timeframes) otherwise they will simply be ignored in the script
|
timeframe or for informative timeframes) otherwise they will simply be ignored in the script
|
||||||
output.
|
output.
|
||||||
|
|
||||||
!!! Note "Indicator List"
|
|
||||||
The indicator values will be displayed for both entry and exit points. If `--indicator-list all` is specified,
|
|
||||||
only the indicators at the entry point will be shown to avoid excessively large lists, which could occur depending on the strategy.
|
|
||||||
|
|
||||||
There are a range of candle and trade-related fields that are included in the analysis so are
|
|
||||||
automatically accessible by including them on the indicator-list, and these include:
|
|
||||||
|
|
||||||
- **open_date :** trade open datetime
|
|
||||||
- **close_date :** trade close datetime
|
|
||||||
- **min_rate :** minimum price seen throughout the position
|
|
||||||
- **max_rate :** maximum price seen throughout the position
|
|
||||||
- **open :** signal candle open price
|
|
||||||
- **close :** signal candle close price
|
|
||||||
- **high :** signal candle high price
|
|
||||||
- **low :** signal candle low price
|
|
||||||
- **volume :** signal candle volume
|
|
||||||
- **profit_ratio :** trade profit ratio
|
|
||||||
- **profit_abs :** absolute profit return of the trade
|
|
||||||
|
|
||||||
#### Sample Output for Indicator Values
|
|
||||||
|
|
||||||
```bash
|
|
||||||
freqtrade backtesting-analysis -c user_data/config.json --analysis-groups 0 --indicator-list chikou_span tenkan_sen
|
|
||||||
```
|
|
||||||
|
|
||||||
In this example,
|
|
||||||
we aim to display the `chikou_span` and `tenkan_sen` indicator values at both the entry and exit points of trades.
|
|
||||||
|
|
||||||
A sample output for indicators might look like this:
|
|
||||||
|
|
||||||
| pair | open_date | enter_reason | exit_reason | chikou_span (entry) | tenkan_sen (entry) | chikou_span (exit) | tenkan_sen (exit) |
|
|
||||||
|-----------|---------------------------|--------------|-------------|---------------------|--------------------|--------------------|-------------------|
|
|
||||||
| DOGE/USDT | 2024-07-06 00:35:00+00:00 | | exit_signal | 0.105 | 0.106 | 0.105 | 0.107 |
|
|
||||||
| BTC/USDT | 2024-08-05 14:20:00+00:00 | | roi | 54643.440 | 51696.400 | 54386.000 | 52072.010 |
|
|
||||||
|
|
||||||
As shown in the table, `chikou_span (entry)` represents the indicator value at the time of trade entry,
|
|
||||||
while `chikou_span (exit)` reflects its value at the time of exit.
|
|
||||||
This detailed view of indicator values enhances the analysis.
|
|
||||||
|
|
||||||
The `(entry)` and `(exit)` suffixes are added to indicators
|
|
||||||
to distinguish the values at the entry and exit points of the trade.
|
|
||||||
|
|
||||||
!!! Note "Trade-wide Indicators"
|
|
||||||
Certain trade-wide indicators do not have the `(entry)` or `(exit)` suffix. These indicators include: `pair`, `stake_amount`,
|
|
||||||
`max_stake_amount`, `amount`, `open_date`, `close_date`, `open_rate`, `close_rate`, `fee_open`, `fee_close`, `trade_duration`,
|
|
||||||
`profit_ratio`, `profit_abs`, `exit_reason`,`initial_stop_loss_abs`, `initial_stop_loss_ratio`, `stop_loss_abs`, `stop_loss_ratio`,
|
|
||||||
`min_rate`, `max_rate`, `is_open`, `enter_tag`, `leverage`, `is_short`, `open_timestamp`, `close_timestamp` and `orders`
|
|
||||||
|
|
||||||
#### Filtering Indicators Based on Entry or Exit Signals
|
|
||||||
|
|
||||||
The `--indicator-list` option, by default, displays indicator values for both entry and exit signals. To filter the indicator values exclusively for entry signals, you can use the `--entry-only` argument. Similarly, to display indicator values only at exit signals, use the `--exit-only` argument.
|
|
||||||
|
|
||||||
Example: Display indicator values at entry signals:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
freqtrade backtesting-analysis -c user_data/config.json --analysis-groups 0 --indicator-list chikou_span tenkan_sen --entry-only
|
|
||||||
```
|
|
||||||
|
|
||||||
Example: Display indicator values at exit signals:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
freqtrade backtesting-analysis -c user_data/config.json --analysis-groups 0 --indicator-list chikou_span tenkan_sen --exit-only
|
|
||||||
```
|
|
||||||
|
|
||||||
!!! note
|
|
||||||
When using these filters, the indicator names will not be suffixed with `(entry)` or `(exit)`.
|
|
||||||
|
|
||||||
### Filtering the trade output by date
|
|
||||||
|
|
||||||
To show only trades between dates within your backtested timerange, supply the usual `timerange` option in `YYYYMMDD-[YYYYMMDD]` format:
|
|
||||||
|
|
||||||
```
|
|
||||||
--timerange : Timerange to filter output trades, start date inclusive, end date exclusive. e.g. 20220101-20221231
|
|
||||||
```
|
|
||||||
|
|
||||||
For example, if your backtest timerange was `20220101-20221231` but you only want to output trades in January:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
freqtrade backtesting-analysis -c <config.json> --timerange 20220101-20220201
|
|
||||||
```
|
|
||||||
|
|
||||||
### Printing out rejected signals
|
|
||||||
|
|
||||||
Use the `--rejected-signals` option to print out rejected signals.
|
|
||||||
|
|
||||||
```bash
|
|
||||||
freqtrade backtesting-analysis -c <config.json> --rejected-signals
|
|
||||||
```
|
|
||||||
|
|
||||||
### Writing tables to CSV
|
|
||||||
|
|
||||||
Some of the tabular outputs can become large, so printing them out to the terminal is not preferable.
|
|
||||||
Use the `--analysis-to-csv` option to disable printing out of tables to standard out and write them to CSV files.
|
|
||||||
|
|
||||||
```bash
|
|
||||||
freqtrade backtesting-analysis -c <config.json> --analysis-to-csv
|
|
||||||
```
|
|
||||||
|
|
||||||
By default this will write one file per output table you specified in the `backtesting-analysis` command, e.g.
|
|
||||||
|
|
||||||
```bash
|
|
||||||
freqtrade backtesting-analysis -c <config.json> --analysis-to-csv --rejected-signals --analysis-groups 0 1
|
|
||||||
```
|
|
||||||
|
|
||||||
This will write to `user_data/backtest_results`:
|
|
||||||
|
|
||||||
* rejected_signals.csv
|
|
||||||
* group_0.csv
|
|
||||||
* group_1.csv
|
|
||||||
|
|
||||||
To override where the files will be written, also specify the `--analysis-csv-path` option.
|
|
||||||
|
|
||||||
```bash
|
|
||||||
freqtrade backtesting-analysis -c <config.json> --analysis-to-csv --analysis-csv-path another/data/path/
|
|
||||||
```
|
|
||||||
|
|||||||
@@ -30,18 +30,11 @@ class SuperDuperHyperOptLoss(IHyperOptLoss):
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def hyperopt_loss_function(
|
def hyperopt_loss_function(results: DataFrame, trade_count: int,
|
||||||
*,
|
min_date: datetime, max_date: datetime,
|
||||||
results: DataFrame,
|
config: Config, processed: Dict[str, DataFrame],
|
||||||
trade_count: int,
|
backtest_stats: Dict[str, Any],
|
||||||
min_date: datetime,
|
*args, **kwargs) -> float:
|
||||||
max_date: datetime,
|
|
||||||
config: Config,
|
|
||||||
processed: dict[str, DataFrame],
|
|
||||||
backtest_stats: dict[str, Any],
|
|
||||||
starting_balance: float,
|
|
||||||
**kwargs,
|
|
||||||
) -> float:
|
|
||||||
"""
|
"""
|
||||||
Objective function, returns smaller number for better results
|
Objective function, returns smaller number for better results
|
||||||
This is the legacy algorithm (used until now in freqtrade).
|
This is the legacy algorithm (used until now in freqtrade).
|
||||||
@@ -71,7 +64,6 @@ Currently, the arguments are:
|
|||||||
* `config`: Config object used (Note: Not all strategy-related parameters will be updated here if they are part of a hyperopt space).
|
* `config`: Config object used (Note: Not all strategy-related parameters will be updated here if they are part of a hyperopt space).
|
||||||
* `processed`: Dict of Dataframes with the pair as keys containing the data used for backtesting.
|
* `processed`: Dict of Dataframes with the pair as keys containing the data used for backtesting.
|
||||||
* `backtest_stats`: Backtesting statistics using the same format as the backtesting file "strategy" substructure. Available fields can be seen in `generate_strategy_stats()` in `optimize_reports.py`.
|
* `backtest_stats`: Backtesting statistics using the same format as the backtesting file "strategy" substructure. Available fields can be seen in `generate_strategy_stats()` in `optimize_reports.py`.
|
||||||
* `starting_balance`: Starting balance used for backtesting.
|
|
||||||
|
|
||||||
This function needs to return a floating point number (`float`). Smaller numbers will be interpreted as better results. The parameters and balancing for this is up to you.
|
This function needs to return a floating point number (`float`). Smaller numbers will be interpreted as better results. The parameters and balancing for this is up to you.
|
||||||
|
|
||||||
@@ -83,11 +75,9 @@ This function needs to return a floating point number (`float`). Smaller numbers
|
|||||||
|
|
||||||
## Overriding pre-defined spaces
|
## Overriding pre-defined spaces
|
||||||
|
|
||||||
To override a pre-defined space (`roi_space`, `generate_roi_table`, `stoploss_space`, `trailing_space`, `max_open_trades_space`), define a nested class called Hyperopt and define the required spaces as follows:
|
To override a pre-defined space (`roi_space`, `generate_roi_table`, `stoploss_space`, `trailing_space`), define a nested class called Hyperopt and define the required spaces as follows:
|
||||||
|
|
||||||
```python
|
```python
|
||||||
from freqtrade.optimize.space import Categorical, Dimension, Integer, SKDecimal
|
|
||||||
|
|
||||||
class MyAwesomeStrategy(IStrategy):
|
class MyAwesomeStrategy(IStrategy):
|
||||||
class HyperOpt:
|
class HyperOpt:
|
||||||
# Define a custom stoploss space.
|
# Define a custom stoploss space.
|
||||||
@@ -104,39 +94,6 @@ class MyAwesomeStrategy(IStrategy):
|
|||||||
SKDecimal(0.01, 0.07, decimals=3, name='roi_p2'),
|
SKDecimal(0.01, 0.07, decimals=3, name='roi_p2'),
|
||||||
SKDecimal(0.01, 0.20, decimals=3, name='roi_p3'),
|
SKDecimal(0.01, 0.20, decimals=3, name='roi_p3'),
|
||||||
]
|
]
|
||||||
|
|
||||||
def generate_roi_table(params: Dict) -> dict[int, float]:
|
|
||||||
|
|
||||||
roi_table = {}
|
|
||||||
roi_table[0] = params['roi_p1'] + params['roi_p2'] + params['roi_p3']
|
|
||||||
roi_table[params['roi_t3']] = params['roi_p1'] + params['roi_p2']
|
|
||||||
roi_table[params['roi_t3'] + params['roi_t2']] = params['roi_p1']
|
|
||||||
roi_table[params['roi_t3'] + params['roi_t2'] + params['roi_t1']] = 0
|
|
||||||
|
|
||||||
return roi_table
|
|
||||||
|
|
||||||
def trailing_space() -> List[Dimension]:
|
|
||||||
# All parameters here are mandatory, you can only modify their type or the range.
|
|
||||||
return [
|
|
||||||
# Fixed to true, if optimizing trailing_stop we assume to use trailing stop at all times.
|
|
||||||
Categorical([True], name='trailing_stop'),
|
|
||||||
|
|
||||||
SKDecimal(0.01, 0.35, decimals=3, name='trailing_stop_positive'),
|
|
||||||
# 'trailing_stop_positive_offset' should be greater than 'trailing_stop_positive',
|
|
||||||
# so this intermediate parameter is used as the value of the difference between
|
|
||||||
# them. The value of the 'trailing_stop_positive_offset' is constructed in the
|
|
||||||
# generate_trailing_params() method.
|
|
||||||
# This is similar to the hyperspace dimensions used for constructing the ROI tables.
|
|
||||||
SKDecimal(0.001, 0.1, decimals=3, name='trailing_stop_positive_offset_p1'),
|
|
||||||
|
|
||||||
Categorical([True, False], name='trailing_only_offset_is_reached'),
|
|
||||||
]
|
|
||||||
|
|
||||||
# Define a custom max_open_trades space
|
|
||||||
def max_open_trades_space(self) -> List[Dimension]:
|
|
||||||
return [
|
|
||||||
Integer(-1, 10, name='max_open_trades'),
|
|
||||||
]
|
|
||||||
```
|
```
|
||||||
|
|
||||||
!!! Note
|
!!! Note
|
||||||
@@ -144,7 +101,7 @@ class MyAwesomeStrategy(IStrategy):
|
|||||||
|
|
||||||
### Dynamic parameters
|
### Dynamic parameters
|
||||||
|
|
||||||
Parameters can also be defined dynamically, but must be available to the instance once the [`bot_start()` callback](strategy-callbacks.md#bot-start) has been called.
|
Parameters can also be defined dynamically, but must be available to the instance once the * [`bot_start()` callback](strategy-callbacks.md#bot-start) has been called.
|
||||||
|
|
||||||
``` python
|
``` python
|
||||||
|
|
||||||
@@ -161,53 +118,56 @@ class MyAwesomeStrategy(IStrategy):
|
|||||||
|
|
||||||
### Overriding Base estimator
|
### Overriding Base estimator
|
||||||
|
|
||||||
You can define your own optuna sampler for Hyperopt by implementing `generate_estimator()` in the Hyperopt subclass.
|
You can define your own estimator for Hyperopt by implementing `generate_estimator()` in the Hyperopt subclass.
|
||||||
|
|
||||||
```python
|
```python
|
||||||
class MyAwesomeStrategy(IStrategy):
|
class MyAwesomeStrategy(IStrategy):
|
||||||
class HyperOpt:
|
class HyperOpt:
|
||||||
def generate_estimator(dimensions: List['Dimension'], **kwargs):
|
def generate_estimator(dimensions: List['Dimension'], **kwargs):
|
||||||
return "NSGAIIISampler"
|
return "RF"
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
Possible values are either one of "NSGAIISampler", "TPESampler", "GPSampler", "CmaEsSampler", "NSGAIIISampler", "QMCSampler" (Details can be found in the [optuna-samplers documentation](https://optuna.readthedocs.io/en/stable/reference/samplers/index.html)), or "an instance of a class that inherits from `optuna.samplers.BaseSampler`".
|
Possible values are either one of "GP", "RF", "ET", "GBRT" (Details can be found in the [scikit-optimize documentation](https://scikit-optimize.github.io/)), or "an instance of a class that inherits from `RegressorMixin` (from sklearn) and where the `predict` method has an optional `return_std` argument, which returns `std(Y | x)` along with `E[Y | x]`".
|
||||||
|
|
||||||
Some research will be necessary to find additional Samplers (from optunahub) for example.
|
Some research will be necessary to find additional Regressors.
|
||||||
|
|
||||||
|
Example for `ExtraTreesRegressor` ("ET") with additional parameters:
|
||||||
|
|
||||||
|
```python
|
||||||
|
class MyAwesomeStrategy(IStrategy):
|
||||||
|
class HyperOpt:
|
||||||
|
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
|
!!! 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.
|
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 (`"NSGAIIISampler"` has proven to be the most versatile) without further parameters.
|
If you're unsure about this, best use one of the Defaults (`"ET"` has proven to be the most versatile) without further parameters.
|
||||||
|
|
||||||
??? Example "Using `AutoSampler` from Optunahub"
|
|
||||||
|
|
||||||
[AutoSampler docs](https://hub.optuna.org/samplers/auto_sampler/)
|
|
||||||
|
|
||||||
Install the necessary dependencies
|
|
||||||
``` bash
|
|
||||||
pip install optunahub cmaes torch scipy
|
|
||||||
```
|
|
||||||
Implement `generate_estimator()` in your strategy
|
|
||||||
|
|
||||||
``` python
|
|
||||||
# ...
|
|
||||||
from freqtrade.strategy.interface import IStrategy
|
|
||||||
from typing import List
|
|
||||||
import optunahub
|
|
||||||
# ...
|
|
||||||
|
|
||||||
class my_strategy(IStrategy):
|
|
||||||
class HyperOpt:
|
|
||||||
def generate_estimator(dimensions: List["Dimension"], **kwargs):
|
|
||||||
if "random_state" in kwargs.keys():
|
|
||||||
return optunahub.load_module("samplers/auto_sampler").AutoSampler(seed=kwargs["random_state"])
|
|
||||||
else:
|
|
||||||
return optunahub.load_module("samplers/auto_sampler").AutoSampler()
|
|
||||||
|
|
||||||
```
|
|
||||||
|
|
||||||
Obviously the same approach will work for all other Samplers optuna supports.
|
|
||||||
|
|
||||||
|
|
||||||
## Space options
|
## Space options
|
||||||
|
|
||||||
|
|||||||
@@ -1,153 +0,0 @@
|
|||||||
# Orderflow data
|
|
||||||
|
|
||||||
This guide walks you through utilizing public trade data for advanced orderflow analysis in Freqtrade.
|
|
||||||
|
|
||||||
!!! Warning "Experimental Feature"
|
|
||||||
The orderflow feature is currently in beta and may be subject to changes in future releases. Please report any issues or feedback on the [Freqtrade GitHub repository](https://github.com/freqtrade/freqtrade/issues).
|
|
||||||
It's also currently not been tested with freqAI - and combining these two features is considered out of scope at this point.
|
|
||||||
|
|
||||||
!!! Warning "Performance"
|
|
||||||
Orderflow requires raw trades data. This data is rather large, and can cause a slow initial startup, when freqtrade needs to download the trades data for the last X candles. Additionally, enabling this feature will cause increased memory usage. Please ensure to have sufficient resources available.
|
|
||||||
|
|
||||||
## Getting Started
|
|
||||||
|
|
||||||
### Enable Public Trades
|
|
||||||
|
|
||||||
In your `config.json` file, set the `use_public_trades` option to true under the `exchange` section.
|
|
||||||
|
|
||||||
```json
|
|
||||||
"exchange": {
|
|
||||||
...
|
|
||||||
"use_public_trades": true,
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
### Configure Orderflow Processing
|
|
||||||
|
|
||||||
Define your desired settings for orderflow processing within the orderflow section of config.json. Here, you can adjust factors like:
|
|
||||||
|
|
||||||
- `cache_size`: How many previous orderflow candles are saved into cache instead of calculated every new candle
|
|
||||||
- `max_candles`: Filter how many candles would you like to get trades data for.
|
|
||||||
- `scale`: This controls the price bin size for the footprint chart.
|
|
||||||
- `stacked_imbalance_range`: Defines the minimum consecutive imbalanced price levels required for consideration.
|
|
||||||
- `imbalance_volume`: Filters out imbalances with volume below this threshold.
|
|
||||||
- `imbalance_ratio`: Filters out imbalances with a ratio (difference between ask and bid volume) lower than this value.
|
|
||||||
|
|
||||||
```json
|
|
||||||
"orderflow": {
|
|
||||||
"cache_size": 1000,
|
|
||||||
"max_candles": 1500,
|
|
||||||
"scale": 0.5,
|
|
||||||
"stacked_imbalance_range": 3, // needs at least this amount of imbalance next to each other
|
|
||||||
"imbalance_volume": 1, // filters out below
|
|
||||||
"imbalance_ratio": 3 // filters out ratio lower than
|
|
||||||
},
|
|
||||||
```
|
|
||||||
|
|
||||||
## Downloading Trade Data for Backtesting
|
|
||||||
|
|
||||||
To download historical trade data for backtesting, use the --dl-trades flag with the freqtrade download-data command.
|
|
||||||
|
|
||||||
```bash
|
|
||||||
freqtrade download-data -p BTC/USDT:USDT --timerange 20230101- --trading-mode futures --timeframes 5m --dl-trades
|
|
||||||
```
|
|
||||||
|
|
||||||
!!! Warning "Data availability"
|
|
||||||
Not all exchanges provide public trade data. For supported exchanges, freqtrade will warn you if public trade data is not available if you start downloading data with the `--dl-trades` flag.
|
|
||||||
|
|
||||||
## Accessing Orderflow Data
|
|
||||||
|
|
||||||
Once activated, several new columns become available in your dataframe:
|
|
||||||
|
|
||||||
``` python
|
|
||||||
|
|
||||||
dataframe["trades"] # Contains information about each individual trade.
|
|
||||||
dataframe["orderflow"] # Represents a footprint chart dict (see below)
|
|
||||||
dataframe["imbalances"] # Contains information about imbalances in the order flow.
|
|
||||||
dataframe["bid"] # Total bid volume
|
|
||||||
dataframe["ask"] # Total ask volume
|
|
||||||
dataframe["delta"] # Difference between ask and bid volume.
|
|
||||||
dataframe["min_delta"] # Minimum delta within the candle
|
|
||||||
dataframe["max_delta"] # Maximum delta within the candle
|
|
||||||
dataframe["total_trades"] # Total number of trades
|
|
||||||
dataframe["stacked_imbalances_bid"] # List of price levels of stacked bid imbalance range beginnings
|
|
||||||
dataframe["stacked_imbalances_ask"] # List of price levels of stacked ask imbalance range beginnings
|
|
||||||
```
|
|
||||||
|
|
||||||
You can access these columns in your strategy code for further analysis. Here's an example:
|
|
||||||
|
|
||||||
``` python
|
|
||||||
def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:
|
|
||||||
# Calculating cumulative delta
|
|
||||||
dataframe["cum_delta"] = cumulative_delta(dataframe["delta"])
|
|
||||||
# Accessing total trades
|
|
||||||
total_trades = dataframe["total_trades"]
|
|
||||||
...
|
|
||||||
|
|
||||||
def cumulative_delta(delta: Series):
|
|
||||||
cumdelta = delta.cumsum()
|
|
||||||
return cumdelta
|
|
||||||
|
|
||||||
```
|
|
||||||
|
|
||||||
### Footprint chart (`dataframe["orderflow"]`)
|
|
||||||
|
|
||||||
This column provides a detailed breakdown of buy and sell orders at different price levels, offering valuable insights into order flow dynamics. The `scale` parameter in your configuration determines the price bin size for this representation
|
|
||||||
|
|
||||||
The `orderflow` column contains a dict with the following structure:
|
|
||||||
|
|
||||||
``` output
|
|
||||||
{
|
|
||||||
"price": {
|
|
||||||
"bid_amount": 0.0,
|
|
||||||
"ask_amount": 0.0,
|
|
||||||
"bid": 0,
|
|
||||||
"ask": 0,
|
|
||||||
"delta": 0.0,
|
|
||||||
"total_volume": 0.0,
|
|
||||||
"total_trades": 0
|
|
||||||
}
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
#### Orderflow column explanation
|
|
||||||
|
|
||||||
- key: Price bin - binned at `scale` intervals
|
|
||||||
- `bid_amount`: Total volume bought at each price level.
|
|
||||||
- `ask_amount`: Total volume sold at each price level.
|
|
||||||
- `bid`: Number of buy orders at each price level.
|
|
||||||
- `ask`: Number of sell orders at each price level.
|
|
||||||
- `delta`: Difference between ask and bid volume at each price level.
|
|
||||||
- `total_volume`: Total volume (ask amount + bid amount) at each price level.
|
|
||||||
- `total_trades`: Total number of trades (ask + bid) at each price level.
|
|
||||||
|
|
||||||
By leveraging these features, you can gain valuable insights into market sentiment and potential trading opportunities based on order flow analysis.
|
|
||||||
|
|
||||||
### Raw trades data (`dataframe["trades"]`)
|
|
||||||
|
|
||||||
List with the individual trades that occurred during the candle. This data can be used for more granular analysis of order flow dynamics.
|
|
||||||
|
|
||||||
Each individual entry contains a dict with the following keys:
|
|
||||||
|
|
||||||
- `timestamp`: Timestamp of the trade.
|
|
||||||
- `date`: Date of the trade.
|
|
||||||
- `price`: Price of the trade.
|
|
||||||
- `amount`: Volume of the trade.
|
|
||||||
- `side`: Buy or sell.
|
|
||||||
- `id`: Unique identifier for the trade.
|
|
||||||
- `cost`: Total cost of the trade (price * amount).
|
|
||||||
|
|
||||||
### Imbalances (`dataframe["imbalances"]`)
|
|
||||||
|
|
||||||
This column provides a dict with information about imbalances in the order flow. An imbalance occurs when there is a significant difference between the ask and bid volume at a given price level.
|
|
||||||
|
|
||||||
Each row looks as follows - with price as index, and the corresponding bid and ask imbalance values as columns
|
|
||||||
|
|
||||||
``` output
|
|
||||||
{
|
|
||||||
"price": {
|
|
||||||
"bid_imbalance": False,
|
|
||||||
"ask_imbalance": False
|
|
||||||
}
|
|
||||||
}
|
|
||||||
```
|
|
||||||
@@ -114,46 +114,8 @@ services:
|
|||||||
--strategy SampleStrategy
|
--strategy SampleStrategy
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
You can use whatever naming convention you want, freqtrade1 and 2 are arbitrary. Note, that you will need to use different database files, port mappings and telegram configurations for each instance, as mentioned above.
|
You can use whatever naming convention you want, freqtrade1 and 2 are arbitrary. Note, that you will need to use different database files, port mappings and telegram configurations for each instance, as mentioned above.
|
||||||
|
|
||||||
## Use a different database system
|
|
||||||
|
|
||||||
Freqtrade is using SQLAlchemy, which supports multiple different database systems. As such, a multitude of database systems should be supported.
|
|
||||||
Freqtrade does not depend or install any additional database driver. Please refer to the [SQLAlchemy docs](https://docs.sqlalchemy.org/en/14/core/engines.html#database-urls) on installation instructions for the respective database systems.
|
|
||||||
|
|
||||||
The following systems have been tested and are known to work with freqtrade:
|
|
||||||
|
|
||||||
* sqlite (default)
|
|
||||||
* PostgreSQL
|
|
||||||
* MariaDB
|
|
||||||
|
|
||||||
!!! Warning
|
|
||||||
By using one of the below database systems, you acknowledge that you know how to manage such a system. The freqtrade team will not provide any support with setup or maintenance (or backups) of the below database systems.
|
|
||||||
|
|
||||||
### PostgreSQL
|
|
||||||
|
|
||||||
Installation:
|
|
||||||
`pip install psycopg2-binary`
|
|
||||||
|
|
||||||
Usage:
|
|
||||||
`... --db-url postgresql+psycopg2://<username>:<password>@localhost:5432/<database>`
|
|
||||||
|
|
||||||
Freqtrade will automatically create the tables necessary upon startup.
|
|
||||||
|
|
||||||
If you're running different instances of Freqtrade, you must either setup one database per Instance or use different users / schemas for your connections.
|
|
||||||
|
|
||||||
### MariaDB / MySQL
|
|
||||||
|
|
||||||
Freqtrade supports MariaDB by using SQLAlchemy, which supports multiple different database systems.
|
|
||||||
|
|
||||||
Installation:
|
|
||||||
`pip install pymysql`
|
|
||||||
|
|
||||||
Usage:
|
|
||||||
`... --db-url mysql+pymysql://<username>:<password>@localhost:3306/<database>`
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## Configure the bot running as a systemd service
|
## Configure the bot running as a systemd service
|
||||||
|
|
||||||
@@ -177,7 +139,7 @@ sudo loginctl enable-linger "$USER"
|
|||||||
If you run the bot as a service, you can use systemd service manager as a software watchdog monitoring freqtrade bot
|
If you run the bot as a service, you can use systemd service manager as a software watchdog monitoring freqtrade bot
|
||||||
state and restarting it in the case of failures. If the `internals.sd_notify` parameter is set to true in the
|
state and restarting it in the case of failures. If the `internals.sd_notify` parameter is set to true in the
|
||||||
configuration or the `--sd-notify` command line option is used, the bot will send keep-alive ping messages to systemd
|
configuration or the `--sd-notify` command line option is used, the bot will send keep-alive ping messages to systemd
|
||||||
using the sd_notify (systemd notifications) protocol and will also tell systemd its current state (Running, Paused or Stopped)
|
using the sd_notify (systemd notifications) protocol and will also tell systemd its current state (Running or Stopped)
|
||||||
when it changes.
|
when it changes.
|
||||||
|
|
||||||
The `freqtrade.service.watchdog` file contains an example of the service unit configuration file which uses systemd
|
The `freqtrade.service.watchdog` file contains an example of the service unit configuration file which uses systemd
|
||||||
@@ -188,113 +150,30 @@ as the watchdog.
|
|||||||
|
|
||||||
## Advanced Logging
|
## Advanced Logging
|
||||||
|
|
||||||
Freqtrade uses the default logging module provided by python.
|
|
||||||
Python allows for extensive [logging configuration](https://docs.python.org/3/library/logging.config.html#logging.config.dictConfig) in this regard - way more than what can be covered here.
|
|
||||||
|
|
||||||
Default logging format (coloured terminal output) is set up by default if no `log_config` is provided in your freqtrade configuration.
|
|
||||||
Using `--logfile logfile.log` will enable the RotatingFileHandler.
|
|
||||||
|
|
||||||
If you're not content with the log format, or with the default settings provided for the RotatingFileHandler, you can customize logging to your liking by adding the `log_config` configuration to your freqtrade configuration file(s).
|
|
||||||
|
|
||||||
The default configuration looks roughly like the below, with the file handler being provided but not enabled as the `filename` is commented out.
|
|
||||||
Uncomment this line and supply a valid path/filename to enable it.
|
|
||||||
|
|
||||||
``` json hl_lines="5-7 13-16 27"
|
|
||||||
{
|
|
||||||
"log_config": {
|
|
||||||
"version": 1,
|
|
||||||
"formatters": {
|
|
||||||
"basic": {
|
|
||||||
"format": "%(message)s"
|
|
||||||
},
|
|
||||||
"standard": {
|
|
||||||
"format": "%(asctime)s - %(name)s - %(levelname)s - %(message)s"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"handlers": {
|
|
||||||
"console": {
|
|
||||||
"class": "freqtrade.loggers.ft_rich_handler.FtRichHandler",
|
|
||||||
"formatter": "basic"
|
|
||||||
},
|
|
||||||
"file": {
|
|
||||||
"class": "logging.handlers.RotatingFileHandler",
|
|
||||||
"formatter": "standard",
|
|
||||||
// "filename": "someRandomLogFile.log",
|
|
||||||
"maxBytes": 10485760,
|
|
||||||
"backupCount": 10
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"root": {
|
|
||||||
"handlers": [
|
|
||||||
"console",
|
|
||||||
// "file"
|
|
||||||
],
|
|
||||||
"level": "INFO",
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
!!! Note "highlighted lines"
|
|
||||||
Highlighted lines in the above code-block define the Rich handler and belong together.
|
|
||||||
The formatter "standard" and "file" will belong to the FileHandler.
|
|
||||||
|
|
||||||
Each handler must use one of the defined formatters (by name), its class must be available, and must be a valid logging class.
|
|
||||||
To actually use a handler, it must be in the "handlers" section inside the "root" segment.
|
|
||||||
If this section is left out, freqtrade will provide no output (in the non-configured handler, anyway).
|
|
||||||
|
|
||||||
!!! Tip "Explicit log configuration"
|
|
||||||
We recommend to extract the logging configuration from your main freqtrade configuration file, and provide it to your bot via [multiple configuration files](configuration.md#multiple-configuration-files) functionality. This will avoid unnecessary code duplication.
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
On many Linux systems the bot can be configured to send its log messages to `syslog` or `journald` system services. Logging to a remote `syslog` server is also available on Windows. The special values for the `--logfile` command line option can be used for this.
|
On many Linux systems the bot can be configured to send its log messages to `syslog` or `journald` system services. Logging to a remote `syslog` server is also available on Windows. The special values for the `--logfile` command line option can be used for this.
|
||||||
|
|
||||||
### Logging to syslog
|
### Logging to syslog
|
||||||
|
|
||||||
To send Freqtrade log messages to a local or remote `syslog` service use the `"log_config"` setup option to configure logging.
|
To send Freqtrade log messages to a local or remote `syslog` service use the `--logfile` command line option with the value in the following format:
|
||||||
|
|
||||||
``` json
|
* `--logfile syslog:<syslog_address>` -- send log messages to `syslog` service using the `<syslog_address>` as the syslog address.
|
||||||
{
|
|
||||||
// ...
|
|
||||||
"log_config": {
|
|
||||||
"version": 1,
|
|
||||||
"formatters": {
|
|
||||||
"syslog_fmt": {
|
|
||||||
"format": "%(name)s - %(levelname)s - %(message)s"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"handlers": {
|
|
||||||
// Other handlers?
|
|
||||||
"syslog": {
|
|
||||||
"class": "logging.handlers.SysLogHandler",
|
|
||||||
"formatter": "syslog_fmt",
|
|
||||||
// Use one of the other options above as address instead?
|
|
||||||
"address": "/dev/log"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"root": {
|
|
||||||
"handlers": [
|
|
||||||
// other handlers
|
|
||||||
"syslog",
|
|
||||||
|
|
||||||
]
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
The syslog address can be either a Unix domain socket (socket filename) or a UDP socket specification, consisting of IP address and UDP port, separated by the `:` character.
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
[Additional log-handlers](#advanced-logging) may need to be configured to for example also have log output in the console.
|
So, the following are the examples of possible usages:
|
||||||
|
|
||||||
#### Syslog usage
|
* `--logfile syslog:/dev/log` -- log to syslog (rsyslog) using the `/dev/log` socket, suitable for most systems.
|
||||||
|
* `--logfile syslog` -- same as above, the shortcut for `/dev/log`.
|
||||||
|
* `--logfile syslog:/var/run/syslog` -- log to syslog (rsyslog) using the `/var/run/syslog` socket. Use this on MacOS.
|
||||||
|
* `--logfile syslog:localhost:514` -- log to local syslog using UDP socket, if it listens on port 514.
|
||||||
|
* `--logfile syslog:<ip>:514` -- log to remote syslog at IP address and port 514. This may be used on Windows for remote logging to an external syslog server.
|
||||||
|
|
||||||
Log messages are send to `syslog` with the `user` facility. So you can see them with the following commands:
|
Log messages are send to `syslog` with the `user` facility. So you can see them with the following commands:
|
||||||
|
|
||||||
* `tail -f /var/log/user`, or
|
* `tail -f /var/log/user`, or
|
||||||
* install a comprehensive graphical viewer (for instance, 'Log File Viewer' for Ubuntu).
|
* install a comprehensive graphical viewer (for instance, 'Log File Viewer' for Ubuntu).
|
||||||
|
|
||||||
On many systems `syslog` (`rsyslog`) fetches data from `journald` (and vice versa), so both syslog or journald can be used and the messages be viewed with both `journalctl` and a syslog viewer utility. You can combine this in any way which suites you better.
|
On many systems `syslog` (`rsyslog`) fetches data from `journald` (and vice versa), so both `--logfile syslog` or `--logfile journald` can be used and the messages be viewed with both `journalctl` and a syslog viewer utility. You can combine this in any way which suites you better.
|
||||||
|
|
||||||
For `rsyslog` the messages from the bot can be redirected into a separate dedicated log file. To achieve this, add
|
For `rsyslog` the messages from the bot can be redirected into a separate dedicated log file. To achieve this, add
|
||||||
|
|
||||||
@@ -311,66 +190,13 @@ For `syslog` (`rsyslog`), the reduction mode can be switched on. This will reduc
|
|||||||
$RepeatedMsgReduction on
|
$RepeatedMsgReduction on
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Syslog addressing
|
|
||||||
|
|
||||||
The syslog address can be either a Unix domain socket (socket filename) or a UDP socket specification, consisting of IP address and UDP port, separated by the `:` character.
|
|
||||||
|
|
||||||
So, the following are the examples of possible addresses:
|
|
||||||
|
|
||||||
* `"address": "/dev/log"` -- log to syslog (rsyslog) using the `/dev/log` socket, suitable for most systems.
|
|
||||||
* `"address": "/var/run/syslog"` -- log to syslog (rsyslog) using the `/var/run/syslog` socket. Use this on MacOS.
|
|
||||||
* `"address": "localhost:514"` -- log to local syslog using UDP socket, if it listens on port 514.
|
|
||||||
* `"address": "<ip>:514"` -- log to remote syslog at IP address and port 514. This may be used on Windows for remote logging to an external syslog server.
|
|
||||||
|
|
||||||
??? Info "Deprecated - configure syslog via command line"
|
|
||||||
`--logfile syslog:<syslog_address>` -- send log messages to `syslog` service using the `<syslog_address>` as the syslog address.
|
|
||||||
|
|
||||||
The syslog address can be either a Unix domain socket (socket filename) or a UDP socket specification, consisting of IP address and UDP port, separated by the `:` character.
|
|
||||||
|
|
||||||
So, the following are the examples of possible usages:
|
|
||||||
|
|
||||||
* `--logfile syslog:/dev/log` -- log to syslog (rsyslog) using the `/dev/log` socket, suitable for most systems.
|
|
||||||
* `--logfile syslog` -- same as above, the shortcut for `/dev/log`.
|
|
||||||
* `--logfile syslog:/var/run/syslog` -- log to syslog (rsyslog) using the `/var/run/syslog` socket. Use this on MacOS.
|
|
||||||
* `--logfile syslog:localhost:514` -- log to local syslog using UDP socket, if it listens on port 514.
|
|
||||||
* `--logfile syslog:<ip>:514` -- log to remote syslog at IP address and port 514. This may be used on Windows for remote logging to an external syslog server.
|
|
||||||
|
|
||||||
### Logging to journald
|
### Logging to journald
|
||||||
|
|
||||||
This needs the `cysystemd` python package installed as dependency (`pip install cysystemd`), which is not available on Windows. Hence, the whole journald logging functionality is not available for a bot running on Windows.
|
This needs the `systemd` python package installed as the dependency, which is not available on Windows. Hence, the whole journald logging functionality is not available for a bot running on Windows.
|
||||||
|
|
||||||
To send Freqtrade log messages to `journald` system service, add the following configuration snippet to your configuration.
|
To send Freqtrade log messages to `journald` system service use the `--logfile` command line option with the value in the following format:
|
||||||
|
|
||||||
``` json
|
* `--logfile journald` -- send log messages to `journald`.
|
||||||
{
|
|
||||||
// ...
|
|
||||||
"log_config": {
|
|
||||||
"version": 1,
|
|
||||||
"formatters": {
|
|
||||||
"journald_fmt": {
|
|
||||||
"format": "%(name)s - %(levelname)s - %(message)s"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"handlers": {
|
|
||||||
// Other handlers?
|
|
||||||
"journald": {
|
|
||||||
"class": "cysystemd.journal.JournaldLogHandler",
|
|
||||||
"formatter": "journald_fmt",
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"root": {
|
|
||||||
"handlers": [
|
|
||||||
// ..
|
|
||||||
"journald",
|
|
||||||
|
|
||||||
]
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
[Additional log-handlers](#advanced-logging) may need to be configured to for example also have log output in the console.
|
|
||||||
|
|
||||||
Log messages are send to `journald` with the `user` facility. So you can see them with the following commands:
|
Log messages are send to `journald` with the `user` facility. So you can see them with the following commands:
|
||||||
|
|
||||||
@@ -380,51 +206,3 @@ Log messages are send to `journald` with the `user` facility. So you can see the
|
|||||||
There are many other options in the `journalctl` utility to filter the messages, see manual pages for this utility.
|
There are many other options in the `journalctl` utility to filter the messages, see manual pages for this utility.
|
||||||
|
|
||||||
On many systems `syslog` (`rsyslog`) fetches data from `journald` (and vice versa), so both `--logfile syslog` or `--logfile journald` can be used and the messages be viewed with both `journalctl` and a syslog viewer utility. You can combine this in any way which suites you better.
|
On many systems `syslog` (`rsyslog`) fetches data from `journald` (and vice versa), so both `--logfile syslog` or `--logfile journald` can be used and the messages be viewed with both `journalctl` and a syslog viewer utility. You can combine this in any way which suites you better.
|
||||||
|
|
||||||
??? Info "Deprecated - configure journald via command line"
|
|
||||||
To send Freqtrade log messages to `journald` system service use the `--logfile` command line option with the value in the following format:
|
|
||||||
|
|
||||||
`--logfile journald` -- send log messages to `journald`.
|
|
||||||
|
|
||||||
### Log format as JSON
|
|
||||||
|
|
||||||
You can also configure the default output stream to use JSON format instead.
|
|
||||||
The "fmt_dict" attribute defines the keys for the json output - as well as the [python logging LogRecord attributes](https://docs.python.org/3/library/logging.html#logrecord-attributes).
|
|
||||||
|
|
||||||
The below configuration will change the default output to JSON. The same formatter could however also be used in combination with the `RotatingFileHandler`.
|
|
||||||
We recommend to keep one format in human readable form.
|
|
||||||
|
|
||||||
``` json
|
|
||||||
{
|
|
||||||
// ...
|
|
||||||
"log_config": {
|
|
||||||
"version": 1,
|
|
||||||
"formatters": {
|
|
||||||
"json": {
|
|
||||||
"()": "freqtrade.loggers.json_formatter.JsonFormatter",
|
|
||||||
"fmt_dict": {
|
|
||||||
"timestamp": "asctime",
|
|
||||||
"level": "levelname",
|
|
||||||
"logger": "name",
|
|
||||||
"message": "message"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"handlers": {
|
|
||||||
// Other handlers?
|
|
||||||
"jsonStream": {
|
|
||||||
"class": "logging.StreamHandler",
|
|
||||||
"formatter": "json"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"root": {
|
|
||||||
"handlers": [
|
|
||||||
// ..
|
|
||||||
"jsonStream",
|
|
||||||
|
|
||||||
]
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 94 KiB |
|
Before Width: | Height: | Size: 91 KiB |
|
Before Width: | Height: | Size: 111 KiB |
|
Before Width: | Height: | Size: 109 KiB |
|
Before Width: | Height: | Size: 133 KiB |
|
Before Width: | Height: | Size: 135 KiB |
|
Before Width: | Height: | Size: 242 KiB |
|
Before Width: | Height: | Size: 241 KiB |
|
Before Width: | Height: | Size: 209 KiB |
|
Before Width: | Height: | Size: 18 KiB |
|
Before Width: | Height: | Size: 51 KiB |
|
Before Width: | Height: | Size: 50 KiB |
|
Before Width: | Height: | Size: 80 KiB |
|
Before Width: | Height: | Size: 79 KiB |
|
Before Width: | Height: | Size: 48 KiB |
|
Before Width: | Height: | Size: 29 KiB |
|
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 18 KiB |
@@ -5,11 +5,105 @@ This page explains how to validate your strategy performance by using Backtestin
|
|||||||
Backtesting requires historic data to be available.
|
Backtesting requires historic data to be available.
|
||||||
To learn how to get data for the pairs and exchange you're interested in, head over to the [Data Downloading](data-download.md) section of the documentation.
|
To learn how to get data for the pairs and exchange you're interested in, head over to the [Data Downloading](data-download.md) section of the documentation.
|
||||||
|
|
||||||
Backtesting is also available in [webserver mode](freq-ui.md#backtesting), which allows you to run backtests via the web interface.
|
|
||||||
|
|
||||||
## Backtesting command reference
|
## Backtesting command reference
|
||||||
|
|
||||||
--8<-- "commands/backtesting.md"
|
```
|
||||||
|
usage: freqtrade backtesting [-h] [-v] [--logfile FILE] [-V] [-c PATH]
|
||||||
|
[-d PATH] [--userdir PATH] [-s NAME]
|
||||||
|
[--strategy-path PATH] [-i TIMEFRAME]
|
||||||
|
[--timerange TIMERANGE]
|
||||||
|
[--data-format-ohlcv {json,jsongz,hdf5}]
|
||||||
|
[--max-open-trades INT]
|
||||||
|
[--stake-amount STAKE_AMOUNT] [--fee FLOAT]
|
||||||
|
[-p PAIRS [PAIRS ...]] [--eps] [--dmmp]
|
||||||
|
[--enable-protections]
|
||||||
|
[--dry-run-wallet DRY_RUN_WALLET]
|
||||||
|
[--timeframe-detail TIMEFRAME_DETAIL]
|
||||||
|
[--strategy-list STRATEGY_LIST [STRATEGY_LIST ...]]
|
||||||
|
[--export {none,trades,signals}]
|
||||||
|
[--export-filename PATH]
|
||||||
|
[--breakdown {day,week,month} [{day,week,month} ...]]
|
||||||
|
[--cache {none,day,week,month}]
|
||||||
|
|
||||||
|
optional arguments:
|
||||||
|
-h, --help show this help message and exit
|
||||||
|
-i TIMEFRAME, --timeframe TIMEFRAME
|
||||||
|
Specify timeframe (`1m`, `5m`, `30m`, `1h`, `1d`).
|
||||||
|
--timerange TIMERANGE
|
||||||
|
Specify what timerange of data to use.
|
||||||
|
--data-format-ohlcv {json,jsongz,hdf5}
|
||||||
|
Storage format for downloaded candle (OHLCV) data.
|
||||||
|
(default: `json`).
|
||||||
|
--max-open-trades INT
|
||||||
|
Override the value of the `max_open_trades`
|
||||||
|
configuration setting.
|
||||||
|
--stake-amount STAKE_AMOUNT
|
||||||
|
Override the value of the `stake_amount` configuration
|
||||||
|
setting.
|
||||||
|
--fee FLOAT Specify fee ratio. Will be applied twice (on trade
|
||||||
|
entry and exit).
|
||||||
|
-p PAIRS [PAIRS ...], --pairs PAIRS [PAIRS ...]
|
||||||
|
Limit command to these pairs. Pairs are space-
|
||||||
|
separated.
|
||||||
|
--eps, --enable-position-stacking
|
||||||
|
Allow buying the same pair multiple times (position
|
||||||
|
stacking).
|
||||||
|
--dmmp, --disable-max-market-positions
|
||||||
|
Disable applying `max_open_trades` during backtest
|
||||||
|
(same as setting `max_open_trades` to a very high
|
||||||
|
number).
|
||||||
|
--enable-protections, --enableprotections
|
||||||
|
Enable protections for backtesting.Will slow
|
||||||
|
backtesting down by a considerable amount, but will
|
||||||
|
include configured protections
|
||||||
|
--dry-run-wallet DRY_RUN_WALLET, --starting-balance DRY_RUN_WALLET
|
||||||
|
Starting balance, used for backtesting / hyperopt and
|
||||||
|
dry-runs.
|
||||||
|
--timeframe-detail TIMEFRAME_DETAIL
|
||||||
|
Specify detail timeframe for backtesting (`1m`, `5m`,
|
||||||
|
`30m`, `1h`, `1d`).
|
||||||
|
--strategy-list STRATEGY_LIST [STRATEGY_LIST ...]
|
||||||
|
Provide a space-separated list of strategies to
|
||||||
|
backtest. Please note that timeframe needs to be set
|
||||||
|
either in config or via command line. When using this
|
||||||
|
together with `--export trades`, the strategy-name is
|
||||||
|
injected into the filename (so `backtest-data.json`
|
||||||
|
becomes `backtest-data-SampleStrategy.json`
|
||||||
|
--export {none,trades,signals}
|
||||||
|
Export backtest results (default: trades).
|
||||||
|
--export-filename PATH, --backtest-filename PATH
|
||||||
|
Use this filename for backtest results.Requires
|
||||||
|
`--export` to be set as well. Example: `--export-filen
|
||||||
|
ame=user_data/backtest_results/backtest_today.json`
|
||||||
|
--breakdown {day,week,month} [{day,week,month} ...]
|
||||||
|
Show backtesting breakdown per [day, week, month].
|
||||||
|
--cache {none,day,week,month}
|
||||||
|
Load a cached backtest result no older than specified
|
||||||
|
age (default: day).
|
||||||
|
|
||||||
|
Common arguments:
|
||||||
|
-v, --verbose Verbose mode (-vv for more, -vvv to get all messages).
|
||||||
|
--logfile FILE Log to the file specified. Special values are:
|
||||||
|
'syslog', 'journald'. See the documentation for more
|
||||||
|
details.
|
||||||
|
-V, --version show program's version number and exit
|
||||||
|
-c PATH, --config PATH
|
||||||
|
Specify configuration file (default:
|
||||||
|
`userdir/config.json` or `config.json` whichever
|
||||||
|
exists). Multiple --config options may be used. Can be
|
||||||
|
set to `-` to read config from stdin.
|
||||||
|
-d PATH, --datadir PATH
|
||||||
|
Path to directory with historical backtesting data.
|
||||||
|
--userdir PATH, --user-data-dir PATH
|
||||||
|
Path to userdata directory.
|
||||||
|
|
||||||
|
Strategy arguments:
|
||||||
|
-s NAME, --strategy NAME
|
||||||
|
Specify strategy class name which will be used by the
|
||||||
|
bot.
|
||||||
|
--strategy-path PATH Specify additional strategy lookup path.
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
## Test your strategy with Backtesting
|
## Test your strategy with Backtesting
|
||||||
|
|
||||||
@@ -76,11 +170,11 @@ freqtrade backtesting --strategy AwesomeStrategy --dry-run-wallet 1000
|
|||||||
|
|
||||||
Using a different on-disk historical candle (OHLCV) data source
|
Using a different on-disk historical candle (OHLCV) data source
|
||||||
|
|
||||||
Assume you downloaded the history data from the Binance exchange and kept it in the `user_data/data/binance-20180101` directory.
|
Assume you downloaded the history data from the Bittrex exchange and kept it in the `user_data/data/bittrex-20180101` directory.
|
||||||
You can then use this data for backtesting as follows:
|
You can then use this data for backtesting as follows:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
freqtrade backtesting --strategy AwesomeStrategy --datadir user_data/data/binance-20180101
|
freqtrade backtesting --strategy AwesomeStrategy --datadir user_data/data/bittrex-20180101
|
||||||
```
|
```
|
||||||
|
|
||||||
---
|
---
|
||||||
@@ -158,48 +252,46 @@ The most important in the backtesting is to understand the result.
|
|||||||
A backtesting result will look like that:
|
A backtesting result will look like that:
|
||||||
|
|
||||||
```
|
```
|
||||||
================================================ BACKTESTING REPORT =================================================
|
========================================================= BACKTESTING REPORT =========================================================
|
||||||
| Pair | Trades | Avg Profit % | Tot Profit BTC | Tot Profit % | Avg Duration | Wins Draws Loss Win% |
|
| Pair | Entries | Avg Profit % | Cum Profit % | Tot Profit BTC | Tot Profit % | Avg Duration | Wins Draws Loss Win% |
|
||||||
|----------+--------+----------------+------------------+----------------+--------------+--------------------------|
|
|:---------|--------:|---------------:|---------------:|-----------------:|---------------:|:-------------|-------------------------:|
|
||||||
| ADA/BTC | 35 | -0.11 | -0.00019428 | -1.94 | 4:35:00 | 14 0 21 40.0 |
|
| ADA/BTC | 35 | -0.11 | -3.88 | -0.00019428 | -1.94 | 4:35:00 | 14 0 21 40.0 |
|
||||||
| ARK/BTC | 11 | -0.41 | -0.00022647 | -2.26 | 2:03:00 | 3 0 8 27.3 |
|
| ARK/BTC | 11 | -0.41 | -4.52 | -0.00022647 | -2.26 | 2:03:00 | 3 0 8 27.3 |
|
||||||
| BTS/BTC | 32 | 0.31 | 0.00048938 | 4.89 | 5:05:00 | 18 0 14 56.2 |
|
| BTS/BTC | 32 | 0.31 | 9.78 | 0.00048938 | 4.89 | 5:05:00 | 18 0 14 56.2 |
|
||||||
| DASH/BTC | 13 | -0.08 | -0.00005343 | -0.53 | 4:39:00 | 6 0 7 46.2 |
|
| DASH/BTC | 13 | -0.08 | -1.07 | -0.00005343 | -0.53 | 4:39:00 | 6 0 7 46.2 |
|
||||||
| ENG/BTC | 18 | 1.36 | 0.00122807 | 12.27 | 2:50:00 | 8 0 10 44.4 |
|
| ENG/BTC | 18 | 1.36 | 24.54 | 0.00122807 | 12.27 | 2:50:00 | 8 0 10 44.4 |
|
||||||
| EOS/BTC | 36 | 0.08 | 0.00015304 | 1.53 | 3:34:00 | 16 0 20 44.4 |
|
| EOS/BTC | 36 | 0.08 | 3.06 | 0.00015304 | 1.53 | 3:34:00 | 16 0 20 44.4 |
|
||||||
| ETC/BTC | 26 | 0.37 | 0.00047576 | 4.75 | 6:14:00 | 11 0 15 42.3 |
|
| ETC/BTC | 26 | 0.37 | 9.51 | 0.00047576 | 4.75 | 6:14:00 | 11 0 15 42.3 |
|
||||||
| ETH/BTC | 33 | 0.30 | 0.00049856 | 4.98 | 7:31:00 | 16 0 17 48.5 |
|
| ETH/BTC | 33 | 0.30 | 9.96 | 0.00049856 | 4.98 | 7:31:00 | 16 0 17 48.5 |
|
||||||
| IOTA/BTC | 32 | 0.03 | 0.00005444 | 0.54 | 3:12:00 | 14 0 18 43.8 |
|
| IOTA/BTC | 32 | 0.03 | 1.09 | 0.00005444 | 0.54 | 3:12:00 | 14 0 18 43.8 |
|
||||||
| LSK/BTC | 15 | 1.75 | 0.00131413 | 13.13 | 2:58:00 | 6 0 9 40.0 |
|
| LSK/BTC | 15 | 1.75 | 26.26 | 0.00131413 | 13.13 | 2:58:00 | 6 0 9 40.0 |
|
||||||
| LTC/BTC | 32 | -0.04 | -0.00006886 | -0.69 | 4:49:00 | 11 0 21 34.4 |
|
| LTC/BTC | 32 | -0.04 | -1.38 | -0.00006886 | -0.69 | 4:49:00 | 11 0 21 34.4 |
|
||||||
| NANO/BTC | 17 | 1.26 | 0.00107058 | 10.70 | 1:55:00 | 10 0 7 58.5 |
|
| NANO/BTC | 17 | 1.26 | 21.39 | 0.00107058 | 10.70 | 1:55:00 | 10 0 7 58.5 |
|
||||||
| NEO/BTC | 23 | 0.82 | 0.00094936 | 9.48 | 2:59:00 | 10 0 13 43.5 |
|
| NEO/BTC | 23 | 0.82 | 18.97 | 0.00094936 | 9.48 | 2:59:00 | 10 0 13 43.5 |
|
||||||
| REQ/BTC | 9 | 1.17 | 0.00052734 | 5.27 | 3:47:00 | 4 0 5 44.4 |
|
| REQ/BTC | 9 | 1.17 | 10.54 | 0.00052734 | 5.27 | 3:47:00 | 4 0 5 44.4 |
|
||||||
| XLM/BTC | 16 | 1.22 | 0.00097800 | 9.77 | 3:15:00 | 7 0 9 43.8 |
|
| XLM/BTC | 16 | 1.22 | 19.54 | 0.00097800 | 9.77 | 3:15:00 | 7 0 9 43.8 |
|
||||||
| XMR/BTC | 23 | -0.18 | -0.00020696 | -2.07 | 5:30:00 | 12 0 11 52.2 |
|
| XMR/BTC | 23 | -0.18 | -4.13 | -0.00020696 | -2.07 | 5:30:00 | 12 0 11 52.2 |
|
||||||
| XRP/BTC | 35 | 0.66 | 0.00114897 | 11.48 | 3:49:00 | 12 0 23 34.3 |
|
| XRP/BTC | 35 | 0.66 | 22.96 | 0.00114897 | 11.48 | 3:49:00 | 12 0 23 34.3 |
|
||||||
| ZEC/BTC | 22 | -0.46 | -0.00050971 | -5.09 | 2:22:00 | 7 0 15 31.8 |
|
| ZEC/BTC | 22 | -0.46 | -10.18 | -0.00050971 | -5.09 | 2:22:00 | 7 0 15 31.8 |
|
||||||
| TOTAL | 429 | 0.36 | 0.00762792 | 76.20 | 4:12:00 | 186 0 243 43.4 |
|
| TOTAL | 429 | 0.36 | 152.41 | 0.00762792 | 76.20 | 4:12:00 | 186 0 243 43.4 |
|
||||||
============================================= LEFT OPEN TRADES REPORT =============================================
|
========================================================= EXIT REASON STATS ==========================================================
|
||||||
| Pair | Trades | Avg Profit % | Tot Profit BTC | Tot Profit % | Avg Duration | Win Draw Loss Win% |
|
|
||||||
|----------+---------+----------------+------------------+----------------+----------------+---------------------|
|
|
||||||
| ADA/BTC | 1 | 0.89 | 0.00004434 | 0.44 | 6:00:00 | 1 0 0 100 |
|
|
||||||
| LTC/BTC | 1 | 0.68 | 0.00003421 | 0.34 | 2:00:00 | 1 0 0 100 |
|
|
||||||
| TOTAL | 2 | 0.78 | 0.00007855 | 0.78 | 4:00:00 | 2 0 0 100 |
|
|
||||||
==================== EXIT REASON STATS ====================
|
|
||||||
| Exit Reason | Exits | Wins | Draws | Losses |
|
| Exit Reason | Exits | Wins | Draws | Losses |
|
||||||
|--------------------+---------+-------+--------+---------|
|
|:-------------------|--------:|------:|-------:|--------:|
|
||||||
| trailing_stop_loss | 205 | 150 | 0 | 55 |
|
| trailing_stop_loss | 205 | 150 | 0 | 55 |
|
||||||
| stop_loss | 166 | 0 | 0 | 166 |
|
| stop_loss | 166 | 0 | 0 | 166 |
|
||||||
| exit_signal | 56 | 36 | 0 | 20 |
|
| exit_signal | 56 | 36 | 0 | 20 |
|
||||||
| force_exit | 2 | 0 | 0 | 2 |
|
| force_exit | 2 | 0 | 0 | 2 |
|
||||||
|
====================================================== LEFT OPEN TRADES REPORT ======================================================
|
||||||
|
| Pair | Entries | Avg Profit % | Cum Profit % | Tot Profit BTC | Tot Profit % | Avg Duration | Win Draw Loss Win% |
|
||||||
|
|:---------|---------:|---------------:|---------------:|-----------------:|---------------:|:---------------|--------------------:|
|
||||||
|
| ADA/BTC | 1 | 0.89 | 0.89 | 0.00004434 | 0.44 | 6:00:00 | 1 0 0 100 |
|
||||||
|
| LTC/BTC | 1 | 0.68 | 0.68 | 0.00003421 | 0.34 | 2:00:00 | 1 0 0 100 |
|
||||||
|
| TOTAL | 2 | 0.78 | 1.57 | 0.00007855 | 0.78 | 4:00:00 | 2 0 0 100 |
|
||||||
================== SUMMARY METRICS ==================
|
================== SUMMARY METRICS ==================
|
||||||
| Metric | Value |
|
| Metric | Value |
|
||||||
|-----------------------------+---------------------|
|
|-----------------------------+---------------------|
|
||||||
| Backtesting from | 2019-01-01 00:00:00 |
|
| Backtesting from | 2019-01-01 00:00:00 |
|
||||||
| Backtesting to | 2019-05-01 00:00:00 |
|
| Backtesting to | 2019-05-01 00:00:00 |
|
||||||
| Trading Mode | Spot |
|
|
||||||
| Max open trades | 3 |
|
| Max open trades | 3 |
|
||||||
| | |
|
| | |
|
||||||
| Total/Daily Avg Trades | 429 / 3.575 |
|
| Total/Daily Avg Trades | 429 / 3.575 |
|
||||||
@@ -208,12 +300,7 @@ A backtesting result will look like that:
|
|||||||
| Absolute profit | 0.00762792 BTC |
|
| Absolute profit | 0.00762792 BTC |
|
||||||
| Total profit % | 76.2% |
|
| Total profit % | 76.2% |
|
||||||
| CAGR % | 460.87% |
|
| CAGR % | 460.87% |
|
||||||
| Sortino | 1.88 |
|
|
||||||
| Sharpe | 2.97 |
|
|
||||||
| Calmar | 6.29 |
|
|
||||||
| SQN | 2.45 |
|
|
||||||
| Profit factor | 1.11 |
|
| Profit factor | 1.11 |
|
||||||
| Expectancy (Ratio) | -0.15 (-0.05) |
|
|
||||||
| Avg. stake amount | 0.001 BTC |
|
| Avg. stake amount | 0.001 BTC |
|
||||||
| Total trade volume | 0.429 BTC |
|
| Total trade volume | 0.429 BTC |
|
||||||
| | |
|
| | |
|
||||||
@@ -232,7 +319,6 @@ A backtesting result will look like that:
|
|||||||
| Days win/draw/lose | 12 / 82 / 25 |
|
| Days win/draw/lose | 12 / 82 / 25 |
|
||||||
| Avg. Duration Winners | 4:23:00 |
|
| Avg. Duration Winners | 4:23:00 |
|
||||||
| Avg. Duration Loser | 6:55:00 |
|
| Avg. Duration Loser | 6:55:00 |
|
||||||
| Max Consecutive Wins / Loss | 3 / 4 |
|
|
||||||
| Rejected Entry signals | 3089 |
|
| Rejected Entry signals | 3089 |
|
||||||
| Entry/Exit Timeouts | 0 / 0 |
|
| Entry/Exit Timeouts | 0 / 0 |
|
||||||
| Canceled Trade Entries | 34 |
|
| Canceled Trade Entries | 34 |
|
||||||
@@ -266,7 +352,7 @@ here:
|
|||||||
The bot has made `429` trades for an average duration of `4:12:00`, with a performance of `76.20%` (profit), that means it has
|
The bot has made `429` trades for an average duration of `4:12:00`, with a performance of `76.20%` (profit), that means it has
|
||||||
earned a total of `0.00762792 BTC` starting with a capital of 0.01 BTC.
|
earned a total of `0.00762792 BTC` starting with a capital of 0.01 BTC.
|
||||||
|
|
||||||
The column `Avg Profit %` shows the average profit for all trades made.
|
The column `Avg Profit %` shows the average profit for all trades made while the column `Cum Profit %` sums up all the profits/losses.
|
||||||
The column `Tot Profit %` shows instead the total profit % in relation to the starting balance.
|
The column `Tot Profit %` shows instead the total profit % in relation to the starting balance.
|
||||||
In the above results, we have a starting balance of 0.01 BTC and an absolute profit of 0.00762792 BTC - so the `Tot Profit %` will be `(0.00762792 / 0.01) * 100 ~= 76.2%`.
|
In the above results, we have a starting balance of 0.01 BTC and an absolute profit of 0.00762792 BTC - so the `Tot Profit %` will be `(0.00762792 / 0.01) * 100 ~= 76.2%`.
|
||||||
|
|
||||||
@@ -306,7 +392,6 @@ It contains some useful key metrics about performance of your strategy on backte
|
|||||||
|-----------------------------+---------------------|
|
|-----------------------------+---------------------|
|
||||||
| Backtesting from | 2019-01-01 00:00:00 |
|
| Backtesting from | 2019-01-01 00:00:00 |
|
||||||
| Backtesting to | 2019-05-01 00:00:00 |
|
| Backtesting to | 2019-05-01 00:00:00 |
|
||||||
| Trading Mode | Spot |
|
|
||||||
| Max open trades | 3 |
|
| Max open trades | 3 |
|
||||||
| | |
|
| | |
|
||||||
| Total/Daily Avg Trades | 429 / 3.575 |
|
| Total/Daily Avg Trades | 429 / 3.575 |
|
||||||
@@ -315,12 +400,7 @@ It contains some useful key metrics about performance of your strategy on backte
|
|||||||
| Absolute profit | 0.00762792 BTC |
|
| Absolute profit | 0.00762792 BTC |
|
||||||
| Total profit % | 76.2% |
|
| Total profit % | 76.2% |
|
||||||
| CAGR % | 460.87% |
|
| CAGR % | 460.87% |
|
||||||
| Sortino | 1.88 |
|
|
||||||
| Sharpe | 2.97 |
|
|
||||||
| Calmar | 6.29 |
|
|
||||||
| SQN | 2.45 |
|
|
||||||
| Profit factor | 1.11 |
|
| Profit factor | 1.11 |
|
||||||
| Expectancy (Ratio) | -0.15 (-0.05) |
|
|
||||||
| Avg. stake amount | 0.001 BTC |
|
| Avg. stake amount | 0.001 BTC |
|
||||||
| Total trade volume | 0.429 BTC |
|
| Total trade volume | 0.429 BTC |
|
||||||
| | |
|
| | |
|
||||||
@@ -339,7 +419,6 @@ It contains some useful key metrics about performance of your strategy on backte
|
|||||||
| Days win/draw/lose | 12 / 82 / 25 |
|
| Days win/draw/lose | 12 / 82 / 25 |
|
||||||
| Avg. Duration Winners | 4:23:00 |
|
| Avg. Duration Winners | 4:23:00 |
|
||||||
| Avg. Duration Loser | 6:55:00 |
|
| Avg. Duration Loser | 6:55:00 |
|
||||||
| Max Consecutive Wins / Loss | 3 / 4 |
|
|
||||||
| Rejected Entry signals | 3089 |
|
| Rejected Entry signals | 3089 |
|
||||||
| Entry/Exit Timeouts | 0 / 0 |
|
| Entry/Exit Timeouts | 0 / 0 |
|
||||||
| Canceled Trade Entries | 34 |
|
| Canceled Trade Entries | 34 |
|
||||||
@@ -362,26 +441,20 @@ It contains some useful key metrics about performance of your strategy on backte
|
|||||||
|
|
||||||
- `Backtesting from` / `Backtesting to`: Backtesting range (usually defined with the `--timerange` option).
|
- `Backtesting from` / `Backtesting to`: Backtesting range (usually defined with the `--timerange` option).
|
||||||
- `Max open trades`: Setting of `max_open_trades` (or `--max-open-trades`) - or number of pairs in the pairlist (whatever is lower).
|
- `Max open trades`: Setting of `max_open_trades` (or `--max-open-trades`) - or number of pairs in the pairlist (whatever is lower).
|
||||||
- `Trading Mode`: Spot or Futures trading.
|
|
||||||
- `Total/Daily Avg Trades`: Identical to the total trades of the backtest output table / Total trades divided by the backtesting duration in days (this will give you information about how many trades to expect from the strategy).
|
- `Total/Daily Avg Trades`: Identical to the total trades of the backtest output table / Total trades divided by the backtesting duration in days (this will give you information about how many trades to expect from the strategy).
|
||||||
- `Starting balance`: Start balance - as given by dry-run-wallet (config or command line).
|
- `Starting balance`: Start balance - as given by dry-run-wallet (config or command line).
|
||||||
- `Final balance`: Final balance - starting balance + absolute profit.
|
- `Final balance`: Final balance - starting balance + absolute profit.
|
||||||
- `Absolute profit`: Profit made in stake currency.
|
- `Absolute profit`: Profit made in stake currency.
|
||||||
- `Total profit %`: Total profit. Aligned to the `TOTAL` row's `Tot Profit %` from the first table. Calculated as `(End capital − Starting capital) / Starting capital`.
|
- `Total profit %`: Total profit. Aligned to the `TOTAL` row's `Tot Profit %` from the first table. Calculated as `(End capital − Starting capital) / Starting capital`.
|
||||||
- `CAGR %`: Compound annual growth rate.
|
- `CAGR %`: Compound annual growth rate.
|
||||||
- `Sortino`: Annualized Sortino ratio.
|
|
||||||
- `Sharpe`: Annualized Sharpe ratio.
|
|
||||||
- `Calmar`: Annualized Calmar ratio.
|
|
||||||
- `SQN`: System Quality Number (SQN) - by Van Tharp.
|
|
||||||
- `Profit factor`: profit / loss.
|
- `Profit factor`: profit / loss.
|
||||||
- `Avg. stake amount`: Average stake amount, either `stake_amount` or the average when using dynamic stake amount.
|
- `Avg. stake amount`: Average stake amount, either `stake_amount` or the average when using dynamic stake amount.
|
||||||
- `Total trade volume`: Volume generated on the exchange to reach the above profit.
|
- `Total trade volume`: Volume generated on the exchange to reach the above profit.
|
||||||
- `Best Pair` / `Worst Pair`: Best and worst performing pair, and it's corresponding `Tot Profit %`.
|
- `Best Pair` / `Worst Pair`: Best and worst performing pair, and it's corresponding `Cum Profit %`.
|
||||||
- `Best Trade` / `Worst Trade`: Biggest single winning trade and biggest single losing trade.
|
- `Best Trade` / `Worst Trade`: Biggest single winning trade and biggest single losing trade.
|
||||||
- `Best day` / `Worst day`: Best and worst day based on daily profit.
|
- `Best day` / `Worst day`: Best and worst day based on daily profit.
|
||||||
- `Days win/draw/lose`: Winning / Losing days (draws are usually days without closed trade).
|
- `Days win/draw/lose`: Winning / Losing days (draws are usually days without closed trade).
|
||||||
- `Avg. Duration Winners` / `Avg. Duration Loser`: Average durations for winning and losing trades.
|
- `Avg. Duration Winners` / `Avg. Duration Loser`: Average durations for winning and losing trades.
|
||||||
- `Max Consecutive Wins / Loss`: Maximum consecutive wins/losses in a row.
|
|
||||||
- `Rejected Entry signals`: Trade entry signals that could not be acted upon due to `max_open_trades` being reached.
|
- `Rejected Entry signals`: Trade entry signals that could not be acted upon due to `max_open_trades` being reached.
|
||||||
- `Entry/Exit Timeouts`: Entry/exit orders which did not fill (only applicable if custom pricing is used).
|
- `Entry/Exit Timeouts`: Entry/exit orders which did not fill (only applicable if custom pricing is used).
|
||||||
- `Canceled Trade Entries`: Number of trades that have been canceled by user request via `adjust_entry_price`.
|
- `Canceled Trade Entries`: Number of trades that have been canceled by user request via `adjust_entry_price`.
|
||||||
@@ -434,48 +507,28 @@ To save time, by default backtest will reuse a cached result from within the las
|
|||||||
|
|
||||||
### Further backtest-result analysis
|
### Further backtest-result analysis
|
||||||
|
|
||||||
To further analyze your backtest results, freqtrade will export the trades to file by default.
|
To further analyze your backtest results, you can [export the trades](#exporting-trades-to-file).
|
||||||
You can then load the trades to perform further analysis as shown in the [data analysis](strategy_analysis_example.md#load-backtest-results-to-pandas-dataframe) backtesting section.
|
You can then load the trades to perform further analysis as shown in the [data analysis](data-analysis.md#backtesting) backtesting section.
|
||||||
|
|
||||||
Also, you can use freqtrade in [webserver mode](freq-ui.md#backtesting) to visualize the backtest results in a web interface.
|
|
||||||
This mode also allows you to load existing backtest results, so you can analyze them without running the backtest again.
|
|
||||||
For this mode - `--notes "<notes>"` can be used to add notes to the backtest results, which will be shown in the web interface.
|
|
||||||
|
|
||||||
### Backtest output file
|
|
||||||
|
|
||||||
The output file freqtrade produces is a zip file containing the following files:
|
|
||||||
|
|
||||||
- The backtest report in json format
|
|
||||||
- the market change data in feather format
|
|
||||||
- a copy of the strategy file
|
|
||||||
- a copy of the strategy parameters (if a parameter file was used)
|
|
||||||
- a sanitized copy of the config file
|
|
||||||
|
|
||||||
This will ensure results are reproducible - under the assumption that the same data is available.
|
|
||||||
|
|
||||||
Only the strategy file and the config file are included in the zip file, eventual dependencies are not included.
|
|
||||||
|
|
||||||
## Assumptions made by backtesting
|
## Assumptions made by backtesting
|
||||||
|
|
||||||
Since backtesting lacks some detailed information about what happens within a candle, it needs to take a few assumptions:
|
Since backtesting lacks some detailed information about what happens within a candle, it needs to take a few assumptions:
|
||||||
|
|
||||||
- Exchange [trading limits](#trading-limits-in-backtesting) are respected
|
- Exchange [trading limits](#trading-limits-in-backtesting) are respected
|
||||||
- Entries happen at open-price unless a custom price logic has been specified
|
- Entries happen at open-price
|
||||||
- All orders are filled at the requested price (no slippage) as long as the price is within the candle's high/low range
|
- All orders are filled at the requested price (no slippage, no unfilled orders)
|
||||||
- Exit-signal exits happen at open-price of the consecutive candle
|
- Exit-signal exits happen at open-price of the consecutive candle
|
||||||
- Exits free their trade slot for a new trade with a different pair
|
|
||||||
- Exit-signal is favored over Stoploss, because exit-signals are assumed to trigger on candle's open
|
- Exit-signal is favored over Stoploss, because exit-signals are assumed to trigger on candle's open
|
||||||
- ROI
|
- ROI
|
||||||
- Exits are compared to high - but the ROI value is used (e.g. ROI = 2%, high=5% - so the exit will be at 2%)
|
- exits are compared to high - but the ROI value is used (e.g. ROI = 2%, high=5% - so the exit will be at 2%)
|
||||||
- Exits are never "below the candle", so a ROI of 2% may result in a exit at 2.4% if low was at 2.4% profit
|
- exits are never "below the candle", so a ROI of 2% may result in a exit at 2.4% if low was at 2.4% profit
|
||||||
- ROI entries which came into effect on the triggering candle (e.g. `120: 0.02` for 1h candles, from `60: 0.05`) will use the candle's open as exit rate
|
- Forceexits caused by `<N>=-1` ROI entries use low as exit value, unless N falls on the candle open (e.g. `120: -1` for 1h candles)
|
||||||
- Force-exits caused by `<N>=-1` ROI entries use low as exit value, unless N falls on the candle open (e.g. `120: -1` for 1h candles)
|
|
||||||
- Stoploss exits happen exactly at stoploss price, even if low was lower, but the loss will be `2 * fees` higher than the stoploss price
|
- Stoploss exits happen exactly at stoploss price, even if low was lower, but the loss will be `2 * fees` higher than the stoploss price
|
||||||
- Stoploss is evaluated before ROI within one candle. So you can often see more trades with the `stoploss` exit reason comparing to the results obtained with the same strategy in the Dry Run/Live Trade modes
|
- Stoploss is evaluated before ROI within one candle. So you can often see more trades with the `stoploss` exit reason comparing to the results obtained with the same strategy in the Dry Run/Live Trade modes
|
||||||
- Low happens before high for stoploss, protecting capital first
|
- Low happens before high for stoploss, protecting capital first
|
||||||
- Trailing stoploss
|
- Trailing stoploss
|
||||||
- Trailing Stoploss is only adjusted if it's below the candle's low (otherwise it would be triggered)
|
- Trailing Stoploss is only adjusted if it's below the candle's low (otherwise it would be triggered)
|
||||||
- On trade entry candles that trigger trailing stoploss, the "minimum offset" (`stop_positive_offset`) is assumed (instead of high) - and the stop is calculated from this point. This rule is NOT applicable to custom-stoploss scenarios, since there's no information about the stoploss logic available.
|
- On trade entry candles that trigger trailing stoploss, the "minimum offset" (`stop_positive_offset`) is assumed (instead of high) - and the stop is calculated from this point
|
||||||
- High happens first - adjusting stoploss
|
- High happens first - adjusting stoploss
|
||||||
- Low uses the adjusted stoploss (so exits with large high-low difference are backtested correctly)
|
- Low uses the adjusted stoploss (so exits with large high-low difference are backtested correctly)
|
||||||
- ROI applies before trailing-stop, ensuring profits are "top-capped" at ROI if both ROI and trailing stop applies
|
- ROI applies before trailing-stop, ensuring profits are "top-capped" at ROI if both ROI and trailing stop applies
|
||||||
@@ -485,7 +538,6 @@ Since backtesting lacks some detailed information about what happens within a ca
|
|||||||
- Stoploss
|
- Stoploss
|
||||||
- ROI
|
- ROI
|
||||||
- Trailing stoploss
|
- Trailing stoploss
|
||||||
- Position reversals (futures only) happen if an entry signal in the other direction than the closing trade triggers at the candle the existing trade closes.
|
|
||||||
|
|
||||||
Taking these assumptions, backtesting tries to mirror real trading as closely as possible. However, backtesting will **never** replace running a strategy in dry-run mode.
|
Taking these assumptions, backtesting tries to mirror real trading as closely as possible. However, backtesting will **never** replace running a strategy in dry-run mode.
|
||||||
Also, keep in mind that past results don't guarantee future success.
|
Also, keep in mind that past results don't guarantee future success.
|
||||||
@@ -494,13 +546,13 @@ In addition to the above assumptions, strategy authors should carefully read the
|
|||||||
|
|
||||||
### Trading limits in backtesting
|
### Trading limits in backtesting
|
||||||
|
|
||||||
Exchanges have certain trading limits, like minimum (and maximum) base currency, or minimum/maximum stake (quote) currency.
|
Exchanges have certain trading limits, like minimum base currency, or minimum stake (quote) currency.
|
||||||
These limits are usually listed in the exchange documentation as "trading rules" or similar and can be quite different between different pairs.
|
These limits are usually listed in the exchange documentation as "trading rules" or similar.
|
||||||
|
|
||||||
Backtesting (as well as live and dry-run) does honor these limits, and will ensure that a stoploss can be placed below this value - so the value will be slightly higher than what the exchange specifies.
|
Backtesting (as well as live and dry-run) does honor these limits, and will ensure that a stoploss can be placed below this value - so the value will be slightly higher than what the exchange specifies.
|
||||||
Freqtrade has however no information about historic limits.
|
Freqtrade has however no information about historic limits.
|
||||||
|
|
||||||
This can lead to situations where trading-limits are inflated by using a historic price, resulting in minimum amounts > 50\$.
|
This can lead to situations where trading-limits are inflated by using a historic price, resulting in minimum amounts > 50$.
|
||||||
|
|
||||||
For example:
|
For example:
|
||||||
|
|
||||||
@@ -519,7 +571,7 @@ These precision values are based on current exchange limits (as described in the
|
|||||||
|
|
||||||
## Improved backtest accuracy
|
## Improved backtest accuracy
|
||||||
|
|
||||||
One big limitation of backtesting is it's inability to know how prices moved intra-candle (was high before close, or vice-versa?).
|
One big limitation of backtesting is it's inability to know how prices moved intra-candle (was high before close, or viceversa?).
|
||||||
So assuming you run backtesting with a 1h timeframe, there will be 4 prices for that candle (Open, High, Low, Close).
|
So assuming you run backtesting with a 1h timeframe, there will be 4 prices for that candle (Open, High, Low, Close).
|
||||||
|
|
||||||
While backtesting does take some assumptions (read above) about this - this can never be perfect, and will always be biased in one way or the other.
|
While backtesting does take some assumptions (read above) about this - this can never be perfect, and will always be biased in one way or the other.
|
||||||
@@ -531,13 +583,7 @@ To utilize this, you can append `--timeframe-detail 5m` to your regular backtest
|
|||||||
freqtrade backtesting --strategy AwesomeStrategy --timeframe 1h --timeframe-detail 5m
|
freqtrade backtesting --strategy AwesomeStrategy --timeframe 1h --timeframe-detail 5m
|
||||||
```
|
```
|
||||||
|
|
||||||
This will load 1h data (the main timeframe) as well as 5m data (detail timeframe) for the selected timerange.
|
This will load 1h data as well as 5m data for the timeframe. The strategy will be analyzed with the 1h timeframe - and for every "open trade candle" (candles where a trade is open) the 5m data will be used to simulate intra-candle movements.
|
||||||
The strategy will be analyzed with the 1h timeframe.
|
|
||||||
Candles where activity may take place (there's an active signal, the pair is in a trade) are evaluated at the 5m timeframe.
|
|
||||||
This will allow for a more accurate simulation of intra-candle movements - and can lead to different results, especially on higher timeframes.
|
|
||||||
|
|
||||||
Entries will generally still happen at the main candle's open, however freed trade slots may be freed earlier (if the exit signal is triggered on the 5m candle), which can then be used for a new trade of a different pair.
|
|
||||||
|
|
||||||
All callback functions (`custom_exit()`, `custom_stoploss()`, ... ) will be running for each 5m candle once the trade is opened (so 12 times in the above example of 1h timeframe, and 5m detailed timeframe).
|
All callback functions (`custom_exit()`, `custom_stoploss()`, ... ) will be running for each 5m candle once the trade is opened (so 12 times in the above example of 1h timeframe, and 5m detailed timeframe).
|
||||||
|
|
||||||
`--timeframe-detail` must be smaller than the original timeframe, otherwise backtesting will fail to start.
|
`--timeframe-detail` must be smaller than the original timeframe, otherwise backtesting will fail to start.
|
||||||
@@ -548,27 +594,6 @@ Also, data must be available / downloaded already.
|
|||||||
!!! Tip
|
!!! Tip
|
||||||
You can use this function as the last part of strategy development, to ensure your strategy is not exploiting one of the [backtesting assumptions](#assumptions-made-by-backtesting). Strategies that perform similarly well with this mode have a good chance to perform well in dry/live modes too (although only forward-testing (dry-mode) can really confirm a strategy).
|
You can use this function as the last part of strategy development, to ensure your strategy is not exploiting one of the [backtesting assumptions](#assumptions-made-by-backtesting). Strategies that perform similarly well with this mode have a good chance to perform well in dry/live modes too (although only forward-testing (dry-mode) can really confirm a strategy).
|
||||||
|
|
||||||
??? Sample "Extreme Difference Example"
|
|
||||||
Using `--timeframe-detail` on an extreme example (all below pairs have the 10:00 candle with an entry signal) may lead to the following backtesting Trade sequence with 1 max_open_trades:
|
|
||||||
|
|
||||||
| Pair | Entry Time | Exit Time | Duration |
|
|
||||||
|------|------------|-----------| -------- |
|
|
||||||
| BTC/USDT | 2024-01-01 10:00:00 | 2021-01-01 10:05:00 | 5m |
|
|
||||||
| ETH/USDT | 2024-01-01 10:05:00 | 2021-01-01 10:15:00 | 10m |
|
|
||||||
| XRP/USDT | 2024-01-01 10:15:00 | 2021-01-01 10:30:00 | 15m |
|
|
||||||
| SOL/USDT | 2024-01-01 10:15:00 | 2021-01-01 11:05:00 | 50m |
|
|
||||||
| BTC/USDT | 2024-01-01 11:05:00 | 2021-01-01 12:00:00 | 55m |
|
|
||||||
|
|
||||||
Without timeframe-detail, this would look like:
|
|
||||||
|
|
||||||
| Pair | Entry Time | Exit Time | Duration |
|
|
||||||
|------|------------|-----------| -------- |
|
|
||||||
| BTC/USDT | 2024-01-01 10:00:00 | 2021-01-01 11:00:00 | 1h |
|
|
||||||
| BTC/USDT | 2024-01-01 11:00:00 | 2021-01-01 12:00:00 | 1h |
|
|
||||||
|
|
||||||
The difference is significant, as without detail data, only the first `max_open_trades` signals per candle are evaluated, and the trade slots are only freed at the end of the candle, allowing for a new trade to be opened at the next candle.
|
|
||||||
|
|
||||||
|
|
||||||
## Backtesting multiple strategies
|
## Backtesting multiple strategies
|
||||||
|
|
||||||
To compare multiple strategies, a list of Strategies can be provided to backtesting.
|
To compare multiple strategies, a list of Strategies can be provided to backtesting.
|
||||||
@@ -576,22 +601,22 @@ To compare multiple strategies, a list of Strategies can be provided to backtest
|
|||||||
This is limited to 1 timeframe value per run. However, data is only loaded once from disk so if you have multiple
|
This is limited to 1 timeframe value per run. However, data is only loaded once from disk so if you have multiple
|
||||||
strategies you'd like to compare, this will give a nice runtime boost.
|
strategies you'd like to compare, this will give a nice runtime boost.
|
||||||
|
|
||||||
All listed Strategies need to be in the same directory, unless also `--recursive-strategy-search` is specified, where sub-directories within the strategy directory are also considered.
|
All listed Strategies need to be in the same directory.
|
||||||
|
|
||||||
``` bash
|
``` bash
|
||||||
freqtrade backtesting --timerange 20180401-20180410 --timeframe 5m --strategy-list Strategy001 Strategy002 --export trades
|
freqtrade backtesting --timerange 20180401-20180410 --timeframe 5m --strategy-list Strategy001 Strategy002 --export trades
|
||||||
```
|
```
|
||||||
|
|
||||||
This will save the results to `user_data/backtest_results/backtest-result-<datetime>.json`, including results for both `Strategy001` and `Strategy002`.
|
This will save the results to `user_data/backtest_results/backtest-result-<strategy>.json`, injecting the strategy-name into the target filename.
|
||||||
There will be an additional table comparing win/losses of the different strategies (identical to the "Total" row in the first table).
|
There will be an additional table comparing win/losses of the different strategies (identical to the "Total" row in the first table).
|
||||||
Detailed output for all strategies one after the other will be available, so make sure to scroll up to see the details per strategy.
|
Detailed output for all strategies one after the other will be available, so make sure to scroll up to see the details per strategy.
|
||||||
|
|
||||||
```
|
```
|
||||||
================================================== STRATEGY SUMMARY ===================================================================
|
=========================================================== STRATEGY SUMMARY ===========================================================================
|
||||||
| Strategy | Trades | Avg Profit % | Tot Profit BTC | Tot Profit % | Avg Duration | Wins | Draws | Losses | Drawdown % |
|
| Strategy | Entries | Avg Profit % | Cum Profit % | Tot Profit BTC | Tot Profit % | Avg Duration | Wins | Draws | Losses | Drawdown % |
|
||||||
|-------------+---------+----------------+------------------+----------------+----------------+-------+--------+--------+------------|
|
|:------------|---------:|---------------:|---------------:|-----------------:|---------------:|:---------------|------:|-------:|-------:|-----------:|
|
||||||
| Strategy1 | 429 | 0.36 | 0.00762792 | 76.20 | 4:12:00 | 186 | 0 | 243 | 45.2 |
|
| Strategy1 | 429 | 0.36 | 152.41 | 0.00762792 | 76.20 | 4:12:00 | 186 | 0 | 243 | 45.2 |
|
||||||
| Strategy2 | 1487 | -0.13 | -0.00988917 | -98.79 | 4:43:00 | 662 | 0 | 825 | 241.68 |
|
| Strategy2 | 1487 | -0.13 | -197.58 | -0.00988917 | -98.79 | 4:43:00 | 662 | 0 | 825 | 241.68 |
|
||||||
```
|
```
|
||||||
|
|
||||||
## Next step
|
## Next step
|
||||||
|
|||||||
@@ -7,32 +7,16 @@ This page provides you some basic concepts on how Freqtrade works and operates.
|
|||||||
* **Strategy**: Your trading strategy, telling the bot what to do.
|
* **Strategy**: Your trading strategy, telling the bot what to do.
|
||||||
* **Trade**: Open position.
|
* **Trade**: Open position.
|
||||||
* **Open Order**: Order which is currently placed on the exchange, and is not yet complete.
|
* **Open Order**: Order which is currently placed on the exchange, and is not yet complete.
|
||||||
* **Pair**: Tradable pair, usually in the format of Base/Quote (e.g. `XRP/USDT` for spot, `XRP/USDT:USDT` for futures).
|
* **Pair**: Tradable pair, usually in the format of Base/Quote (e.g. XRP/USDT).
|
||||||
* **Timeframe**: Candle length to use (e.g. `"5m"`, `"1h"`, ...).
|
* **Timeframe**: Candle length to use (e.g. `"5m"`, `"1h"`, ...).
|
||||||
* **Indicators**: Technical indicators (SMA, EMA, RSI, ...).
|
* **Indicators**: Technical indicators (SMA, EMA, RSI, ...).
|
||||||
* **Limit order**: Limit orders which execute at the defined limit price or better.
|
* **Limit order**: Limit orders which execute at the defined limit price or better.
|
||||||
* **Market order**: Guaranteed to fill, may move price depending on the order size.
|
* **Market order**: Guaranteed to fill, may move price depending on the order size.
|
||||||
* **Current Profit**: Currently pending (unrealized) profit for this trade. This is mainly used throughout the bot and UI.
|
|
||||||
* **Realized Profit**: Already realized profit. Only relevant in combination with [partial exits](strategy-callbacks.md#adjust-trade-position) - which also explains the calculation logic for this.
|
|
||||||
* **Total Profit**: Combined realized and unrealized profit. The relative number (%) is calculated against the total investment in this trade.
|
|
||||||
|
|
||||||
## Fee handling
|
## Fee handling
|
||||||
|
|
||||||
All profit calculations of Freqtrade include fees. For Backtesting / Hyperopt / Dry-run modes, the exchange default fee is used (lowest tier on the exchange). For live operations, fees are used as applied by the exchange (this includes BNB rebates etc.).
|
All profit calculations of Freqtrade include fees. For Backtesting / Hyperopt / Dry-run modes, the exchange default fee is used (lowest tier on the exchange). For live operations, fees are used as applied by the exchange (this includes BNB rebates etc.).
|
||||||
|
|
||||||
## Pair naming
|
|
||||||
|
|
||||||
Freqtrade follows the [ccxt naming convention](https://docs.ccxt.com/#/README?id=consistency-of-base-and-quote-currencies) for currencies.
|
|
||||||
Using the wrong naming convention in the wrong market will usually result in the bot not recognizing the pair, usually resulting in errors like "this pair is not available".
|
|
||||||
|
|
||||||
### Spot pair naming
|
|
||||||
|
|
||||||
For spot pairs, naming will be `base/quote` (e.g. `ETH/USDT`).
|
|
||||||
|
|
||||||
### Futures pair naming
|
|
||||||
|
|
||||||
For futures pairs, naming will be `base/quote:settle` (e.g. `ETH/USDT:USDT`).
|
|
||||||
|
|
||||||
## Bot execution logic
|
## Bot execution logic
|
||||||
|
|
||||||
Starting freqtrade in dry-run or live mode (using `freqtrade trade`) will start the bot and start the bot iteration loop.
|
Starting freqtrade in dry-run or live mode (using `freqtrade trade`) will start the bot and start the bot iteration loop.
|
||||||
@@ -49,18 +33,14 @@ By default, the bot loop runs every few seconds (`internals.process_throttle_sec
|
|||||||
* Call `populate_indicators()`
|
* Call `populate_indicators()`
|
||||||
* Call `populate_entry_trend()`
|
* Call `populate_entry_trend()`
|
||||||
* Call `populate_exit_trend()`
|
* Call `populate_exit_trend()`
|
||||||
* Update trades open order state from exchange.
|
* Check timeouts for open orders.
|
||||||
* Call `order_filled()` strategy callback for filled orders.
|
* Calls `check_entry_timeout()` strategy callback for open entry orders.
|
||||||
* Check timeouts for open orders.
|
* Calls `check_exit_timeout()` strategy callback for open exit orders.
|
||||||
* Calls `check_entry_timeout()` strategy callback for open entry orders.
|
* Calls `adjust_entry_price()` strategy callback for open entry orders.
|
||||||
* Calls `check_exit_timeout()` strategy callback for open exit orders.
|
|
||||||
* Calls `adjust_order_price()` strategy callback for open orders.
|
|
||||||
* Calls `adjust_entry_price()` strategy callback for open entry orders. *only called when `adjust_order_price()` is not implemented*
|
|
||||||
* Calls `adjust_exit_price()` strategy callback for open exit orders. *only called when `adjust_order_price()` is not implemented*
|
|
||||||
* Verifies existing positions and eventually places exit orders.
|
* Verifies existing positions and eventually places exit orders.
|
||||||
* Considers stoploss, ROI and exit-signal, `custom_exit()` and `custom_stoploss()`.
|
* Considers stoploss, ROI and exit-signal, `custom_exit()` and `custom_stoploss()`.
|
||||||
* Determine exit-price based on `exit_pricing` configuration setting or by using the `custom_exit_price()` callback.
|
* Determine exit-price based on `exit_pricing` configuration setting or by using the `custom_exit_price()` callback.
|
||||||
* Before an exit order is placed, `confirm_trade_exit()` strategy callback is called.
|
* Before a exit order is placed, `confirm_trade_exit()` strategy callback is called.
|
||||||
* Check position adjustments for open trades if enabled by calling `adjust_trade_position()` and place additional order if required.
|
* Check position adjustments for open trades if enabled by calling `adjust_trade_position()` and place additional order if required.
|
||||||
* Check if trade-slots are still available (if `max_open_trades` is reached).
|
* Check if trade-slots are still available (if `max_open_trades` is reached).
|
||||||
* Verifies entry signal trying to enter new positions.
|
* Verifies entry signal trying to enter new positions.
|
||||||
@@ -77,29 +57,21 @@ This loop will be repeated again and again until the bot is stopped.
|
|||||||
|
|
||||||
* Load historic data for configured pairlist.
|
* Load historic data for configured pairlist.
|
||||||
* Calls `bot_start()` once.
|
* Calls `bot_start()` once.
|
||||||
|
* Calls `bot_loop_start()` once.
|
||||||
* Calculate indicators (calls `populate_indicators()` once per pair).
|
* Calculate indicators (calls `populate_indicators()` once per pair).
|
||||||
* Calculate entry / exit signals (calls `populate_entry_trend()` and `populate_exit_trend()` once per pair).
|
* Calculate entry / exit signals (calls `populate_entry_trend()` and `populate_exit_trend()` once per pair).
|
||||||
* Loops per candle simulating entry and exit points.
|
* Loops per candle simulating entry and exit points.
|
||||||
* Calls `bot_loop_start()` strategy callback.
|
|
||||||
* Check for Order timeouts, either via the `unfilledtimeout` configuration, or via `check_entry_timeout()` / `check_exit_timeout()` strategy callbacks.
|
* Check for Order timeouts, either via the `unfilledtimeout` configuration, or via `check_entry_timeout()` / `check_exit_timeout()` strategy callbacks.
|
||||||
* Calls `adjust_order_price()` strategy callback for open orders.
|
* Calls `adjust_entry_price()` strategy callback for open entry orders.
|
||||||
* Calls `adjust_entry_price()` strategy callback for open entry orders. *only called when `adjust_order_price()` is not implemented!*
|
|
||||||
* Calls `adjust_exit_price()` strategy callback for open exit orders. *only called when `adjust_order_price()` is not implemented!*
|
|
||||||
* Check for trade entry signals (`enter_long` / `enter_short` columns).
|
* Check for trade entry signals (`enter_long` / `enter_short` columns).
|
||||||
* Confirm trade entry / exits (calls `confirm_trade_entry()` and `confirm_trade_exit()` if implemented in the strategy).
|
* Confirm trade entry / exits (calls `confirm_trade_entry()` and `confirm_trade_exit()` if implemented in the strategy).
|
||||||
* Call `custom_entry_price()` (if implemented in the strategy) to determine entry price (Prices are moved to be within the opening candle).
|
* Call `custom_entry_price()` (if implemented in the strategy) to determine entry price (Prices are moved to be within the opening candle).
|
||||||
* In Margin and Futures mode, `leverage()` strategy callback is called to determine the desired leverage.
|
* In Margin and Futures mode, `leverage()` strategy callback is called to determine the desired leverage.
|
||||||
* Determine stake size by calling the `custom_stake_amount()` callback.
|
* Determine stake size by calling the `custom_stake_amount()` callback.
|
||||||
* Check position adjustments for open trades if enabled and call `adjust_trade_position()` to determine if an additional order is requested.
|
* Check position adjustments for open trades if enabled and call `adjust_trade_position()` to determine if an additional order is requested.
|
||||||
* Call `order_filled()` strategy callback for filled entry orders.
|
|
||||||
* Call `custom_stoploss()` and `custom_exit()` to find custom exit points.
|
* Call `custom_stoploss()` and `custom_exit()` to find custom exit points.
|
||||||
* For exits based on exit-signal, custom-exit and partial exits: Call `custom_exit_price()` to determine exit price (Prices are moved to be within the closing candle).
|
* For exits based on exit-signal, custom-exit and partial exits: Call `custom_exit_price()` to determine exit price (Prices are moved to be within the closing candle).
|
||||||
* Call `order_filled()` strategy callback for filled exit orders.
|
|
||||||
* Generate backtest report output
|
* Generate backtest report output
|
||||||
|
|
||||||
!!! Note
|
!!! Note
|
||||||
Both Backtesting and Hyperopt include exchange default Fees in the calculation. Custom fees can be passed to backtesting / hyperopt by specifying the `--fee` argument.
|
Both Backtesting and Hyperopt include exchange default Fees in the calculation. Custom fees can be passed to backtesting / hyperopt by specifying the `--fee` argument.
|
||||||
|
|
||||||
!!! Warning "Callback call frequency"
|
|
||||||
Backtesting will call each callback at max. once per candle (`--timeframe-detail` modifies this behavior to once per detailed candle).
|
|
||||||
Most callbacks will be called once per iteration in live (usually every ~5s) - which can cause backtesting mismatches.
|
|
||||||
|
|||||||
@@ -3,18 +3,99 @@
|
|||||||
This page explains the different parameters of the bot and how to run it.
|
This page explains the different parameters of the bot and how to run it.
|
||||||
|
|
||||||
!!! Note
|
!!! Note
|
||||||
If you've used `setup.sh`, don't forget to activate your virtual environment (`source .venv/bin/activate`) before running freqtrade commands.
|
If you've used `setup.sh`, don't forget to activate your virtual environment (`source .env/bin/activate`) before running freqtrade commands.
|
||||||
|
|
||||||
!!! Warning "Up-to-date clock"
|
!!! Warning "Up-to-date clock"
|
||||||
The clock on the system running the bot must be accurate, synchronized to a NTP server frequently enough to avoid problems with communication to the exchanges.
|
The clock on the system running the bot must be accurate, synchronized to a NTP server frequently enough to avoid problems with communication to the exchanges.
|
||||||
|
|
||||||
## Bot commands
|
## Bot commands
|
||||||
|
|
||||||
--8<-- "commands/main.md"
|
```
|
||||||
|
usage: freqtrade [-h] [-V]
|
||||||
|
{trade,create-userdir,new-config,new-strategy,download-data,convert-data,convert-trade-data,list-data,backtesting,edge,hyperopt,hyperopt-list,hyperopt-show,list-exchanges,list-hyperopts,list-markets,list-pairs,list-strategies,list-timeframes,show-trades,test-pairlist,install-ui,plot-dataframe,plot-profit,webserver}
|
||||||
|
...
|
||||||
|
|
||||||
|
Free, open source crypto trading bot
|
||||||
|
|
||||||
|
positional arguments:
|
||||||
|
{trade,create-userdir,new-config,new-strategy,download-data,convert-data,convert-trade-data,list-data,backtesting,edge,hyperopt,hyperopt-list,hyperopt-show,list-exchanges,list-hyperopts,list-markets,list-pairs,list-strategies,list-timeframes,show-trades,test-pairlist,install-ui,plot-dataframe,plot-profit,webserver}
|
||||||
|
trade Trade module.
|
||||||
|
create-userdir Create user-data directory.
|
||||||
|
new-config Create new config
|
||||||
|
new-strategy Create new strategy
|
||||||
|
download-data Download backtesting data.
|
||||||
|
convert-data Convert candle (OHLCV) data from one format to
|
||||||
|
another.
|
||||||
|
convert-trade-data Convert trade data from one format to another.
|
||||||
|
list-data List downloaded data.
|
||||||
|
backtesting Backtesting module.
|
||||||
|
edge Edge module.
|
||||||
|
hyperopt Hyperopt module.
|
||||||
|
hyperopt-list List Hyperopt results
|
||||||
|
hyperopt-show Show details of Hyperopt results
|
||||||
|
list-exchanges Print available exchanges.
|
||||||
|
list-hyperopts Print available hyperopt classes.
|
||||||
|
list-markets Print markets on exchange.
|
||||||
|
list-pairs Print pairs on exchange.
|
||||||
|
list-strategies Print available strategies.
|
||||||
|
list-timeframes Print available timeframes for the exchange.
|
||||||
|
show-trades Show trades.
|
||||||
|
test-pairlist Test your pairlist configuration.
|
||||||
|
install-ui Install FreqUI
|
||||||
|
plot-dataframe Plot candles with indicators.
|
||||||
|
plot-profit Generate plot showing profits.
|
||||||
|
webserver Webserver module.
|
||||||
|
|
||||||
|
optional arguments:
|
||||||
|
-h, --help show this help message and exit
|
||||||
|
-V, --version show program's version number and exit
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
### Bot trading commands
|
### Bot trading commands
|
||||||
|
|
||||||
--8<-- "commands/trade.md"
|
```
|
||||||
|
usage: freqtrade trade [-h] [-v] [--logfile FILE] [-V] [-c PATH] [-d PATH]
|
||||||
|
[--userdir PATH] [-s NAME] [--strategy-path PATH]
|
||||||
|
[--db-url PATH] [--sd-notify] [--dry-run]
|
||||||
|
[--dry-run-wallet DRY_RUN_WALLET]
|
||||||
|
|
||||||
|
optional arguments:
|
||||||
|
-h, --help show this help message and exit
|
||||||
|
--db-url PATH Override trades database URL, this is useful in custom
|
||||||
|
deployments (default: `sqlite:///tradesv3.sqlite` for
|
||||||
|
Live Run mode, `sqlite:///tradesv3.dryrun.sqlite` for
|
||||||
|
Dry Run).
|
||||||
|
--sd-notify Notify systemd service manager.
|
||||||
|
--dry-run Enforce dry-run for trading (removes Exchange secrets
|
||||||
|
and simulates trades).
|
||||||
|
--dry-run-wallet DRY_RUN_WALLET, --starting-balance DRY_RUN_WALLET
|
||||||
|
Starting balance, used for backtesting / hyperopt and
|
||||||
|
dry-runs.
|
||||||
|
|
||||||
|
Common arguments:
|
||||||
|
-v, --verbose Verbose mode (-vv for more, -vvv to get all messages).
|
||||||
|
--logfile FILE Log to the file specified. Special values are:
|
||||||
|
'syslog', 'journald'. See the documentation for more
|
||||||
|
details.
|
||||||
|
-V, --version show program's version number and exit
|
||||||
|
-c PATH, --config PATH
|
||||||
|
Specify configuration file (default:
|
||||||
|
`userdir/config.json` or `config.json` whichever
|
||||||
|
exists). Multiple --config options may be used. Can be
|
||||||
|
set to `-` to read config from stdin.
|
||||||
|
-d PATH, --datadir PATH
|
||||||
|
Path to directory with historical backtesting data.
|
||||||
|
--userdir PATH, --user-data-dir PATH
|
||||||
|
Path to userdata directory.
|
||||||
|
|
||||||
|
Strategy arguments:
|
||||||
|
-s NAME, --strategy NAME
|
||||||
|
Specify strategy class name which will be used by the
|
||||||
|
bot.
|
||||||
|
--strategy-path PATH Specify additional strategy lookup path.
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
### How to specify which configuration file be used?
|
### How to specify which configuration file be used?
|
||||||
|
|
||||||
|
|||||||
@@ -1,68 +0,0 @@
|
|||||||
```
|
|
||||||
usage: freqtrade backtesting-analysis [-h] [-v] [--no-color] [--logfile FILE]
|
|
||||||
[-V] [-c PATH] [-d PATH]
|
|
||||||
[--userdir PATH]
|
|
||||||
[--export-filename PATH]
|
|
||||||
[--analysis-groups {0,1,2,3,4,5} [{0,1,2,3,4,5} ...]]
|
|
||||||
[--enter-reason-list ENTER_REASON_LIST [ENTER_REASON_LIST ...]]
|
|
||||||
[--exit-reason-list EXIT_REASON_LIST [EXIT_REASON_LIST ...]]
|
|
||||||
[--indicator-list INDICATOR_LIST [INDICATOR_LIST ...]]
|
|
||||||
[--entry-only] [--exit-only]
|
|
||||||
[--timerange TIMERANGE]
|
|
||||||
[--rejected-signals] [--analysis-to-csv]
|
|
||||||
[--analysis-csv-path ANALYSIS_CSV_PATH]
|
|
||||||
|
|
||||||
options:
|
|
||||||
-h, --help show this help message and exit
|
|
||||||
--export-filename PATH, --backtest-filename PATH
|
|
||||||
Use this filename for backtest results.Requires
|
|
||||||
`--export` to be set as well. Example: `--export-filen
|
|
||||||
ame=user_data/backtest_results/backtest_today.json`
|
|
||||||
--analysis-groups {0,1,2,3,4,5} [{0,1,2,3,4,5} ...]
|
|
||||||
grouping output - 0: simple wins/losses by enter tag,
|
|
||||||
1: by enter_tag, 2: by enter_tag and exit_tag, 3: by
|
|
||||||
pair and enter_tag, 4: by pair, enter_ and exit_tag
|
|
||||||
(this can get quite large), 5: by exit_tag
|
|
||||||
--enter-reason-list ENTER_REASON_LIST [ENTER_REASON_LIST ...]
|
|
||||||
Space separated list of entry signals to analyse.
|
|
||||||
Default: all. e.g. 'entry_tag_a entry_tag_b'
|
|
||||||
--exit-reason-list EXIT_REASON_LIST [EXIT_REASON_LIST ...]
|
|
||||||
Space separated list of exit signals to analyse.
|
|
||||||
Default: all. e.g. 'exit_tag_a roi stop_loss
|
|
||||||
trailing_stop_loss'
|
|
||||||
--indicator-list INDICATOR_LIST [INDICATOR_LIST ...]
|
|
||||||
Space separated list of indicators to analyse. e.g.
|
|
||||||
'close rsi bb_lowerband profit_abs'
|
|
||||||
--entry-only Only analyze entry signals.
|
|
||||||
--exit-only Only analyze exit signals.
|
|
||||||
--timerange TIMERANGE
|
|
||||||
Specify what timerange of data to use.
|
|
||||||
--rejected-signals Analyse rejected signals
|
|
||||||
--analysis-to-csv Save selected analysis tables to individual CSVs
|
|
||||||
--analysis-csv-path ANALYSIS_CSV_PATH
|
|
||||||
Specify a path to save the analysis CSVs if
|
|
||||||
--analysis-to-csv is enabled. Default:
|
|
||||||
user_data/basktesting_results/
|
|
||||||
|
|
||||||
Common arguments:
|
|
||||||
-v, --verbose Verbose mode (-vv for more, -vvv to get all messages).
|
|
||||||
--no-color Disable colorization of hyperopt results. May be
|
|
||||||
useful if you are redirecting output to a file.
|
|
||||||
--logfile FILE, --log-file FILE
|
|
||||||
Log to the file specified. Special values are:
|
|
||||||
'syslog', 'journald'. See the documentation for more
|
|
||||||
details.
|
|
||||||
-V, --version show program's version number and exit
|
|
||||||
-c PATH, --config PATH
|
|
||||||
Specify configuration file (default:
|
|
||||||
`userdir/config.json` or `config.json` whichever
|
|
||||||
exists). Multiple --config options may be used. Can be
|
|
||||||
set to `-` to read config from stdin.
|
|
||||||
-d PATH, --datadir PATH, --data-dir PATH
|
|
||||||
Path to the base directory of the exchange with
|
|
||||||
historical backtesting data. To see futures data, use
|
|
||||||
trading-mode additionally.
|
|
||||||
--userdir PATH, --user-data-dir PATH
|
|
||||||
Path to userdata directory.
|
|
||||||
|
|
||||||
```
|
|
||||||
@@ -1,39 +0,0 @@
|
|||||||
```
|
|
||||||
usage: freqtrade backtesting-show [-h] [-v] [--no-color] [--logfile FILE] [-V]
|
|
||||||
[-c PATH] [-d PATH] [--userdir PATH]
|
|
||||||
[--export-filename PATH] [--show-pair-list]
|
|
||||||
[--breakdown {day,week,month,year} [{day,week,month,year} ...]]
|
|
||||||
|
|
||||||
options:
|
|
||||||
-h, --help show this help message and exit
|
|
||||||
--export-filename PATH, --backtest-filename PATH
|
|
||||||
Use this filename for backtest results.Requires
|
|
||||||
`--export` to be set as well. Example: `--export-filen
|
|
||||||
ame=user_data/backtest_results/backtest_today.json`
|
|
||||||
--show-pair-list Show backtesting pairlist sorted by profit.
|
|
||||||
--breakdown {day,week,month,year} [{day,week,month,year} ...]
|
|
||||||
Show backtesting breakdown per [day, week, month,
|
|
||||||
year].
|
|
||||||
|
|
||||||
Common arguments:
|
|
||||||
-v, --verbose Verbose mode (-vv for more, -vvv to get all messages).
|
|
||||||
--no-color Disable colorization of hyperopt results. May be
|
|
||||||
useful if you are redirecting output to a file.
|
|
||||||
--logfile FILE, --log-file FILE
|
|
||||||
Log to the file specified. Special values are:
|
|
||||||
'syslog', 'journald'. See the documentation for more
|
|
||||||
details.
|
|
||||||
-V, --version show program's version number and exit
|
|
||||||
-c PATH, --config PATH
|
|
||||||
Specify configuration file (default:
|
|
||||||
`userdir/config.json` or `config.json` whichever
|
|
||||||
exists). Multiple --config options may be used. Can be
|
|
||||||
set to `-` to read config from stdin.
|
|
||||||
-d PATH, --datadir PATH, --data-dir PATH
|
|
||||||
Path to the base directory of the exchange with
|
|
||||||
historical backtesting data. To see futures data, use
|
|
||||||
trading-mode additionally.
|
|
||||||
--userdir PATH, --user-data-dir PATH
|
|
||||||
Path to userdata directory.
|
|
||||||
|
|
||||||
```
|
|
||||||
@@ -1,111 +0,0 @@
|
|||||||
```
|
|
||||||
usage: freqtrade backtesting [-h] [-v] [--no-color] [--logfile FILE] [-V]
|
|
||||||
[-c PATH] [-d PATH] [--userdir PATH] [-s NAME]
|
|
||||||
[--strategy-path PATH]
|
|
||||||
[--recursive-strategy-search]
|
|
||||||
[--freqaimodel NAME] [--freqaimodel-path PATH]
|
|
||||||
[-i TIMEFRAME] [--timerange TIMERANGE]
|
|
||||||
[--data-format-ohlcv {json,jsongz,feather,parquet}]
|
|
||||||
[--max-open-trades INT]
|
|
||||||
[--stake-amount STAKE_AMOUNT] [--fee FLOAT]
|
|
||||||
[-p PAIRS [PAIRS ...]] [--eps]
|
|
||||||
[--enable-protections]
|
|
||||||
[--dry-run-wallet DRY_RUN_WALLET]
|
|
||||||
[--timeframe-detail TIMEFRAME_DETAIL]
|
|
||||||
[--strategy-list STRATEGY_LIST [STRATEGY_LIST ...]]
|
|
||||||
[--export {none,trades,signals}]
|
|
||||||
[--export-filename PATH]
|
|
||||||
[--breakdown {day,week,month,year} [{day,week,month,year} ...]]
|
|
||||||
[--cache {none,day,week,month}]
|
|
||||||
[--freqai-backtest-live-models] [--notes TEXT]
|
|
||||||
|
|
||||||
options:
|
|
||||||
-h, --help show this help message and exit
|
|
||||||
-i TIMEFRAME, --timeframe TIMEFRAME
|
|
||||||
Specify timeframe (`1m`, `5m`, `30m`, `1h`, `1d`).
|
|
||||||
--timerange TIMERANGE
|
|
||||||
Specify what timerange of data to use.
|
|
||||||
--data-format-ohlcv {json,jsongz,feather,parquet}
|
|
||||||
Storage format for downloaded candle (OHLCV) data.
|
|
||||||
(default: `feather`).
|
|
||||||
--max-open-trades INT
|
|
||||||
Override the value of the `max_open_trades`
|
|
||||||
configuration setting.
|
|
||||||
--stake-amount STAKE_AMOUNT
|
|
||||||
Override the value of the `stake_amount` configuration
|
|
||||||
setting.
|
|
||||||
--fee FLOAT Specify fee ratio. Will be applied twice (on trade
|
|
||||||
entry and exit).
|
|
||||||
-p PAIRS [PAIRS ...], --pairs PAIRS [PAIRS ...]
|
|
||||||
Limit command to these pairs. Pairs are space-
|
|
||||||
separated.
|
|
||||||
--eps, --enable-position-stacking
|
|
||||||
Allow buying the same pair multiple times (position
|
|
||||||
stacking).
|
|
||||||
--enable-protections, --enableprotections
|
|
||||||
Enable protections for backtesting.Will slow
|
|
||||||
backtesting down by a considerable amount, but will
|
|
||||||
include configured protections
|
|
||||||
--dry-run-wallet DRY_RUN_WALLET, --starting-balance DRY_RUN_WALLET
|
|
||||||
Starting balance, used for backtesting / hyperopt and
|
|
||||||
dry-runs.
|
|
||||||
--timeframe-detail TIMEFRAME_DETAIL
|
|
||||||
Specify detail timeframe for backtesting (`1m`, `5m`,
|
|
||||||
`30m`, `1h`, `1d`).
|
|
||||||
--strategy-list STRATEGY_LIST [STRATEGY_LIST ...]
|
|
||||||
Provide a space-separated list of strategies to
|
|
||||||
backtest. Please note that timeframe needs to be set
|
|
||||||
either in config or via command line. When using this
|
|
||||||
together with `--export trades`, the strategy-name is
|
|
||||||
injected into the filename (so `backtest-data.json`
|
|
||||||
becomes `backtest-data-SampleStrategy.json`
|
|
||||||
--export {none,trades,signals}
|
|
||||||
Export backtest results (default: trades).
|
|
||||||
--export-filename PATH, --backtest-filename PATH
|
|
||||||
Use this filename for backtest results.Requires
|
|
||||||
`--export` to be set as well. Example: `--export-filen
|
|
||||||
ame=user_data/backtest_results/backtest_today.json`
|
|
||||||
--breakdown {day,week,month,year} [{day,week,month,year} ...]
|
|
||||||
Show backtesting breakdown per [day, week, month,
|
|
||||||
year].
|
|
||||||
--cache {none,day,week,month}
|
|
||||||
Load a cached backtest result no older than specified
|
|
||||||
age (default: day).
|
|
||||||
--freqai-backtest-live-models
|
|
||||||
Run backtest with ready models.
|
|
||||||
--notes TEXT Add notes to the backtest results.
|
|
||||||
|
|
||||||
Common arguments:
|
|
||||||
-v, --verbose Verbose mode (-vv for more, -vvv to get all messages).
|
|
||||||
--no-color Disable colorization of hyperopt results. May be
|
|
||||||
useful if you are redirecting output to a file.
|
|
||||||
--logfile FILE, --log-file FILE
|
|
||||||
Log to the file specified. Special values are:
|
|
||||||
'syslog', 'journald'. See the documentation for more
|
|
||||||
details.
|
|
||||||
-V, --version show program's version number and exit
|
|
||||||
-c PATH, --config PATH
|
|
||||||
Specify configuration file (default:
|
|
||||||
`userdir/config.json` or `config.json` whichever
|
|
||||||
exists). Multiple --config options may be used. Can be
|
|
||||||
set to `-` to read config from stdin.
|
|
||||||
-d PATH, --datadir PATH, --data-dir PATH
|
|
||||||
Path to the base directory of the exchange with
|
|
||||||
historical backtesting data. To see futures data, use
|
|
||||||
trading-mode additionally.
|
|
||||||
--userdir PATH, --user-data-dir PATH
|
|
||||||
Path to userdata directory.
|
|
||||||
|
|
||||||
Strategy arguments:
|
|
||||||
-s NAME, --strategy NAME
|
|
||||||
Specify strategy class name which will be used by the
|
|
||||||
bot.
|
|
||||||
--strategy-path PATH Specify additional strategy lookup path.
|
|
||||||
--recursive-strategy-search
|
|
||||||
Recursively search for a strategy in the strategies
|
|
||||||
folder.
|
|
||||||
--freqaimodel NAME Specify a custom freqaimodels.
|
|
||||||
--freqaimodel-path PATH
|
|
||||||
Specify additional lookup path for freqaimodels.
|
|
||||||
|
|
||||||
```
|
|
||||||
@@ -1,54 +0,0 @@
|
|||||||
```
|
|
||||||
usage: freqtrade convert-data [-h] [-v] [--no-color] [--logfile FILE] [-V]
|
|
||||||
[-c PATH] [-d PATH] [--userdir PATH]
|
|
||||||
[-p PAIRS [PAIRS ...]] --format-from
|
|
||||||
{json,jsongz,feather,parquet} --format-to
|
|
||||||
{json,jsongz,feather,parquet} [--erase]
|
|
||||||
[--exchange EXCHANGE]
|
|
||||||
[-t TIMEFRAMES [TIMEFRAMES ...]]
|
|
||||||
[--trading-mode {spot,margin,futures}]
|
|
||||||
[--candle-types {spot,futures,mark,index,premiumIndex,funding_rate} [{spot,futures,mark,index,premiumIndex,funding_rate} ...]]
|
|
||||||
|
|
||||||
options:
|
|
||||||
-h, --help show this help message and exit
|
|
||||||
-p PAIRS [PAIRS ...], --pairs PAIRS [PAIRS ...]
|
|
||||||
Limit command to these pairs. Pairs are space-
|
|
||||||
separated.
|
|
||||||
--format-from {json,jsongz,feather,parquet}
|
|
||||||
Source format for data conversion.
|
|
||||||
--format-to {json,jsongz,feather,parquet}
|
|
||||||
Destination format for data conversion.
|
|
||||||
--erase Clean all existing data for the selected
|
|
||||||
exchange/pairs/timeframes.
|
|
||||||
--exchange EXCHANGE Exchange name. Only valid if no config is provided.
|
|
||||||
-t TIMEFRAMES [TIMEFRAMES ...], --timeframes TIMEFRAMES [TIMEFRAMES ...]
|
|
||||||
Specify which tickers to download. Space-separated
|
|
||||||
list. Default: `1m 5m`.
|
|
||||||
--trading-mode {spot,margin,futures}, --tradingmode {spot,margin,futures}
|
|
||||||
Select Trading mode
|
|
||||||
--candle-types {spot,futures,mark,index,premiumIndex,funding_rate} [{spot,futures,mark,index,premiumIndex,funding_rate} ...]
|
|
||||||
Select candle type to convert. Defaults to all
|
|
||||||
available types.
|
|
||||||
|
|
||||||
Common arguments:
|
|
||||||
-v, --verbose Verbose mode (-vv for more, -vvv to get all messages).
|
|
||||||
--no-color Disable colorization of hyperopt results. May be
|
|
||||||
useful if you are redirecting output to a file.
|
|
||||||
--logfile FILE, --log-file FILE
|
|
||||||
Log to the file specified. Special values are:
|
|
||||||
'syslog', 'journald'. See the documentation for more
|
|
||||||
details.
|
|
||||||
-V, --version show program's version number and exit
|
|
||||||
-c PATH, --config PATH
|
|
||||||
Specify configuration file (default:
|
|
||||||
`userdir/config.json` or `config.json` whichever
|
|
||||||
exists). Multiple --config options may be used. Can be
|
|
||||||
set to `-` to read config from stdin.
|
|
||||||
-d PATH, --datadir PATH, --data-dir PATH
|
|
||||||
Path to the base directory of the exchange with
|
|
||||||
historical backtesting data. To see futures data, use
|
|
||||||
trading-mode additionally.
|
|
||||||
--userdir PATH, --user-data-dir PATH
|
|
||||||
Path to userdata directory.
|
|
||||||
|
|
||||||
```
|
|
||||||
@@ -1,12 +0,0 @@
|
|||||||
```
|
|
||||||
usage: freqtrade convert-db [-h] [--db-url PATH] [--db-url-from PATH]
|
|
||||||
|
|
||||||
options:
|
|
||||||
-h, --help show this help message and exit
|
|
||||||
--db-url PATH Override trades database URL, this is useful in custom
|
|
||||||
deployments (default: `sqlite:///tradesv3.sqlite` for
|
|
||||||
Live Run mode, `sqlite:///tradesv3.dryrun.sqlite` for
|
|
||||||
Dry Run).
|
|
||||||
--db-url-from PATH Source db url to use when migrating a database.
|
|
||||||
|
|
||||||
```
|
|
||||||
@@ -1,43 +0,0 @@
|
|||||||
```
|
|
||||||
usage: freqtrade convert-trade-data [-h] [-v] [--no-color] [--logfile FILE]
|
|
||||||
[-V] [-c PATH] [-d PATH] [--userdir PATH]
|
|
||||||
[-p PAIRS [PAIRS ...]] --format-from
|
|
||||||
{json,jsongz,feather,parquet,kraken_csv}
|
|
||||||
--format-to {json,jsongz,feather,parquet}
|
|
||||||
[--erase] [--exchange EXCHANGE]
|
|
||||||
|
|
||||||
options:
|
|
||||||
-h, --help show this help message and exit
|
|
||||||
-p PAIRS [PAIRS ...], --pairs PAIRS [PAIRS ...]
|
|
||||||
Limit command to these pairs. Pairs are space-
|
|
||||||
separated.
|
|
||||||
--format-from {json,jsongz,feather,parquet,kraken_csv}
|
|
||||||
Source format for data conversion.
|
|
||||||
--format-to {json,jsongz,feather,parquet}
|
|
||||||
Destination format for data conversion.
|
|
||||||
--erase Clean all existing data for the selected
|
|
||||||
exchange/pairs/timeframes.
|
|
||||||
--exchange EXCHANGE Exchange name. Only valid if no config is provided.
|
|
||||||
|
|
||||||
Common arguments:
|
|
||||||
-v, --verbose Verbose mode (-vv for more, -vvv to get all messages).
|
|
||||||
--no-color Disable colorization of hyperopt results. May be
|
|
||||||
useful if you are redirecting output to a file.
|
|
||||||
--logfile FILE, --log-file FILE
|
|
||||||
Log to the file specified. Special values are:
|
|
||||||
'syslog', 'journald'. See the documentation for more
|
|
||||||
details.
|
|
||||||
-V, --version show program's version number and exit
|
|
||||||
-c PATH, --config PATH
|
|
||||||
Specify configuration file (default:
|
|
||||||
`userdir/config.json` or `config.json` whichever
|
|
||||||
exists). Multiple --config options may be used. Can be
|
|
||||||
set to `-` to read config from stdin.
|
|
||||||
-d PATH, --datadir PATH, --data-dir PATH
|
|
||||||
Path to the base directory of the exchange with
|
|
||||||
historical backtesting data. To see futures data, use
|
|
||||||
trading-mode additionally.
|
|
||||||
--userdir PATH, --user-data-dir PATH
|
|
||||||
Path to userdata directory.
|
|
||||||
|
|
||||||
```
|
|
||||||
@@ -1,10 +0,0 @@
|
|||||||
```
|
|
||||||
usage: freqtrade create-userdir [-h] [--userdir PATH] [--reset]
|
|
||||||
|
|
||||||
options:
|
|
||||||
-h, --help show this help message and exit
|
|
||||||
--userdir PATH, --user-data-dir PATH
|
|
||||||
Path to userdata directory.
|
|
||||||
--reset Reset sample files to their original state.
|
|
||||||
|
|
||||||
```
|
|
||||||
@@ -1,72 +0,0 @@
|
|||||||
```
|
|
||||||
usage: freqtrade download-data [-h] [-v] [--no-color] [--logfile FILE] [-V]
|
|
||||||
[-c PATH] [-d PATH] [--userdir PATH]
|
|
||||||
[-p PAIRS [PAIRS ...]] [--pairs-file FILE]
|
|
||||||
[--days INT] [--new-pairs-days INT]
|
|
||||||
[--include-inactive-pairs]
|
|
||||||
[--timerange TIMERANGE] [--dl-trades]
|
|
||||||
[--convert] [--exchange EXCHANGE]
|
|
||||||
[-t TIMEFRAMES [TIMEFRAMES ...]] [--erase]
|
|
||||||
[--data-format-ohlcv {json,jsongz,feather,parquet}]
|
|
||||||
[--data-format-trades {json,jsongz,feather,parquet}]
|
|
||||||
[--trading-mode {spot,margin,futures}]
|
|
||||||
[--prepend]
|
|
||||||
|
|
||||||
options:
|
|
||||||
-h, --help show this help message and exit
|
|
||||||
-p PAIRS [PAIRS ...], --pairs PAIRS [PAIRS ...]
|
|
||||||
Limit command to these pairs. Pairs are space-
|
|
||||||
separated.
|
|
||||||
--pairs-file FILE File containing a list of pairs. Takes precedence over
|
|
||||||
--pairs or pairs configured in the configuration.
|
|
||||||
--days INT Download data for given number of days.
|
|
||||||
--new-pairs-days INT Download data of new pairs for given number of days.
|
|
||||||
Default: `None`.
|
|
||||||
--include-inactive-pairs
|
|
||||||
Also download data from inactive pairs.
|
|
||||||
--timerange TIMERANGE
|
|
||||||
Specify what timerange of data to use.
|
|
||||||
--dl-trades Download trades instead of OHLCV data.
|
|
||||||
--convert Convert downloaded trades to OHLCV data. Only
|
|
||||||
applicable in combination with `--dl-trades`. Will be
|
|
||||||
automatic for exchanges which don't have historic
|
|
||||||
OHLCV (e.g. Kraken). If not provided, use `trades-to-
|
|
||||||
ohlcv` to convert trades data to OHLCV data.
|
|
||||||
--exchange EXCHANGE Exchange name. Only valid if no config is provided.
|
|
||||||
-t TIMEFRAMES [TIMEFRAMES ...], --timeframes TIMEFRAMES [TIMEFRAMES ...]
|
|
||||||
Specify which tickers to download. Space-separated
|
|
||||||
list. Default: `1m 5m`.
|
|
||||||
--erase Clean all existing data for the selected
|
|
||||||
exchange/pairs/timeframes.
|
|
||||||
--data-format-ohlcv {json,jsongz,feather,parquet}
|
|
||||||
Storage format for downloaded candle (OHLCV) data.
|
|
||||||
(default: `feather`).
|
|
||||||
--data-format-trades {json,jsongz,feather,parquet}
|
|
||||||
Storage format for downloaded trades data. (default:
|
|
||||||
`feather`).
|
|
||||||
--trading-mode {spot,margin,futures}, --tradingmode {spot,margin,futures}
|
|
||||||
Select Trading mode
|
|
||||||
--prepend Allow data prepending. (Data-appending is disabled)
|
|
||||||
|
|
||||||
Common arguments:
|
|
||||||
-v, --verbose Verbose mode (-vv for more, -vvv to get all messages).
|
|
||||||
--no-color Disable colorization of hyperopt results. May be
|
|
||||||
useful if you are redirecting output to a file.
|
|
||||||
--logfile FILE, --log-file FILE
|
|
||||||
Log to the file specified. Special values are:
|
|
||||||
'syslog', 'journald'. See the documentation for more
|
|
||||||
details.
|
|
||||||
-V, --version show program's version number and exit
|
|
||||||
-c PATH, --config PATH
|
|
||||||
Specify configuration file (default:
|
|
||||||
`userdir/config.json` or `config.json` whichever
|
|
||||||
exists). Multiple --config options may be used. Can be
|
|
||||||
set to `-` to read config from stdin.
|
|
||||||
-d PATH, --datadir PATH, --data-dir PATH
|
|
||||||
Path to the base directory of the exchange with
|
|
||||||
historical backtesting data. To see futures data, use
|
|
||||||
trading-mode additionally.
|
|
||||||
--userdir PATH, --user-data-dir PATH
|
|
||||||
Path to userdata directory.
|
|
||||||
|
|
||||||
```
|
|
||||||
@@ -1,65 +0,0 @@
|
|||||||
```
|
|
||||||
usage: freqtrade edge [-h] [-v] [--no-color] [--logfile FILE] [-V] [-c PATH]
|
|
||||||
[-d PATH] [--userdir PATH] [-s NAME]
|
|
||||||
[--strategy-path PATH] [--recursive-strategy-search]
|
|
||||||
[--freqaimodel NAME] [--freqaimodel-path PATH]
|
|
||||||
[-i TIMEFRAME] [--timerange TIMERANGE]
|
|
||||||
[--data-format-ohlcv {json,jsongz,feather,parquet}]
|
|
||||||
[--max-open-trades INT] [--stake-amount STAKE_AMOUNT]
|
|
||||||
[--fee FLOAT] [-p PAIRS [PAIRS ...]]
|
|
||||||
|
|
||||||
options:
|
|
||||||
-h, --help show this help message and exit
|
|
||||||
-i TIMEFRAME, --timeframe TIMEFRAME
|
|
||||||
Specify timeframe (`1m`, `5m`, `30m`, `1h`, `1d`).
|
|
||||||
--timerange TIMERANGE
|
|
||||||
Specify what timerange of data to use.
|
|
||||||
--data-format-ohlcv {json,jsongz,feather,parquet}
|
|
||||||
Storage format for downloaded candle (OHLCV) data.
|
|
||||||
(default: `feather`).
|
|
||||||
--max-open-trades INT
|
|
||||||
Override the value of the `max_open_trades`
|
|
||||||
configuration setting.
|
|
||||||
--stake-amount STAKE_AMOUNT
|
|
||||||
Override the value of the `stake_amount` configuration
|
|
||||||
setting.
|
|
||||||
--fee FLOAT Specify fee ratio. Will be applied twice (on trade
|
|
||||||
entry and exit).
|
|
||||||
-p PAIRS [PAIRS ...], --pairs PAIRS [PAIRS ...]
|
|
||||||
Limit command to these pairs. Pairs are space-
|
|
||||||
separated.
|
|
||||||
|
|
||||||
Common arguments:
|
|
||||||
-v, --verbose Verbose mode (-vv for more, -vvv to get all messages).
|
|
||||||
--no-color Disable colorization of hyperopt results. May be
|
|
||||||
useful if you are redirecting output to a file.
|
|
||||||
--logfile FILE, --log-file FILE
|
|
||||||
Log to the file specified. Special values are:
|
|
||||||
'syslog', 'journald'. See the documentation for more
|
|
||||||
details.
|
|
||||||
-V, --version show program's version number and exit
|
|
||||||
-c PATH, --config PATH
|
|
||||||
Specify configuration file (default:
|
|
||||||
`userdir/config.json` or `config.json` whichever
|
|
||||||
exists). Multiple --config options may be used. Can be
|
|
||||||
set to `-` to read config from stdin.
|
|
||||||
-d PATH, --datadir PATH, --data-dir PATH
|
|
||||||
Path to the base directory of the exchange with
|
|
||||||
historical backtesting data. To see futures data, use
|
|
||||||
trading-mode additionally.
|
|
||||||
--userdir PATH, --user-data-dir PATH
|
|
||||||
Path to userdata directory.
|
|
||||||
|
|
||||||
Strategy arguments:
|
|
||||||
-s NAME, --strategy NAME
|
|
||||||
Specify strategy class name which will be used by the
|
|
||||||
bot.
|
|
||||||
--strategy-path PATH Specify additional strategy lookup path.
|
|
||||||
--recursive-strategy-search
|
|
||||||
Recursively search for a strategy in the strategies
|
|
||||||
folder.
|
|
||||||
--freqaimodel NAME Specify a custom freqaimodels.
|
|
||||||
--freqaimodel-path PATH
|
|
||||||
Specify additional lookup path for freqaimodels.
|
|
||||||
|
|
||||||
```
|
|
||||||
@@ -1,64 +0,0 @@
|
|||||||
```
|
|
||||||
usage: freqtrade hyperopt-list [-h] [-v] [--no-color] [--logfile FILE] [-V]
|
|
||||||
[-c PATH] [-d PATH] [--userdir PATH] [--best]
|
|
||||||
[--profitable] [--min-trades INT]
|
|
||||||
[--max-trades INT] [--min-avg-time FLOAT]
|
|
||||||
[--max-avg-time FLOAT] [--min-avg-profit FLOAT]
|
|
||||||
[--max-avg-profit FLOAT]
|
|
||||||
[--min-total-profit FLOAT]
|
|
||||||
[--max-total-profit FLOAT]
|
|
||||||
[--min-objective FLOAT] [--max-objective FLOAT]
|
|
||||||
[--print-json] [--no-details]
|
|
||||||
[--hyperopt-filename FILENAME]
|
|
||||||
[--export-csv FILE]
|
|
||||||
|
|
||||||
options:
|
|
||||||
-h, --help show this help message and exit
|
|
||||||
--best Select only best epochs.
|
|
||||||
--profitable Select only profitable epochs.
|
|
||||||
--min-trades INT Select epochs with more than INT trades.
|
|
||||||
--max-trades INT Select epochs with less than INT trades.
|
|
||||||
--min-avg-time FLOAT Select epochs above average time.
|
|
||||||
--max-avg-time FLOAT Select epochs below average time.
|
|
||||||
--min-avg-profit FLOAT
|
|
||||||
Select epochs above average profit.
|
|
||||||
--max-avg-profit FLOAT
|
|
||||||
Select epochs below average profit.
|
|
||||||
--min-total-profit FLOAT
|
|
||||||
Select epochs above total profit.
|
|
||||||
--max-total-profit FLOAT
|
|
||||||
Select epochs below total profit.
|
|
||||||
--min-objective FLOAT
|
|
||||||
Select epochs above objective.
|
|
||||||
--max-objective FLOAT
|
|
||||||
Select epochs below objective.
|
|
||||||
--print-json Print output in JSON format.
|
|
||||||
--no-details Do not print best epoch details.
|
|
||||||
--hyperopt-filename FILENAME
|
|
||||||
Hyperopt result filename.Example: `--hyperopt-
|
|
||||||
filename=hyperopt_results_2020-09-27_16-20-48.pickle`
|
|
||||||
--export-csv FILE Export to CSV-File. This will disable table print.
|
|
||||||
Example: --export-csv hyperopt.csv
|
|
||||||
|
|
||||||
Common arguments:
|
|
||||||
-v, --verbose Verbose mode (-vv for more, -vvv to get all messages).
|
|
||||||
--no-color Disable colorization of hyperopt results. May be
|
|
||||||
useful if you are redirecting output to a file.
|
|
||||||
--logfile FILE, --log-file FILE
|
|
||||||
Log to the file specified. Special values are:
|
|
||||||
'syslog', 'journald'. See the documentation for more
|
|
||||||
details.
|
|
||||||
-V, --version show program's version number and exit
|
|
||||||
-c PATH, --config PATH
|
|
||||||
Specify configuration file (default:
|
|
||||||
`userdir/config.json` or `config.json` whichever
|
|
||||||
exists). Multiple --config options may be used. Can be
|
|
||||||
set to `-` to read config from stdin.
|
|
||||||
-d PATH, --datadir PATH, --data-dir PATH
|
|
||||||
Path to the base directory of the exchange with
|
|
||||||
historical backtesting data. To see futures data, use
|
|
||||||
trading-mode additionally.
|
|
||||||
--userdir PATH, --user-data-dir PATH
|
|
||||||
Path to userdata directory.
|
|
||||||
|
|
||||||
```
|
|
||||||
@@ -1,46 +0,0 @@
|
|||||||
```
|
|
||||||
usage: freqtrade hyperopt-show [-h] [-v] [--no-color] [--logfile FILE] [-V]
|
|
||||||
[-c PATH] [-d PATH] [--userdir PATH] [--best]
|
|
||||||
[--profitable] [-n INT] [--print-json]
|
|
||||||
[--hyperopt-filename FILENAME] [--no-header]
|
|
||||||
[--disable-param-export]
|
|
||||||
[--breakdown {day,week,month,year} [{day,week,month,year} ...]]
|
|
||||||
|
|
||||||
options:
|
|
||||||
-h, --help show this help message and exit
|
|
||||||
--best Select only best epochs.
|
|
||||||
--profitable Select only profitable epochs.
|
|
||||||
-n INT, --index INT Specify the index of the epoch to print details for.
|
|
||||||
--print-json Print output in JSON format.
|
|
||||||
--hyperopt-filename FILENAME
|
|
||||||
Hyperopt result filename.Example: `--hyperopt-
|
|
||||||
filename=hyperopt_results_2020-09-27_16-20-48.pickle`
|
|
||||||
--no-header Do not print epoch details header.
|
|
||||||
--disable-param-export
|
|
||||||
Disable automatic hyperopt parameter export.
|
|
||||||
--breakdown {day,week,month,year} [{day,week,month,year} ...]
|
|
||||||
Show backtesting breakdown per [day, week, month,
|
|
||||||
year].
|
|
||||||
|
|
||||||
Common arguments:
|
|
||||||
-v, --verbose Verbose mode (-vv for more, -vvv to get all messages).
|
|
||||||
--no-color Disable colorization of hyperopt results. May be
|
|
||||||
useful if you are redirecting output to a file.
|
|
||||||
--logfile FILE, --log-file FILE
|
|
||||||
Log to the file specified. Special values are:
|
|
||||||
'syslog', 'journald'. See the documentation for more
|
|
||||||
details.
|
|
||||||
-V, --version show program's version number and exit
|
|
||||||
-c PATH, --config PATH
|
|
||||||
Specify configuration file (default:
|
|
||||||
`userdir/config.json` or `config.json` whichever
|
|
||||||
exists). Multiple --config options may be used. Can be
|
|
||||||
set to `-` to read config from stdin.
|
|
||||||
-d PATH, --datadir PATH, --data-dir PATH
|
|
||||||
Path to the base directory of the exchange with
|
|
||||||
historical backtesting data. To see futures data, use
|
|
||||||
trading-mode additionally.
|
|
||||||
--userdir PATH, --user-data-dir PATH
|
|
||||||
Path to userdata directory.
|
|
||||||
|
|
||||||
```
|
|
||||||
@@ -1,127 +0,0 @@
|
|||||||
```
|
|
||||||
usage: freqtrade hyperopt [-h] [-v] [--no-color] [--logfile FILE] [-V]
|
|
||||||
[-c PATH] [-d PATH] [--userdir PATH] [-s NAME]
|
|
||||||
[--strategy-path PATH] [--recursive-strategy-search]
|
|
||||||
[--freqaimodel NAME] [--freqaimodel-path PATH]
|
|
||||||
[-i TIMEFRAME] [--timerange TIMERANGE]
|
|
||||||
[--data-format-ohlcv {json,jsongz,feather,parquet}]
|
|
||||||
[--max-open-trades INT]
|
|
||||||
[--stake-amount STAKE_AMOUNT] [--fee FLOAT]
|
|
||||||
[-p PAIRS [PAIRS ...]] [--hyperopt-path PATH]
|
|
||||||
[--eps] [--enable-protections]
|
|
||||||
[--dry-run-wallet DRY_RUN_WALLET]
|
|
||||||
[--timeframe-detail TIMEFRAME_DETAIL] [-e INT]
|
|
||||||
[--spaces {all,buy,sell,roi,stoploss,trailing,protection,trades,default} [{all,buy,sell,roi,stoploss,trailing,protection,trades,default} ...]]
|
|
||||||
[--print-all] [--print-json] [-j JOBS]
|
|
||||||
[--random-state INT] [--min-trades INT]
|
|
||||||
[--hyperopt-loss NAME] [--disable-param-export]
|
|
||||||
[--ignore-missing-spaces] [--analyze-per-epoch]
|
|
||||||
[--early-stop INT]
|
|
||||||
|
|
||||||
options:
|
|
||||||
-h, --help show this help message and exit
|
|
||||||
-i TIMEFRAME, --timeframe TIMEFRAME
|
|
||||||
Specify timeframe (`1m`, `5m`, `30m`, `1h`, `1d`).
|
|
||||||
--timerange TIMERANGE
|
|
||||||
Specify what timerange of data to use.
|
|
||||||
--data-format-ohlcv {json,jsongz,feather,parquet}
|
|
||||||
Storage format for downloaded candle (OHLCV) data.
|
|
||||||
(default: `feather`).
|
|
||||||
--max-open-trades INT
|
|
||||||
Override the value of the `max_open_trades`
|
|
||||||
configuration setting.
|
|
||||||
--stake-amount STAKE_AMOUNT
|
|
||||||
Override the value of the `stake_amount` configuration
|
|
||||||
setting.
|
|
||||||
--fee FLOAT Specify fee ratio. Will be applied twice (on trade
|
|
||||||
entry and exit).
|
|
||||||
-p PAIRS [PAIRS ...], --pairs PAIRS [PAIRS ...]
|
|
||||||
Limit command to these pairs. Pairs are space-
|
|
||||||
separated.
|
|
||||||
--hyperopt-path PATH Specify additional lookup path for Hyperopt Loss
|
|
||||||
functions.
|
|
||||||
--eps, --enable-position-stacking
|
|
||||||
Allow buying the same pair multiple times (position
|
|
||||||
stacking).
|
|
||||||
--enable-protections, --enableprotections
|
|
||||||
Enable protections for backtesting.Will slow
|
|
||||||
backtesting down by a considerable amount, but will
|
|
||||||
include configured protections
|
|
||||||
--dry-run-wallet DRY_RUN_WALLET, --starting-balance DRY_RUN_WALLET
|
|
||||||
Starting balance, used for backtesting / hyperopt and
|
|
||||||
dry-runs.
|
|
||||||
--timeframe-detail TIMEFRAME_DETAIL
|
|
||||||
Specify detail timeframe for backtesting (`1m`, `5m`,
|
|
||||||
`30m`, `1h`, `1d`).
|
|
||||||
-e INT, --epochs INT Specify number of epochs (default: 100).
|
|
||||||
--spaces {all,buy,sell,roi,stoploss,trailing,protection,trades,default} [{all,buy,sell,roi,stoploss,trailing,protection,trades,default} ...]
|
|
||||||
Specify which parameters to hyperopt. Space-separated
|
|
||||||
list.
|
|
||||||
--print-all Print all results, not only the best ones.
|
|
||||||
--print-json Print output in JSON format.
|
|
||||||
-j JOBS, --job-workers JOBS
|
|
||||||
The number of concurrently running jobs for
|
|
||||||
hyperoptimization (hyperopt worker processes). If -1
|
|
||||||
(default), all CPUs are used, for -2, all CPUs but one
|
|
||||||
are used, etc. If 1 is given, no parallel computing
|
|
||||||
code is used at all.
|
|
||||||
--random-state INT Set random state to some positive integer for
|
|
||||||
reproducible hyperopt results.
|
|
||||||
--min-trades INT Set minimal desired number of trades for evaluations
|
|
||||||
in the hyperopt optimization path (default: 1).
|
|
||||||
--hyperopt-loss NAME, --hyperoptloss NAME
|
|
||||||
Specify the class name of the hyperopt loss function
|
|
||||||
class (IHyperOptLoss). Different functions can
|
|
||||||
generate completely different results, since the
|
|
||||||
target for optimization is different. Built-in
|
|
||||||
Hyperopt-loss-functions are:
|
|
||||||
ShortTradeDurHyperOptLoss, OnlyProfitHyperOptLoss,
|
|
||||||
SharpeHyperOptLoss, SharpeHyperOptLossDaily,
|
|
||||||
SortinoHyperOptLoss, SortinoHyperOptLossDaily,
|
|
||||||
CalmarHyperOptLoss, MaxDrawDownHyperOptLoss,
|
|
||||||
MaxDrawDownRelativeHyperOptLoss,
|
|
||||||
MaxDrawDownPerPairHyperOptLoss,
|
|
||||||
ProfitDrawDownHyperOptLoss, MultiMetricHyperOptLoss
|
|
||||||
--disable-param-export
|
|
||||||
Disable automatic hyperopt parameter export.
|
|
||||||
--ignore-missing-spaces, --ignore-unparameterized-spaces
|
|
||||||
Suppress errors for any requested Hyperopt spaces that
|
|
||||||
do not contain any parameters.
|
|
||||||
--analyze-per-epoch Run populate_indicators once per epoch.
|
|
||||||
--early-stop INT Early stop hyperopt if no improvement after (default:
|
|
||||||
0) epochs.
|
|
||||||
|
|
||||||
Common arguments:
|
|
||||||
-v, --verbose Verbose mode (-vv for more, -vvv to get all messages).
|
|
||||||
--no-color Disable colorization of hyperopt results. May be
|
|
||||||
useful if you are redirecting output to a file.
|
|
||||||
--logfile FILE, --log-file FILE
|
|
||||||
Log to the file specified. Special values are:
|
|
||||||
'syslog', 'journald'. See the documentation for more
|
|
||||||
details.
|
|
||||||
-V, --version show program's version number and exit
|
|
||||||
-c PATH, --config PATH
|
|
||||||
Specify configuration file (default:
|
|
||||||
`userdir/config.json` or `config.json` whichever
|
|
||||||
exists). Multiple --config options may be used. Can be
|
|
||||||
set to `-` to read config from stdin.
|
|
||||||
-d PATH, --datadir PATH, --data-dir PATH
|
|
||||||
Path to the base directory of the exchange with
|
|
||||||
historical backtesting data. To see futures data, use
|
|
||||||
trading-mode additionally.
|
|
||||||
--userdir PATH, --user-data-dir PATH
|
|
||||||
Path to userdata directory.
|
|
||||||
|
|
||||||
Strategy arguments:
|
|
||||||
-s NAME, --strategy NAME
|
|
||||||
Specify strategy class name which will be used by the
|
|
||||||
bot.
|
|
||||||
--strategy-path PATH Specify additional strategy lookup path.
|
|
||||||
--recursive-strategy-search
|
|
||||||
Recursively search for a strategy in the strategies
|
|
||||||
folder.
|
|
||||||
--freqaimodel NAME Specify a custom freqaimodels.
|
|
||||||
--freqaimodel-path PATH
|
|
||||||
Specify additional lookup path for freqaimodels.
|
|
||||||
|
|
||||||
```
|
|
||||||
@@ -1,14 +0,0 @@
|
|||||||
```
|
|
||||||
usage: freqtrade install-ui [-h] [--erase] [--prerelease]
|
|
||||||
[--ui-version UI_VERSION]
|
|
||||||
|
|
||||||
options:
|
|
||||||
-h, --help show this help message and exit
|
|
||||||
--erase Clean UI folder, don't download new version.
|
|
||||||
--prerelease Install the latest pre-release version of FreqUI. This
|
|
||||||
is not recommended for production use.
|
|
||||||
--ui-version UI_VERSION
|
|
||||||
Specify a specific version of FreqUI to install. Not
|
|
||||||
specifying this installs the latest version.
|
|
||||||
|
|
||||||
```
|
|
||||||