mirror of
https://github.com/freqtrade/freqtrade.git
synced 2025-11-29 16:43:06 +00:00
Compare commits
152 Commits
2025.10
...
maint/pyth
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0340d36af2 | ||
|
|
ad7816d51e | ||
|
|
73127c8179 | ||
|
|
72889e2edb | ||
|
|
0f17b04b2f | ||
|
|
179a5ba6ed | ||
|
|
ed65b012b8 | ||
|
|
625629b9db | ||
|
|
9fa9f0860c | ||
|
|
5970881bb8 | ||
|
|
bed93429cd | ||
|
|
3af9089d51 | ||
|
|
3aed562806 | ||
|
|
7f32ce498b | ||
|
|
9e89ba6eed | ||
|
|
82309c3f47 | ||
|
|
d5613cf471 | ||
|
|
73f91eab15 | ||
|
|
35fb598017 | ||
|
|
40b9a836eb | ||
|
|
7189c0ff35 | ||
|
|
0eb206c7b3 | ||
|
|
728d2c9bcb | ||
|
|
f22feb7dee | ||
|
|
c6bf0e1843 | ||
|
|
68836cb7be | ||
|
|
706955e5fc | ||
|
|
9aec10b0f3 | ||
|
|
b6b817e051 | ||
|
|
40107b9380 | ||
|
|
8804850170 | ||
|
|
d246933c28 | ||
|
|
777ff1938e | ||
|
|
2846d9478e | ||
|
|
5d494eac51 | ||
|
|
e26c3cbe5a | ||
|
|
81a5056e1b | ||
|
|
1876656afc | ||
|
|
889ab7ea00 | ||
|
|
2d4b02f7e5 | ||
|
|
c5a339eaf3 | ||
|
|
1e50a2da53 | ||
|
|
7d1c2d3a1b | ||
|
|
a9f9b73a3a | ||
|
|
236df5be6f | ||
|
|
6ea83ba0e7 | ||
|
|
992c2f9e3e | ||
|
|
5e74700e31 | ||
|
|
4a225cab23 | ||
|
|
524ceebcbb | ||
|
|
f93c906614 | ||
|
|
b32ba68a6e | ||
|
|
649aff8076 | ||
|
|
a3efba019f | ||
|
|
ff4230af8a | ||
|
|
d1014ce3ce | ||
|
|
3bad6d3341 | ||
|
|
7526fd0e0d | ||
|
|
a2ec085dab | ||
|
|
cce7702e9c | ||
|
|
1cf7f4f9d8 | ||
|
|
1328df772b | ||
|
|
68dea691c2 | ||
|
|
f214942ff1 | ||
|
|
91866c1165 | ||
|
|
f73cbed843 | ||
|
|
5ad817f59e | ||
|
|
4a8f487b68 | ||
|
|
d1b553cecc | ||
|
|
1a2f261ee2 | ||
|
|
cfd4926f47 | ||
|
|
36593ec593 | ||
|
|
dc5f646f24 | ||
|
|
d7e4965cde | ||
|
|
e22bf5c681 | ||
|
|
007ab1b796 | ||
|
|
c748ac2aa2 | ||
|
|
c091426c44 | ||
|
|
ab28e43050 | ||
|
|
74a18bdb11 | ||
|
|
367b9fa7f6 | ||
|
|
8269333d9c | ||
|
|
d83f222a13 | ||
|
|
2ba9172526 | ||
|
|
465af62c16 | ||
|
|
231a145716 | ||
|
|
4cabbe4d52 | ||
|
|
72c87b7cbd | ||
|
|
3da6006a44 | ||
|
|
6f48b82297 | ||
|
|
ac51b41fdf | ||
|
|
4b0b306c44 | ||
|
|
fd0acc074c | ||
|
|
39c37980d5 | ||
|
|
6dc2547177 | ||
|
|
d1224367e5 | ||
|
|
c88a92b4f9 | ||
|
|
ffab6c3c50 | ||
|
|
cb7e04bfb0 | ||
|
|
c6a7b84684 | ||
|
|
97afb4a56a | ||
|
|
886c15a7fb | ||
|
|
e34e84c5c6 | ||
|
|
4cac68d774 | ||
|
|
a792744c0d | ||
|
|
384ed3fafb | ||
|
|
80ea476497 | ||
|
|
8ddbf4ba08 | ||
|
|
041d93a254 | ||
|
|
167f264bc4 | ||
|
|
5c036f5fcc | ||
|
|
964ed8099c | ||
|
|
71b169616f | ||
|
|
d824755597 | ||
|
|
8e41699348 | ||
|
|
a580ba1903 | ||
|
|
edcb3696f1 | ||
|
|
f1f07a1764 | ||
|
|
5139ea4e1c | ||
|
|
fdf9d4da81 | ||
|
|
65267b2bb7 | ||
|
|
420bb720c1 | ||
|
|
bfbb6404e6 | ||
|
|
6ffc88b3b3 | ||
|
|
54501b5c16 | ||
|
|
d7ef5e8bd2 | ||
|
|
c7e64360cd | ||
|
|
55b66ca5e6 | ||
|
|
1fc6cf4c89 | ||
|
|
918e7c4bf8 | ||
|
|
cfc406709c | ||
|
|
9f55dac605 | ||
|
|
00a6575fb4 | ||
|
|
c6eb63ab77 | ||
|
|
db63d433f7 | ||
|
|
635af046bf | ||
|
|
86381955a3 | ||
|
|
3cfa366ec9 | ||
|
|
baa5b1a58e | ||
|
|
5be0a9c069 | ||
|
|
8978da7c20 | ||
|
|
b3bbb92358 | ||
|
|
06ac40fdbb | ||
|
|
d38d8167d8 | ||
|
|
5684d0de0b | ||
|
|
a2f887aabb | ||
|
|
f72e708627 | ||
|
|
781d8501cb | ||
|
|
015f1055a7 | ||
|
|
2466cf85a1 | ||
|
|
e6ddeef07f | ||
|
|
614b85e833 |
20
.github/workflows/ci.yml
vendored
20
.github/workflows/ci.yml
vendored
@@ -25,7 +25,7 @@ jobs:
|
||||
strategy:
|
||||
matrix:
|
||||
os: [ "ubuntu-22.04", "ubuntu-24.04", "macos-14", "macos-15" , "windows-2022", "windows-2025" ]
|
||||
python-version: ["3.11", "3.12", "3.13"]
|
||||
python-version: ["3.11", "3.12", "3.13", "3.14"]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v5
|
||||
@@ -38,7 +38,7 @@ jobs:
|
||||
python-version: ${{ matrix.python-version }}
|
||||
|
||||
- name: Install uv
|
||||
uses: astral-sh/setup-uv@3259c6206f993105e3a61b142c2d97bf4b9ef83d # v7.1.0
|
||||
uses: astral-sh/setup-uv@85856786d1ce8acfbcc2f13a5f3fbd6b938f9f41 # v7.1.2
|
||||
with:
|
||||
activate-environment: true
|
||||
enable-cache: true
|
||||
@@ -91,12 +91,12 @@ jobs:
|
||||
|
||||
- name: Run command docs partials extract
|
||||
# This should be kept before the repository check to ensure that the docs are up-to-date
|
||||
if: ${{ (matrix.python-version == '3.13') }}
|
||||
run: |
|
||||
python build_helpers/create_command_partials.py
|
||||
|
||||
- name: Check for repository changes - *nix
|
||||
# TODO: python 3.13 slightly changed the output of argparse.
|
||||
if: ${{ (matrix.python-version != '3.13') && (runner.os != 'Windows') }}
|
||||
if: ${{ (runner.os != 'Windows') }}
|
||||
run: |
|
||||
if [ -n "$(git status --porcelain)" ]; then
|
||||
echo "Repository is dirty, changes detected:"
|
||||
@@ -108,7 +108,7 @@ jobs:
|
||||
fi
|
||||
|
||||
- name: Check for repository changes - Windows
|
||||
if: ${{ runner.os == 'Windows' && (matrix.python-version != '3.13') }}
|
||||
if: ${{ runner.os == 'Windows' }}
|
||||
run: |
|
||||
if (git status --porcelain) {
|
||||
Write-Host "Repository is dirty, changes detected:"
|
||||
@@ -248,7 +248,7 @@ jobs:
|
||||
python-version: "3.12"
|
||||
|
||||
- name: Install uv
|
||||
uses: astral-sh/setup-uv@3259c6206f993105e3a61b142c2d97bf4b9ef83d # v7.1.0
|
||||
uses: astral-sh/setup-uv@85856786d1ce8acfbcc2f13a5f3fbd6b938f9f41 # v7.1.2
|
||||
with:
|
||||
activate-environment: true
|
||||
enable-cache: true
|
||||
@@ -324,7 +324,7 @@ jobs:
|
||||
python -m build --sdist --wheel
|
||||
|
||||
- name: Upload artifacts 📦
|
||||
uses: actions/upload-artifact@v4
|
||||
uses: actions/upload-artifact@v5
|
||||
with:
|
||||
name: freqtrade-build
|
||||
path: |
|
||||
@@ -337,7 +337,7 @@ jobs:
|
||||
python -m build --sdist --wheel ft_client
|
||||
|
||||
- name: Upload artifacts 📦
|
||||
uses: actions/upload-artifact@v4
|
||||
uses: actions/upload-artifact@v5
|
||||
with:
|
||||
name: freqtrade-client-build
|
||||
path: |
|
||||
@@ -361,7 +361,7 @@ jobs:
|
||||
persist-credentials: false
|
||||
|
||||
- name: Download artifact 📦
|
||||
uses: actions/download-artifact@v5
|
||||
uses: actions/download-artifact@v6
|
||||
with:
|
||||
pattern: freqtrade*-build
|
||||
path: dist
|
||||
@@ -390,7 +390,7 @@ jobs:
|
||||
persist-credentials: false
|
||||
|
||||
- name: Download artifact 📦
|
||||
uses: actions/download-artifact@v5
|
||||
uses: actions/download-artifact@v6
|
||||
with:
|
||||
pattern: freqtrade*-build
|
||||
path: dist
|
||||
|
||||
2
.github/workflows/docker-build.yml
vendored
2
.github/workflows/docker-build.yml
vendored
@@ -48,7 +48,7 @@ jobs:
|
||||
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@29109295f81e9208d7d86ff1c6c12d2833863392 # v3.6.0
|
||||
uses: docker/setup-qemu-action@c7c53464625b32c7a7e944ae62b3e17d2b600130 # v3.7.0
|
||||
with:
|
||||
cache-image: false
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@ repos:
|
||||
- types-requests==2.32.4.20250913
|
||||
- types-tabulate==0.9.0.20241207
|
||||
- types-python-dateutil==2.9.0.20251008
|
||||
- scipy-stubs==1.16.2.4
|
||||
- scipy-stubs==1.16.3.0
|
||||
- SQLAlchemy==2.0.44
|
||||
# stages: [push]
|
||||
|
||||
@@ -44,7 +44,7 @@ repos:
|
||||
|
||||
- repo: https://github.com/charliermarsh/ruff-pre-commit
|
||||
# Ruff version.
|
||||
rev: 'v0.14.2'
|
||||
rev: 'v0.14.4'
|
||||
hooks:
|
||||
- id: ruff
|
||||
- id: ruff-format
|
||||
@@ -83,6 +83,6 @@ repos:
|
||||
|
||||
# Ensure github actions remain safe
|
||||
- repo: https://github.com/woodruffw/zizmor-pre-commit
|
||||
rev: v1.16.0
|
||||
rev: v1.16.3
|
||||
hooks:
|
||||
- id: zizmor
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# 
|
||||
|
||||
[](https://github.com/freqtrade/freqtrade/actions/)
|
||||
[](https://github.com/freqtrade/freqtrade/actions/workflows/ci.yml)
|
||||
[](https://doi.org/10.21105/joss.04864)
|
||||
[](https://coveralls.io/github/freqtrade/freqtrade?branch=develop)
|
||||
[](https://www.freqtrade.io)
|
||||
|
||||
@@ -2,52 +2,64 @@ 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")
|
||||
def _write_partial_file(filename: str, content: str):
|
||||
with Path(filename).open("w") as f:
|
||||
f.write(f"``` output\n{content}\n```\n")
|
||||
|
||||
|
||||
for command in subcommands:
|
||||
print(f"Running for {command}")
|
||||
result = subprocess.run(["freqtrade", command, "--help"], capture_output=True, text=True)
|
||||
def extract_command_partials():
|
||||
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",
|
||||
]
|
||||
|
||||
with Path(f"docs/commands/{command}.md").open("w") as f:
|
||||
f.write(f"```\n{result.stdout}\n```\n")
|
||||
result = subprocess.run(["freqtrade", "--help"], capture_output=True, text=True)
|
||||
|
||||
_write_partial_file("docs/commands/main.md", result.stdout)
|
||||
|
||||
for command in subcommands:
|
||||
print(f"Running for {command}")
|
||||
result = subprocess.run(["freqtrade", command, "--help"], capture_output=True, text=True)
|
||||
|
||||
_write_partial_file(f"docs/commands/{command}.md", result.stdout)
|
||||
|
||||
print("Running for freqtrade-client")
|
||||
result_client = subprocess.run(["freqtrade-client", "--show"], capture_output=True, text=True)
|
||||
|
||||
_write_partial_file("docs/commands/freqtrade-client.md", result_client.stdout)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
extract_command_partials()
|
||||
|
||||
Binary file not shown.
@@ -273,6 +273,68 @@
|
||||
]
|
||||
}
|
||||
},
|
||||
"backtest_cache": {
|
||||
"description": "Load a cached backtest result no older than specified age.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"none",
|
||||
"day",
|
||||
"week",
|
||||
"month"
|
||||
]
|
||||
},
|
||||
"hyperopt_path": {
|
||||
"description": "Specify additional lookup path for Hyperopt Loss functions.",
|
||||
"type": "string"
|
||||
},
|
||||
"epochs": {
|
||||
"description": "Number of training epochs for Hyperopt.",
|
||||
"type": "integer",
|
||||
"minimum": 1
|
||||
},
|
||||
"early_stop": {
|
||||
"description": "Early stop hyperopt if no improvement after <epochs>. Set to 0 to disable.",
|
||||
"type": "integer",
|
||||
"minimum": 0
|
||||
},
|
||||
"spaces": {
|
||||
"description": "Hyperopt parameter spaces to optimize. Default is the default set andincludes all spaces except for 'trailing', 'protection', and 'trades'.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
},
|
||||
"default": [
|
||||
"default"
|
||||
]
|
||||
},
|
||||
"analyze_per_epoch": {
|
||||
"description": "Perform analysis after each epoch in Hyperopt.",
|
||||
"type": "boolean"
|
||||
},
|
||||
"print_all": {
|
||||
"description": "Print all hyperopt trials, not just the best ones.",
|
||||
"type": "boolean",
|
||||
"default": false
|
||||
},
|
||||
"hyperopt_jobs": {
|
||||
"description": "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 is used.",
|
||||
"type": "integer",
|
||||
"default": -1
|
||||
},
|
||||
"hyperopt_random_state": {
|
||||
"description": "Random state for hyperopt trials.",
|
||||
"type": "integer",
|
||||
"minimum": 0
|
||||
},
|
||||
"hyperopt_min_trades": {
|
||||
"description": "Minimum number of trades per epoch for hyperopt.",
|
||||
"type": "integer",
|
||||
"minimum": 0
|
||||
},
|
||||
"hyperopt_loss": {
|
||||
"description": "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",
|
||||
"type": "string"
|
||||
},
|
||||
"bot_name": {
|
||||
"description": "Name of the trading bot. Passed via API to a client.",
|
||||
"type": "string"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
```
|
||||
``` output
|
||||
usage: freqtrade backtesting-analysis [-h] [-v] [--no-color] [--logfile FILE]
|
||||
[-V] [-c PATH] [-d PATH]
|
||||
[--userdir PATH]
|
||||
@@ -15,13 +15,13 @@ usage: freqtrade backtesting-analysis [-h] [-v] [--no-color] [--logfile FILE]
|
||||
|
||||
options:
|
||||
-h, --help show this help message and exit
|
||||
--backtest-filename PATH, --export-filename PATH
|
||||
--backtest-filename, --export-filename PATH
|
||||
Use this filename for backtest results.Example:
|
||||
`--backtest-
|
||||
filename=backtest_results_2020-09-27_16-20-48.json`.
|
||||
Assumes either `user_data/backtest_results/` or
|
||||
`--export-directory` as base directory.
|
||||
--backtest-directory PATH, --export-directory PATH
|
||||
--backtest-directory, --export-directory PATH
|
||||
Directory to use for backtest results. Example:
|
||||
`--export-directory=user_data/backtest_results/`.
|
||||
--analysis-groups {0,1,2,3,4,5} [{0,1,2,3,4,5} ...]
|
||||
@@ -54,21 +54,20 @@ 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
|
||||
--logfile, --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:
|
||||
-c, --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
|
||||
-d, --datadir, --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
|
||||
--userdir, --user-data-dir PATH
|
||||
Path to userdata directory.
|
||||
|
||||
```
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
```
|
||||
``` output
|
||||
usage: freqtrade backtesting-show [-h] [-v] [--no-color] [--logfile FILE] [-V]
|
||||
[-c PATH] [-d PATH] [--userdir PATH]
|
||||
[--backtest-filename PATH]
|
||||
@@ -8,13 +8,13 @@ usage: freqtrade backtesting-show [-h] [-v] [--no-color] [--logfile FILE] [-V]
|
||||
|
||||
options:
|
||||
-h, --help show this help message and exit
|
||||
--backtest-filename PATH, --export-filename PATH
|
||||
--backtest-filename, --export-filename PATH
|
||||
Use this filename for backtest results.Example:
|
||||
`--backtest-
|
||||
filename=backtest_results_2020-09-27_16-20-48.json`.
|
||||
Assumes either `user_data/backtest_results/` or
|
||||
`--export-directory` as base directory.
|
||||
--backtest-directory PATH, --export-directory PATH
|
||||
--backtest-directory, --export-directory PATH
|
||||
Directory to use for backtest results. Example:
|
||||
`--export-directory=user_data/backtest_results/`.
|
||||
--show-pair-list Show backtesting pairlist sorted by profit.
|
||||
@@ -26,21 +26,20 @@ 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
|
||||
--logfile, --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:
|
||||
-c, --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
|
||||
-d, --datadir, --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
|
||||
--userdir, --user-data-dir PATH
|
||||
Path to userdata directory.
|
||||
|
||||
```
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
```
|
||||
``` output
|
||||
usage: freqtrade backtesting [-h] [-v] [--no-color] [--logfile FILE] [-V]
|
||||
[-c PATH] [-d PATH] [--userdir PATH] [-s NAME]
|
||||
[--strategy-path PATH]
|
||||
@@ -23,7 +23,7 @@ usage: freqtrade backtesting [-h] [-v] [--no-color] [--logfile FILE] [-V]
|
||||
|
||||
options:
|
||||
-h, --help show this help message and exit
|
||||
-i TIMEFRAME, --timeframe TIMEFRAME
|
||||
-i, --timeframe TIMEFRAME
|
||||
Specify timeframe (`1m`, `5m`, `30m`, `1h`, `1d`).
|
||||
--timerange TIMERANGE
|
||||
Specify what timerange of data to use.
|
||||
@@ -38,7 +38,7 @@ options:
|
||||
setting.
|
||||
--fee FLOAT Specify fee ratio. Will be applied twice (on trade
|
||||
entry and exit).
|
||||
-p PAIRS [PAIRS ...], --pairs PAIRS [PAIRS ...]
|
||||
-p, --pairs PAIRS [PAIRS ...]
|
||||
Limit command to these pairs. Pairs are space-
|
||||
separated.
|
||||
--eps, --enable-position-stacking
|
||||
@@ -53,7 +53,7 @@ options:
|
||||
pairlist will be generated for each new candle if
|
||||
you're using a pairlist handler that supports this
|
||||
feature, for example, ShuffleFilter.
|
||||
--dry-run-wallet DRY_RUN_WALLET, --starting-balance DRY_RUN_WALLET
|
||||
--dry-run-wallet, --starting-balance DRY_RUN_WALLET
|
||||
Starting balance, used for backtesting / hyperopt and
|
||||
dry-runs.
|
||||
--timeframe-detail TIMEFRAME_DETAIL
|
||||
@@ -68,13 +68,13 @@ options:
|
||||
becomes `backtest-data-SampleStrategy.json`
|
||||
--export {none,trades,signals}
|
||||
Export backtest results (default: trades).
|
||||
--backtest-filename PATH, --export-filename PATH
|
||||
--backtest-filename, --export-filename PATH
|
||||
Use this filename for backtest results.Example:
|
||||
`--backtest-
|
||||
filename=backtest_results_2020-09-27_16-20-48.json`.
|
||||
Assumes either `user_data/backtest_results/` or
|
||||
`--export-directory` as base directory.
|
||||
--backtest-directory PATH, --export-directory PATH
|
||||
--backtest-directory, --export-directory PATH
|
||||
Directory to use for backtest results. Example:
|
||||
`--export-directory=user_data/backtest_results/`.
|
||||
--breakdown {day,week,month,year,weekday} [{day,week,month,year,weekday} ...]
|
||||
@@ -91,26 +91,24 @@ 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
|
||||
--logfile, --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:
|
||||
-c, --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
|
||||
-d, --datadir, --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
|
||||
--userdir, --user-data-dir PATH
|
||||
Path to userdata directory.
|
||||
|
||||
Strategy arguments:
|
||||
-s NAME, --strategy NAME
|
||||
Specify strategy class name which will be used by the
|
||||
-s, --strategy NAME Specify strategy class name which will be used by the
|
||||
bot.
|
||||
--strategy-path PATH Specify additional strategy lookup path.
|
||||
--recursive-strategy-search
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
```
|
||||
``` output
|
||||
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]
|
||||
[-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 ...]
|
||||
-p, --pairs PAIRS [PAIRS ...]
|
||||
Limit command to these pairs. Pairs are space-
|
||||
separated.
|
||||
--format-from {json,jsongz,feather,parquet}
|
||||
@@ -21,10 +21,10 @@ options:
|
||||
--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 ...]
|
||||
-t, --timeframes TIMEFRAMES [TIMEFRAMES ...]
|
||||
Specify which tickers to download. Space-separated
|
||||
list. Default: `1m 5m`.
|
||||
--trading-mode {spot,margin,futures}, --tradingmode {spot,margin,futures}
|
||||
--trading-mode, --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
|
||||
@@ -34,21 +34,20 @@ 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
|
||||
--logfile, --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:
|
||||
-c, --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
|
||||
-d, --datadir, --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
|
||||
--userdir, --user-data-dir PATH
|
||||
Path to userdata directory.
|
||||
|
||||
```
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
```
|
||||
``` output
|
||||
usage: freqtrade convert-db [-h] [--db-url PATH] [--db-url-from PATH]
|
||||
|
||||
options:
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
```
|
||||
``` output
|
||||
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}
|
||||
[-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 ...]
|
||||
-p, --pairs PAIRS [PAIRS ...]
|
||||
Limit command to these pairs. Pairs are space-
|
||||
separated.
|
||||
--format-from {json,jsongz,feather,parquet,kraken_csv}
|
||||
@@ -23,21 +23,20 @@ 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
|
||||
--logfile, --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:
|
||||
-c, --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
|
||||
-d, --datadir, --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
|
||||
--userdir, --user-data-dir PATH
|
||||
Path to userdata directory.
|
||||
|
||||
```
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
```
|
||||
``` output
|
||||
usage: freqtrade create-userdir [-h] [--userdir PATH] [--reset]
|
||||
|
||||
options:
|
||||
-h, --help show this help message and exit
|
||||
--userdir PATH, --user-data-dir PATH
|
||||
--userdir, --user-data-dir PATH
|
||||
Path to userdata directory.
|
||||
--reset Reset sample files to their original state.
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
```
|
||||
``` output
|
||||
usage: freqtrade download-data [-h] [-v] [--no-color] [--logfile FILE] [-V]
|
||||
[-c PATH] [-d PATH] [--userdir PATH]
|
||||
[-p PAIRS [PAIRS ...]] [--pairs-file FILE]
|
||||
@@ -15,7 +15,7 @@ usage: freqtrade download-data [-h] [-v] [--no-color] [--logfile FILE] [-V]
|
||||
|
||||
options:
|
||||
-h, --help show this help message and exit
|
||||
-p PAIRS [PAIRS ...], --pairs PAIRS [PAIRS ...]
|
||||
-p, --pairs PAIRS [PAIRS ...]
|
||||
Limit command to these pairs. Pairs are space-
|
||||
separated.
|
||||
--pairs-file FILE File containing a list of pairs. Takes precedence over
|
||||
@@ -37,7 +37,7 @@ options:
|
||||
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 ...]
|
||||
-t, --timeframes TIMEFRAMES [TIMEFRAMES ...]
|
||||
Specify which tickers to download. Space-separated
|
||||
list. Default: `1m 5m`.
|
||||
--erase Clean all existing data for the selected
|
||||
@@ -48,7 +48,7 @@ options:
|
||||
--data-format-trades {json,jsongz,feather,parquet}
|
||||
Storage format for downloaded trades data. (default:
|
||||
`feather`).
|
||||
--trading-mode {spot,margin,futures}, --tradingmode {spot,margin,futures}
|
||||
--trading-mode, --tradingmode {spot,margin,futures}
|
||||
Select Trading mode
|
||||
--prepend Allow data prepending. (Data-appending is disabled)
|
||||
|
||||
@@ -56,21 +56,20 @@ 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
|
||||
--logfile, --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:
|
||||
-c, --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
|
||||
-d, --datadir, --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
|
||||
--userdir, --user-data-dir PATH
|
||||
Path to userdata directory.
|
||||
|
||||
```
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
```
|
||||
``` output
|
||||
usage: freqtrade edge [-h] [-v] [--no-color] [--logfile FILE] [-V] [-c PATH]
|
||||
[-d PATH] [--userdir PATH] [-s NAME]
|
||||
[--strategy-path PATH] [--recursive-strategy-search]
|
||||
@@ -10,7 +10,7 @@ usage: freqtrade edge [-h] [-v] [--no-color] [--logfile FILE] [-V] [-c PATH]
|
||||
|
||||
options:
|
||||
-h, --help show this help message and exit
|
||||
-i TIMEFRAME, --timeframe TIMEFRAME
|
||||
-i, --timeframe TIMEFRAME
|
||||
Specify timeframe (`1m`, `5m`, `30m`, `1h`, `1d`).
|
||||
--timerange TIMERANGE
|
||||
Specify what timerange of data to use.
|
||||
@@ -25,7 +25,7 @@ options:
|
||||
setting.
|
||||
--fee FLOAT Specify fee ratio. Will be applied twice (on trade
|
||||
entry and exit).
|
||||
-p PAIRS [PAIRS ...], --pairs PAIRS [PAIRS ...]
|
||||
-p, --pairs PAIRS [PAIRS ...]
|
||||
Limit command to these pairs. Pairs are space-
|
||||
separated.
|
||||
|
||||
@@ -33,26 +33,24 @@ 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
|
||||
--logfile, --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:
|
||||
-c, --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
|
||||
-d, --datadir, --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
|
||||
--userdir, --user-data-dir PATH
|
||||
Path to userdata directory.
|
||||
|
||||
Strategy arguments:
|
||||
-s NAME, --strategy NAME
|
||||
Specify strategy class name which will be used by the
|
||||
-s, --strategy NAME Specify strategy class name which will be used by the
|
||||
bot.
|
||||
--strategy-path PATH Specify additional strategy lookup path.
|
||||
--recursive-strategy-search
|
||||
|
||||
197
docs/commands/freqtrade-client.md
Normal file
197
docs/commands/freqtrade-client.md
Normal file
@@ -0,0 +1,197 @@
|
||||
``` output
|
||||
Possible commands:
|
||||
|
||||
available_pairs
|
||||
Return available pair (backtest data) based on timeframe / stake_currency selection
|
||||
|
||||
:param timeframe: Only pairs with this timeframe available.
|
||||
:param stake_currency: Only pairs that include this stake currency.
|
||||
|
||||
balance
|
||||
Get the account balance.
|
||||
|
||||
blacklist
|
||||
Show the current blacklist.
|
||||
|
||||
:param add: List of coins to add (example: "BNB/BTC")
|
||||
|
||||
cancel_open_order
|
||||
Cancel open order for trade.
|
||||
|
||||
:param trade_id: Cancels open orders for this trade.
|
||||
|
||||
count
|
||||
Return the amount of open trades.
|
||||
|
||||
daily
|
||||
Return the profits for each day, and amount of trades.
|
||||
|
||||
delete_lock
|
||||
Delete (disable) lock from the database.
|
||||
|
||||
:param lock_id: ID for the lock to delete
|
||||
|
||||
delete_trade
|
||||
Delete trade from the database.
|
||||
Tries to close open orders. Requires manual handling of this asset on the exchange.
|
||||
|
||||
:param trade_id: Deletes the trade with this ID from the database.
|
||||
|
||||
entries
|
||||
Returns List of dicts containing all Trades, based on buy tag performance
|
||||
Can either be average for all pairs or a specific pair provided
|
||||
|
||||
exits
|
||||
Returns List of dicts containing all Trades, based on exit reason performance
|
||||
Can either be average for all pairs or a specific pair provided
|
||||
|
||||
forcebuy
|
||||
Buy an asset.
|
||||
|
||||
:param pair: Pair to buy (ETH/BTC)
|
||||
:param price: Optional - price to buy
|
||||
|
||||
forceenter
|
||||
Force entering a trade
|
||||
|
||||
:param pair: Pair to buy (ETH/BTC)
|
||||
:param side: 'long' or 'short'
|
||||
:param price: Optional - price to buy
|
||||
:param order_type: Optional keyword argument - 'limit' or 'market'
|
||||
:param stake_amount: Optional keyword argument - stake amount (as float)
|
||||
:param leverage: Optional keyword argument - leverage (as float)
|
||||
:param enter_tag: Optional keyword argument - entry tag (as string, default: 'force_enter')
|
||||
|
||||
forceexit
|
||||
Force-exit a trade.
|
||||
|
||||
:param tradeid: Id of the trade (can be received via status command)
|
||||
:param ordertype: Order type to use (must be market or limit)
|
||||
:param amount: Amount to sell. Full sell if not given
|
||||
|
||||
health
|
||||
Provides a quick health check of the running bot.
|
||||
|
||||
list_custom_data
|
||||
List custom-data of the running bot for a specific trade.
|
||||
|
||||
:param trade_id: ID of the trade
|
||||
:param key: str, optional - Key of the custom-data
|
||||
|
||||
list_open_trades_custom_data
|
||||
List open trades custom-data of the running bot.
|
||||
|
||||
:param key: str, optional - Key of the custom-data
|
||||
:param limit: limit of trades
|
||||
:param offset: trades offset for pagination
|
||||
|
||||
lock_add
|
||||
Lock pair
|
||||
|
||||
:param pair: Pair to lock
|
||||
:param until: Lock until this date (format "2024-03-30 16:00:00Z")
|
||||
:param side: Side to lock (long, short, *)
|
||||
:param reason: Reason for the lock
|
||||
|
||||
locks
|
||||
Return current locks
|
||||
|
||||
logs
|
||||
Show latest logs.
|
||||
|
||||
:param limit: Limits log messages to the last <limit> logs. No limit to get the entire log.
|
||||
|
||||
mix_tags
|
||||
Returns List of dicts containing all Trades, based on entry_tag + exit_reason performance
|
||||
Can either be average for all pairs or a specific pair provided
|
||||
|
||||
monthly
|
||||
Return the profits for each month, and amount of trades.
|
||||
|
||||
pair_candles
|
||||
Return live dataframe for <pair><timeframe>.
|
||||
|
||||
:param pair: Pair to get data for
|
||||
:param timeframe: Only pairs with this timeframe available.
|
||||
:param limit: Limit result to the last n candles.
|
||||
:param columns: List of dataframe columns to return. Empty list will return OHLCV.
|
||||
|
||||
pair_history
|
||||
Return historic, analyzed dataframe
|
||||
|
||||
:param pair: Pair to get data for
|
||||
:param timeframe: Only pairs with this timeframe available.
|
||||
:param strategy: Strategy to analyze and get values for
|
||||
:param freqaimodel: FreqAI model to use for analysis
|
||||
:param timerange: Timerange to get data for (same format than --timerange endpoints)
|
||||
|
||||
pairlists_available
|
||||
Lists available pairlist providers
|
||||
|
||||
performance
|
||||
Return the performance of the different coins.
|
||||
|
||||
ping
|
||||
simple ping
|
||||
|
||||
plot_config
|
||||
Return plot configuration if the strategy defines one.
|
||||
|
||||
profit
|
||||
Return the profit summary.
|
||||
|
||||
reload_config
|
||||
Reload configuration.
|
||||
|
||||
show_config
|
||||
Returns part of the configuration, relevant for trading operations.
|
||||
|
||||
start
|
||||
Start the bot if it's in the stopped state.
|
||||
|
||||
stats
|
||||
Return the stats report (durations, sell-reasons).
|
||||
|
||||
status
|
||||
Get the status of open trades.
|
||||
|
||||
stop
|
||||
Stop the bot. Use `start` to restart.
|
||||
|
||||
stopbuy
|
||||
Stop buying (but handle sells gracefully). Use `reload_config` to reset.
|
||||
|
||||
strategies
|
||||
Lists available strategies
|
||||
|
||||
strategy
|
||||
Get strategy details
|
||||
|
||||
:param strategy: Strategy class name
|
||||
|
||||
sysinfo
|
||||
Provides system information (CPU, RAM usage)
|
||||
|
||||
trade
|
||||
Return specific trade
|
||||
|
||||
:param trade_id: Specify which trade to get.
|
||||
|
||||
trades
|
||||
Return trades history, sorted by id (or by latest timestamp if order_by_id=False)
|
||||
|
||||
:param limit: Limits trades to the X last trades. Max 500 trades.
|
||||
:param offset: Offset by this amount of trades.
|
||||
:param order_by_id: Sort trades by id (default: True). If False, sorts by latest timestamp.
|
||||
|
||||
version
|
||||
Return the version of the bot.
|
||||
|
||||
weekly
|
||||
Return the profits for each week, and amount of trades.
|
||||
|
||||
whitelist
|
||||
Show the current whitelist.
|
||||
|
||||
|
||||
```
|
||||
@@ -1,4 +1,4 @@
|
||||
```
|
||||
``` output
|
||||
usage: freqtrade hyperopt-list [-h] [-v] [--no-color] [--logfile FILE] [-V]
|
||||
[-c PATH] [-d PATH] [--userdir PATH] [--best]
|
||||
[--profitable] [--min-trades INT]
|
||||
@@ -44,21 +44,20 @@ 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
|
||||
--logfile, --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:
|
||||
-c, --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
|
||||
-d, --datadir, --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
|
||||
--userdir, --user-data-dir PATH
|
||||
Path to userdata directory.
|
||||
|
||||
```
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
```
|
||||
``` output
|
||||
usage: freqtrade hyperopt-show [-h] [-v] [--no-color] [--logfile FILE] [-V]
|
||||
[-c PATH] [-d PATH] [--userdir PATH] [--best]
|
||||
[--profitable] [-n INT] [--print-json]
|
||||
@@ -10,7 +10,7 @@ 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.
|
||||
-n, --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-
|
||||
@@ -26,21 +26,20 @@ 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
|
||||
--logfile, --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:
|
||||
-c, --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
|
||||
-d, --datadir, --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
|
||||
--userdir, --user-data-dir PATH
|
||||
Path to userdata directory.
|
||||
|
||||
```
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
```
|
||||
``` output
|
||||
usage: freqtrade hyperopt [-h] [-v] [--no-color] [--logfile FILE] [-V]
|
||||
[-c PATH] [-d PATH] [--userdir PATH] [-s NAME]
|
||||
[--strategy-path PATH] [--recursive-strategy-search]
|
||||
@@ -11,16 +11,15 @@ usage: freqtrade hyperopt [-h] [-v] [--no-color] [--logfile FILE] [-V]
|
||||
[--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]
|
||||
[--spaces SPACES [SPACES ...]] [--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
|
||||
-i, --timeframe TIMEFRAME
|
||||
Specify timeframe (`1m`, `5m`, `30m`, `1h`, `1d`).
|
||||
--timerange TIMERANGE
|
||||
Specify what timerange of data to use.
|
||||
@@ -35,7 +34,7 @@ options:
|
||||
setting.
|
||||
--fee FLOAT Specify fee ratio. Will be applied twice (on trade
|
||||
entry and exit).
|
||||
-p PAIRS [PAIRS ...], --pairs PAIRS [PAIRS ...]
|
||||
-p, --pairs PAIRS [PAIRS ...]
|
||||
Limit command to these pairs. Pairs are space-
|
||||
separated.
|
||||
--hyperopt-path PATH Specify additional lookup path for Hyperopt Loss
|
||||
@@ -47,19 +46,23 @@ options:
|
||||
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
|
||||
--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} ...]
|
||||
-e, --epochs INT Specify number of epochs (default: 100).
|
||||
--spaces SPACES [SPACES ...]
|
||||
Specify which parameters to hyperopt. Space-separated
|
||||
list.
|
||||
list. Available builtin options (custom spaces will
|
||||
not be listed here): default, all, buy, sell, enter,
|
||||
exit, roi, stoploss, trailing, protection, trades.
|
||||
Default: `default` - which includes all spaces except
|
||||
for 'trailing', 'protection', and 'trades'.
|
||||
--print-all Print all results, not only the best ones.
|
||||
--print-json Print output in JSON format.
|
||||
-j JOBS, --job-workers JOBS
|
||||
-j, --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
|
||||
@@ -69,7 +72,7 @@ options:
|
||||
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
|
||||
--hyperopt-loss, --hyperoptloss NAME
|
||||
Specify the class name of the hyperopt loss function
|
||||
class (IHyperOptLoss). Different functions can
|
||||
generate completely different results, since the
|
||||
@@ -95,26 +98,24 @@ 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
|
||||
--logfile, --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:
|
||||
-c, --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
|
||||
-d, --datadir, --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
|
||||
--userdir, --user-data-dir PATH
|
||||
Path to userdata directory.
|
||||
|
||||
Strategy arguments:
|
||||
-s NAME, --strategy NAME
|
||||
Specify strategy class name which will be used by the
|
||||
-s, --strategy NAME Specify strategy class name which will be used by the
|
||||
bot.
|
||||
--strategy-path PATH Specify additional strategy lookup path.
|
||||
--recursive-strategy-search
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
```
|
||||
``` output
|
||||
usage: freqtrade install-ui [-h] [--erase] [--prerelease]
|
||||
[--ui-version UI_VERSION]
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
```
|
||||
``` output
|
||||
usage: freqtrade list-data [-h] [-v] [--no-color] [--logfile FILE] [-V]
|
||||
[-c PATH] [-d PATH] [--userdir PATH]
|
||||
[--exchange EXCHANGE]
|
||||
@@ -18,10 +18,10 @@ options:
|
||||
Storage format for downloaded trades data. (default:
|
||||
`feather`).
|
||||
--trades Work on trades data instead of OHLCV data.
|
||||
-p PAIRS [PAIRS ...], --pairs PAIRS [PAIRS ...]
|
||||
-p, --pairs PAIRS [PAIRS ...]
|
||||
Limit command to these pairs. Pairs are space-
|
||||
separated.
|
||||
--trading-mode {spot,margin,futures}, --tradingmode {spot,margin,futures}
|
||||
--trading-mode, --tradingmode {spot,margin,futures}
|
||||
Select Trading mode
|
||||
--show-timerange Show timerange available for available data. (May take
|
||||
a while to calculate).
|
||||
@@ -30,21 +30,20 @@ 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
|
||||
--logfile, --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:
|
||||
-c, --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
|
||||
-d, --datadir, --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
|
||||
--userdir, --user-data-dir PATH
|
||||
Path to userdata directory.
|
||||
|
||||
```
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
```
|
||||
``` output
|
||||
usage: freqtrade list-exchanges [-h] [-v] [--no-color] [--logfile FILE] [-V]
|
||||
[-c PATH] [-d PATH] [--userdir PATH] [-1] [-a]
|
||||
[--trading-mode {spot,margin,futures}]
|
||||
@@ -8,7 +8,7 @@ options:
|
||||
-h, --help show this help message and exit
|
||||
-1, --one-column Print output in one column.
|
||||
-a, --all Print all exchanges known to the ccxt library.
|
||||
--trading-mode {spot,margin,futures}, --tradingmode {spot,margin,futures}
|
||||
--trading-mode, --tradingmode {spot,margin,futures}
|
||||
Select Trading mode
|
||||
--dex-exchanges Print only DEX exchanges.
|
||||
|
||||
@@ -16,21 +16,20 @@ 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
|
||||
--logfile, --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:
|
||||
-c, --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
|
||||
-d, --datadir, --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
|
||||
--userdir, --user-data-dir PATH
|
||||
Path to userdata directory.
|
||||
|
||||
```
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
```
|
||||
``` output
|
||||
usage: freqtrade list-freqaimodels [-h] [-v] [--no-color] [--logfile FILE]
|
||||
[-V] [-c PATH] [-d PATH] [--userdir PATH]
|
||||
[--freqaimodel-path PATH] [-1]
|
||||
@@ -13,21 +13,20 @@ 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
|
||||
--logfile, --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:
|
||||
-c, --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
|
||||
-d, --datadir, --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
|
||||
--userdir, --user-data-dir PATH
|
||||
Path to userdata directory.
|
||||
|
||||
```
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
```
|
||||
``` output
|
||||
usage: freqtrade list-hyperoptloss [-h] [-v] [--no-color] [--logfile FILE]
|
||||
[-V] [-c PATH] [-d PATH] [--userdir PATH]
|
||||
[--hyperopt-path PATH] [-1]
|
||||
@@ -13,21 +13,20 @@ 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
|
||||
--logfile, --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:
|
||||
-c, --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
|
||||
-d, --datadir, --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
|
||||
--userdir, --user-data-dir PATH
|
||||
Path to userdata directory.
|
||||
|
||||
```
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
```
|
||||
``` output
|
||||
usage: freqtrade list-markets [-h] [-v] [--no-color] [--logfile FILE] [-V]
|
||||
[-c PATH] [-d PATH] [--userdir PATH]
|
||||
[--exchange EXCHANGE] [--print-list]
|
||||
@@ -21,28 +21,27 @@ options:
|
||||
Specify quote currency(-ies). Space-separated list.
|
||||
-a, --all Print all pairs or market symbols. By default only
|
||||
active ones are shown.
|
||||
--trading-mode {spot,margin,futures}, --tradingmode {spot,margin,futures}
|
||||
--trading-mode, --tradingmode {spot,margin,futures}
|
||||
Select Trading mode
|
||||
|
||||
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
|
||||
--logfile, --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:
|
||||
-c, --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
|
||||
-d, --datadir, --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
|
||||
--userdir, --user-data-dir PATH
|
||||
Path to userdata directory.
|
||||
|
||||
```
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
```
|
||||
``` output
|
||||
usage: freqtrade list-pairs [-h] [-v] [--no-color] [--logfile FILE] [-V]
|
||||
[-c PATH] [-d PATH] [--userdir PATH]
|
||||
[--exchange EXCHANGE] [--print-list]
|
||||
@@ -21,28 +21,27 @@ options:
|
||||
Specify quote currency(-ies). Space-separated list.
|
||||
-a, --all Print all pairs or market symbols. By default only
|
||||
active ones are shown.
|
||||
--trading-mode {spot,margin,futures}, --tradingmode {spot,margin,futures}
|
||||
--trading-mode, --tradingmode {spot,margin,futures}
|
||||
Select Trading mode
|
||||
|
||||
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
|
||||
--logfile, --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:
|
||||
-c, --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
|
||||
-d, --datadir, --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
|
||||
--userdir, --user-data-dir PATH
|
||||
Path to userdata directory.
|
||||
|
||||
```
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
```
|
||||
``` output
|
||||
usage: freqtrade list-strategies [-h] [-v] [--no-color] [--logfile FILE] [-V]
|
||||
[-c PATH] [-d PATH] [--userdir PATH]
|
||||
[--strategy-path PATH] [-1]
|
||||
@@ -16,21 +16,20 @@ 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
|
||||
--logfile, --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:
|
||||
-c, --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
|
||||
-d, --datadir, --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
|
||||
--userdir, --user-data-dir PATH
|
||||
Path to userdata directory.
|
||||
|
||||
```
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
```
|
||||
``` output
|
||||
usage: freqtrade list-timeframes [-h] [-v] [--no-color] [--logfile FILE] [-V]
|
||||
[-c PATH] [-d PATH] [--userdir PATH]
|
||||
[--exchange EXCHANGE] [-1]
|
||||
@@ -12,21 +12,20 @@ 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
|
||||
--logfile, --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:
|
||||
-c, --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
|
||||
-d, --datadir, --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
|
||||
--userdir, --user-data-dir PATH
|
||||
Path to userdata directory.
|
||||
|
||||
```
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
```
|
||||
``` output
|
||||
usage: freqtrade lookahead-analysis [-h] [-v] [--no-color] [--logfile FILE]
|
||||
[-V] [-c PATH] [-d PATH] [--userdir PATH]
|
||||
[-s NAME] [--strategy-path PATH]
|
||||
@@ -26,7 +26,7 @@ usage: freqtrade lookahead-analysis [-h] [-v] [--no-color] [--logfile FILE]
|
||||
|
||||
options:
|
||||
-h, --help show this help message and exit
|
||||
-i TIMEFRAME, --timeframe TIMEFRAME
|
||||
-i, --timeframe TIMEFRAME
|
||||
Specify timeframe (`1m`, `5m`, `30m`, `1h`, `1d`).
|
||||
--timerange TIMERANGE
|
||||
Specify what timerange of data to use.
|
||||
@@ -41,7 +41,7 @@ options:
|
||||
setting.
|
||||
--fee FLOAT Specify fee ratio. Will be applied twice (on trade
|
||||
entry and exit).
|
||||
-p PAIRS [PAIRS ...], --pairs PAIRS [PAIRS ...]
|
||||
-p, --pairs PAIRS [PAIRS ...]
|
||||
Limit command to these pairs. Pairs are space-
|
||||
separated.
|
||||
--enable-protections, --enableprotections
|
||||
@@ -53,7 +53,7 @@ options:
|
||||
pairlist will be generated for each new candle if
|
||||
you're using a pairlist handler that supports this
|
||||
feature, for example, ShuffleFilter.
|
||||
--dry-run-wallet DRY_RUN_WALLET, --starting-balance DRY_RUN_WALLET
|
||||
--dry-run-wallet, --starting-balance DRY_RUN_WALLET
|
||||
Starting balance, used for backtesting / hyperopt and
|
||||
dry-runs.
|
||||
--timeframe-detail TIMEFRAME_DETAIL
|
||||
@@ -68,13 +68,13 @@ options:
|
||||
becomes `backtest-data-SampleStrategy.json`
|
||||
--export {none,trades,signals}
|
||||
Export backtest results (default: trades).
|
||||
--backtest-filename PATH, --export-filename PATH
|
||||
--backtest-filename, --export-filename PATH
|
||||
Use this filename for backtest results.Example:
|
||||
`--backtest-
|
||||
filename=backtest_results_2020-09-27_16-20-48.json`.
|
||||
Assumes either `user_data/backtest_results/` or
|
||||
`--export-directory` as base directory.
|
||||
--backtest-directory PATH, --export-directory PATH
|
||||
--backtest-directory, --export-directory PATH
|
||||
Directory to use for backtest results. Example:
|
||||
`--export-directory=user_data/backtest_results/`.
|
||||
--freqai-backtest-live-models
|
||||
@@ -93,26 +93,24 @@ 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
|
||||
--logfile, --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:
|
||||
-c, --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
|
||||
-d, --datadir, --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
|
||||
--userdir, --user-data-dir PATH
|
||||
Path to userdata directory.
|
||||
|
||||
Strategy arguments:
|
||||
-s NAME, --strategy NAME
|
||||
Specify strategy class name which will be used by the
|
||||
-s, --strategy NAME Specify strategy class name which will be used by the
|
||||
bot.
|
||||
--strategy-path PATH Specify additional strategy lookup path.
|
||||
--recursive-strategy-search
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
```
|
||||
``` output
|
||||
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,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} ...
|
||||
|
||||
Free, open source crypto trading bot
|
||||
|
||||
|
||||
@@ -1,12 +1,11 @@
|
||||
```
|
||||
``` output
|
||||
usage: freqtrade new-config [-h] [-c PATH]
|
||||
|
||||
options:
|
||||
-h, --help show this help message 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.
|
||||
-h, --help show this help message and exit
|
||||
-c, --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.
|
||||
|
||||
```
|
||||
|
||||
@@ -1,14 +1,13 @@
|
||||
```
|
||||
``` output
|
||||
usage: freqtrade new-strategy [-h] [--userdir PATH] [-s NAME]
|
||||
[--strategy-path PATH]
|
||||
[--template {full,minimal,advanced}]
|
||||
|
||||
options:
|
||||
-h, --help show this help message and exit
|
||||
--userdir PATH, --user-data-dir PATH
|
||||
--userdir, --user-data-dir PATH
|
||||
Path to userdata directory.
|
||||
-s NAME, --strategy NAME
|
||||
Specify strategy class name which will be used by the
|
||||
-s, --strategy NAME Specify strategy class name which will be used by the
|
||||
bot.
|
||||
--strategy-path PATH Specify additional strategy lookup path.
|
||||
--template {full,minimal,advanced}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
```
|
||||
``` output
|
||||
usage: freqtrade plot-dataframe [-h] [-v] [--no-color] [--logfile FILE] [-V]
|
||||
[-c PATH] [-d PATH] [--userdir PATH] [-s NAME]
|
||||
[--strategy-path PATH]
|
||||
@@ -16,7 +16,7 @@ usage: freqtrade plot-dataframe [-h] [-v] [--no-color] [--logfile FILE] [-V]
|
||||
|
||||
options:
|
||||
-h, --help show this help message and exit
|
||||
-p PAIRS [PAIRS ...], --pairs PAIRS [PAIRS ...]
|
||||
-p, --pairs PAIRS [PAIRS ...]
|
||||
Limit command to these pairs. Pairs are space-
|
||||
separated.
|
||||
--indicators1 INDICATORS1 [INDICATORS1 ...]
|
||||
@@ -38,7 +38,7 @@ options:
|
||||
(backtest file)) Default: file
|
||||
--export {none,trades,signals}
|
||||
Export backtest results (default: trades).
|
||||
--backtest-filename PATH, --export-filename PATH
|
||||
--backtest-filename, --export-filename PATH
|
||||
Use this filename for backtest results.Example:
|
||||
`--backtest-
|
||||
filename=backtest_results_2020-09-27_16-20-48.json`.
|
||||
@@ -46,7 +46,7 @@ options:
|
||||
`--export-directory` as base directory.
|
||||
--timerange TIMERANGE
|
||||
Specify what timerange of data to use.
|
||||
-i TIMEFRAME, --timeframe TIMEFRAME
|
||||
-i, --timeframe TIMEFRAME
|
||||
Specify timeframe (`1m`, `5m`, `30m`, `1h`, `1d`).
|
||||
--no-trades Skip using trades from backtesting file and DB.
|
||||
|
||||
@@ -54,26 +54,24 @@ 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
|
||||
--logfile, --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:
|
||||
-c, --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
|
||||
-d, --datadir, --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
|
||||
--userdir, --user-data-dir PATH
|
||||
Path to userdata directory.
|
||||
|
||||
Strategy arguments:
|
||||
-s NAME, --strategy NAME
|
||||
Specify strategy class name which will be used by the
|
||||
-s, --strategy NAME Specify strategy class name which will be used by the
|
||||
bot.
|
||||
--strategy-path PATH Specify additional strategy lookup path.
|
||||
--recursive-strategy-search
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
```
|
||||
``` output
|
||||
usage: freqtrade plot-profit [-h] [-v] [--no-color] [--logfile FILE] [-V]
|
||||
[-c PATH] [-d PATH] [--userdir PATH] [-s NAME]
|
||||
[--strategy-path PATH]
|
||||
@@ -12,14 +12,14 @@ usage: freqtrade plot-profit [-h] [-v] [--no-color] [--logfile FILE] [-V]
|
||||
|
||||
options:
|
||||
-h, --help show this help message and exit
|
||||
-p PAIRS [PAIRS ...], --pairs PAIRS [PAIRS ...]
|
||||
-p, --pairs PAIRS [PAIRS ...]
|
||||
Limit command to these pairs. Pairs are space-
|
||||
separated.
|
||||
--timerange TIMERANGE
|
||||
Specify what timerange of data to use.
|
||||
--export {none,trades,signals}
|
||||
Export backtest results (default: trades).
|
||||
--backtest-filename PATH, --export-filename PATH
|
||||
--backtest-filename, --export-filename PATH
|
||||
Use this filename for backtest results.Example:
|
||||
`--backtest-
|
||||
filename=backtest_results_2020-09-27_16-20-48.json`.
|
||||
@@ -32,7 +32,7 @@ options:
|
||||
--trade-source {DB,file}
|
||||
Specify the source for trades (Can be DB or file
|
||||
(backtest file)) Default: file
|
||||
-i TIMEFRAME, --timeframe TIMEFRAME
|
||||
-i, --timeframe TIMEFRAME
|
||||
Specify timeframe (`1m`, `5m`, `30m`, `1h`, `1d`).
|
||||
--auto-open Automatically open generated plot.
|
||||
|
||||
@@ -40,26 +40,24 @@ 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
|
||||
--logfile, --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:
|
||||
-c, --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
|
||||
-d, --datadir, --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
|
||||
--userdir, --user-data-dir PATH
|
||||
Path to userdata directory.
|
||||
|
||||
Strategy arguments:
|
||||
-s NAME, --strategy NAME
|
||||
Specify strategy class name which will be used by the
|
||||
-s, --strategy NAME Specify strategy class name which will be used by the
|
||||
bot.
|
||||
--strategy-path PATH Specify additional strategy lookup path.
|
||||
--recursive-strategy-search
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
```
|
||||
``` output
|
||||
usage: freqtrade recursive-analysis [-h] [-v] [--no-color] [--logfile FILE]
|
||||
[-V] [-c PATH] [-d PATH] [--userdir PATH]
|
||||
[-s NAME] [--strategy-path PATH]
|
||||
@@ -12,14 +12,14 @@ usage: freqtrade recursive-analysis [-h] [-v] [--no-color] [--logfile FILE]
|
||||
|
||||
options:
|
||||
-h, --help show this help message and exit
|
||||
-i TIMEFRAME, --timeframe TIMEFRAME
|
||||
-i, --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`).
|
||||
-p PAIRS [PAIRS ...], --pairs PAIRS [PAIRS ...]
|
||||
-p, --pairs PAIRS [PAIRS ...]
|
||||
Limit command to these pairs. Pairs are space-
|
||||
separated.
|
||||
--startup-candle STARTUP_CANDLE [STARTUP_CANDLE ...]
|
||||
@@ -30,26 +30,24 @@ 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
|
||||
--logfile, --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:
|
||||
-c, --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
|
||||
-d, --datadir, --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
|
||||
--userdir, --user-data-dir PATH
|
||||
Path to userdata directory.
|
||||
|
||||
Strategy arguments:
|
||||
-s NAME, --strategy NAME
|
||||
Specify strategy class name which will be used by the
|
||||
-s, --strategy NAME Specify strategy class name which will be used by the
|
||||
bot.
|
||||
--strategy-path PATH Specify additional strategy lookup path.
|
||||
--recursive-strategy-search
|
||||
|
||||
@@ -1,13 +1,12 @@
|
||||
```
|
||||
``` output
|
||||
usage: freqtrade show-config [-h] [--userdir PATH] [-c PATH]
|
||||
[--show-sensitive]
|
||||
|
||||
options:
|
||||
-h, --help show this help message and exit
|
||||
--userdir PATH, --user-data-dir PATH
|
||||
--userdir, --user-data-dir PATH
|
||||
Path to userdata directory.
|
||||
-c PATH, --config PATH
|
||||
Specify configuration file (default:
|
||||
-c, --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.
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
```
|
||||
``` output
|
||||
usage: freqtrade show-trades [-h] [-v] [--no-color] [--logfile FILE] [-V]
|
||||
[-c PATH] [-d PATH] [--userdir PATH]
|
||||
[--db-url PATH]
|
||||
@@ -19,21 +19,20 @@ 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
|
||||
--logfile, --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:
|
||||
-c, --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
|
||||
-d, --datadir, --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
|
||||
--userdir, --user-data-dir PATH
|
||||
Path to userdata directory.
|
||||
|
||||
```
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
```
|
||||
``` output
|
||||
usage: freqtrade strategy-updater [-h] [-v] [--no-color] [--logfile FILE] [-V]
|
||||
[-c PATH] [-d PATH] [--userdir PATH]
|
||||
[--strategy-list STRATEGY_LIST [STRATEGY_LIST ...]]
|
||||
@@ -23,21 +23,20 @@ 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
|
||||
--logfile, --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:
|
||||
-c, --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
|
||||
-d, --datadir, --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
|
||||
--userdir, --user-data-dir PATH
|
||||
Path to userdata directory.
|
||||
|
||||
```
|
||||
|
||||
@@ -1,15 +1,14 @@
|
||||
```
|
||||
``` output
|
||||
usage: freqtrade test-pairlist [-h] [--userdir PATH] [-v] [-c PATH]
|
||||
[--quote QUOTE_CURRENCY [QUOTE_CURRENCY ...]]
|
||||
[-1] [--print-json] [--exchange EXCHANGE]
|
||||
|
||||
options:
|
||||
-h, --help show this help message and exit
|
||||
--userdir PATH, --user-data-dir PATH
|
||||
--userdir, --user-data-dir PATH
|
||||
Path to userdata directory.
|
||||
-v, --verbose Verbose mode (-vv for more, -vvv to get all messages).
|
||||
-c PATH, --config PATH
|
||||
Specify configuration file (default:
|
||||
-c, --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.
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
```
|
||||
``` output
|
||||
usage: freqtrade trade [-h] [-v] [--no-color] [--logfile FILE] [-V] [-c PATH]
|
||||
[-d PATH] [--userdir PATH] [-s NAME]
|
||||
[--strategy-path PATH] [--recursive-strategy-search]
|
||||
@@ -15,7 +15,7 @@ options:
|
||||
--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
|
||||
--dry-run-wallet, --starting-balance DRY_RUN_WALLET
|
||||
Starting balance, used for backtesting / hyperopt and
|
||||
dry-runs.
|
||||
--fee FLOAT Specify fee ratio. Will be applied twice (on trade
|
||||
@@ -25,26 +25,24 @@ 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
|
||||
--logfile, --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:
|
||||
-c, --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
|
||||
-d, --datadir, --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
|
||||
--userdir, --user-data-dir PATH
|
||||
Path to userdata directory.
|
||||
|
||||
Strategy arguments:
|
||||
-s NAME, --strategy NAME
|
||||
Specify strategy class name which will be used by the
|
||||
-s, --strategy NAME Specify strategy class name which will be used by the
|
||||
bot.
|
||||
--strategy-path PATH Specify additional strategy lookup path.
|
||||
--recursive-strategy-search
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
```
|
||||
``` output
|
||||
usage: freqtrade trades-to-ohlcv [-h] [-v] [--no-color] [--logfile FILE] [-V]
|
||||
[-c PATH] [-d PATH] [--userdir PATH]
|
||||
[-p PAIRS [PAIRS ...]]
|
||||
@@ -10,10 +10,10 @@ usage: freqtrade trades-to-ohlcv [-h] [-v] [--no-color] [--logfile FILE] [-V]
|
||||
|
||||
options:
|
||||
-h, --help show this help message and exit
|
||||
-p PAIRS [PAIRS ...], --pairs PAIRS [PAIRS ...]
|
||||
-p, --pairs PAIRS [PAIRS ...]
|
||||
Limit command to these pairs. Pairs are space-
|
||||
separated.
|
||||
-t TIMEFRAMES [TIMEFRAMES ...], --timeframes TIMEFRAMES [TIMEFRAMES ...]
|
||||
-t, --timeframes TIMEFRAMES [TIMEFRAMES ...]
|
||||
Specify which tickers to download. Space-separated
|
||||
list. Default: `1m 5m`.
|
||||
--exchange EXCHANGE Exchange name. Only valid if no config is provided.
|
||||
@@ -23,28 +23,27 @@ options:
|
||||
--data-format-trades {json,jsongz,feather,parquet}
|
||||
Storage format for downloaded trades data. (default:
|
||||
`feather`).
|
||||
--trading-mode {spot,margin,futures}, --tradingmode {spot,margin,futures}
|
||||
--trading-mode, --tradingmode {spot,margin,futures}
|
||||
Select Trading mode
|
||||
|
||||
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
|
||||
--logfile, --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:
|
||||
-c, --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
|
||||
-d, --datadir, --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
|
||||
--userdir, --user-data-dir PATH
|
||||
Path to userdata directory.
|
||||
|
||||
```
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
```
|
||||
``` output
|
||||
usage: freqtrade webserver [-h] [-v] [--no-color] [--logfile FILE] [-V]
|
||||
[-c PATH] [-d PATH] [--userdir PATH]
|
||||
|
||||
@@ -9,21 +9,20 @@ 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
|
||||
--logfile, --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:
|
||||
-c, --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
|
||||
-d, --datadir, --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
|
||||
--userdir, --user-data-dir PATH
|
||||
Path to userdata directory.
|
||||
|
||||
```
|
||||
|
||||
@@ -407,11 +407,12 @@ To use these with Freqtrade, you will need to use the following configuration pa
|
||||
``` json
|
||||
"exchange": {
|
||||
"name": "hyperliquid",
|
||||
"walletAddress": "your_vault_address", // Vault or subaccount address
|
||||
"privateKey": "your_api_private_key",
|
||||
"walletAddress": "your_master_wallet_address", // Your master wallet address (not the API wallet address and not the vault/subaccount address).
|
||||
"privateKey": "your_api_private_key", // API wallet private key (see https://app.hyperliquid.xyz/API). You'll only need the private key.
|
||||
"ccxt_config": {
|
||||
"options": {
|
||||
"vaultAddress": "your_vault_address" // Optional, only if you want to use a vault or subaccount
|
||||
"vaultAddress": "your_vault_address", // Optional, only if you want to use a vault ...
|
||||
"subAccountAddress": "your_subaccount_address" // OR optional, only if you want to use a subaccount
|
||||
}
|
||||
},
|
||||
// ...
|
||||
@@ -420,6 +421,9 @@ To use these with Freqtrade, you will need to use the following configuration pa
|
||||
|
||||
Your balance and trades will now be used from your vault / subaccount - and no longer from your main account.
|
||||
|
||||
!!! Note
|
||||
You can only use either a vault or a subaccount - not both at the same time.
|
||||
|
||||
### Historic Hyperliquid data
|
||||
|
||||
The Hyperliquid API does not provide historic data beyond the single call to fetch current data, so downloading data is not possible, as the downloaded data would not constitute proper historic data.
|
||||
|
||||
@@ -46,10 +46,17 @@ Depending on the space you want to optimize, only some of the below are required
|
||||
|
||||
* define parameters with `space='buy'` - for entry signal optimization
|
||||
* define parameters with `space='sell'` - for exit signal optimization
|
||||
* define parameters with `space='enter'` - for entry signal optimization
|
||||
* define parameters with `space='exit'` - for exit signal optimization
|
||||
* define parameters with `space='protection'` - for protection optimization
|
||||
* define parameters with `space='random_spacename'` - for better control over which parameters are optimized together
|
||||
|
||||
Pick the space name that suits the parameter best. We recommend to use either `buy` / `sell` or `enter` / `exit` for clarity (however there's no technical limitation in this regard).
|
||||
|
||||
!!! Note
|
||||
`populate_indicators` needs to create all indicators any of the spaces may use, otherwise hyperopt will not work.
|
||||
|
||||
|
||||
Rarely you may also need to create a [nested class](advanced-hyperopt.md#overriding-pre-defined-spaces) named `HyperOpt` and implement
|
||||
|
||||
* `roi_space` - for custom ROI optimization (if you need the ranges for the ROI parameters in the optimization hyperspace that differ from default)
|
||||
@@ -79,15 +86,15 @@ Based on the loss function result, hyperopt will determine the next set of param
|
||||
|
||||
### Configure your Guards and Triggers
|
||||
|
||||
There are two places you need to change in your strategy file to add a new buy hyperopt for testing:
|
||||
There are two places you need to change in your strategy file to add a new hyperopt parameter for optimization:
|
||||
|
||||
* Define the parameters at the class level hyperopt shall be optimizing.
|
||||
* Within `populate_entry_trend()` - use defined parameter values instead of raw constants.
|
||||
|
||||
There you have two different types of indicators: 1. `guards` and 2. `triggers`.
|
||||
|
||||
1. Guards are conditions like "never buy if ADX < 10", or never buy if current price is over EMA10.
|
||||
2. Triggers are ones that actually trigger buy in specific moment, like "buy when EMA5 crosses over EMA10" or "buy when close price touches lower Bollinger band".
|
||||
1. Guards are conditions like "never enter if ADX < 10", or never enter if current price is over EMA10.
|
||||
2. Triggers are ones that actually trigger entry in specific moment, like "enter when EMA5 crosses over EMA10" or "enter when close price touches lower Bollinger band".
|
||||
|
||||
!!! Hint "Guards and Triggers"
|
||||
Technically, there is no difference between Guards and Triggers.
|
||||
@@ -160,9 +167,11 @@ We use these to either enable or disable the ADX and RSI guards.
|
||||
The last one we call `trigger` and use it to decide which buy trigger we want to use.
|
||||
|
||||
!!! Note "Parameter space assignment"
|
||||
Parameters must either be assigned to a variable named `buy_*` or `sell_*` - or contain `space='buy'` | `space='sell'` to be assigned to a space correctly.
|
||||
If no parameter is available for a space, you'll receive the error that no space was found when running hyperopt.
|
||||
- Parameters must either be assigned to a variable named `buy_*`, `sell_*`, `enter_*` or `exit_*` or `protection_*` - or contain have a space assigned explicitly via parameter (`space='buy'`, `space='sell'`, `space='protection'`).
|
||||
- Parameters with conflicting assignments (e.g. `buy_adx = IntParameter(4, 24, default=14, space='sell')`) will use the explicit space assignment.
|
||||
- If no parameter is available for a space, you'll receive the error that no space was found when running hyperopt.
|
||||
Parameters with unclear space (e.g. `adx_period = IntParameter(4, 24, default=14)` - no explicit nor implicit space) will not be detected and will therefore be ignored.
|
||||
Spaces can also be custom named (e.g. `space='my_custom_space'`), with the only limitation that the space name cannot be `all`, `default` - and must result in a valid python identifier.
|
||||
|
||||
So let's write the buy strategy using these values:
|
||||
|
||||
@@ -520,21 +529,24 @@ freqtrade hyperopt --strategy <strategyname> --timerange 20210101-20210201
|
||||
### Running Hyperopt with Smaller Search Space
|
||||
|
||||
Use the `--spaces` option to limit the search space used by hyperopt.
|
||||
Letting Hyperopt optimize everything is a huuuuge search space.
|
||||
Often it might make more sense to start by just searching for initial buy algorithm.
|
||||
Or maybe you just want to optimize your stoploss or roi table for that awesome new buy strategy you have.
|
||||
Letting Hyperopt optimize everything is often a huuuuge search space.
|
||||
Often it might make more sense to start by just searching for initial entry algorithm.
|
||||
Or maybe you just want to optimize your stoploss or roi table for that awesome new strategy you have.
|
||||
|
||||
Legal values are:
|
||||
|
||||
* `all`: optimize everything
|
||||
* `all`: optimize everything (including custom spaces)
|
||||
* `buy`: just search for a new buy strategy
|
||||
* `sell`: just search for a new sell strategy
|
||||
* `enter`: just search for a new entry logic
|
||||
* `exit`: just search for a new entry logic
|
||||
* `roi`: just optimize the minimal profit table for your strategy
|
||||
* `stoploss`: search for the best stoploss value
|
||||
* `trailing`: search for the best trailing stop values
|
||||
* `trades`: search for the best max open trades values
|
||||
* `protection`: search for the best protection parameters (read the [protections section](#optimizing-protections) on how to properly define these)
|
||||
* `default`: `all` except `trailing`, `trades` and `protection`
|
||||
* `custom_space_name`: any custom space used by any parameter in your strategy
|
||||
* space-separated list of any of the above values for example `--spaces roi stoploss`
|
||||
|
||||
The default Hyperopt Search Space, used when no `--space` command line option is specified, does not include the `trailing` hyperspace. We recommend you to run optimization for the `trailing` hyperspace separately, when the best parameters for other hyperspaces were found, validated and pasted into your custom strategy.
|
||||
|
||||
@@ -367,7 +367,7 @@ The optional `bearer_token` will be included in the requests Authorization Heade
|
||||
|
||||
#### MarketCapPairList
|
||||
|
||||
`MarketCapPairList` employs sorting/filtering of pairs by their marketcap rank based of CoinGecko. The returned pairlist will be sorted based of their marketcap ranks.
|
||||
`MarketCapPairList` employs sorting/filtering of pairs by their marketcap rank based of CoinGecko. The returned pairlist will be sorted based of their marketcap ranks if used in whitelist `mode`.
|
||||
|
||||
```json
|
||||
"pairlists": [
|
||||
@@ -376,16 +376,21 @@ The optional `bearer_token` will be included in the requests Authorization Heade
|
||||
"number_assets": 20,
|
||||
"max_rank": 50,
|
||||
"refresh_period": 86400,
|
||||
"mode": "whitelist",
|
||||
"categories": ["layer-1"]
|
||||
}
|
||||
]
|
||||
```
|
||||
|
||||
`number_assets` defines the maximum number of pairs returned by the pairlist. `max_rank` will determine the maximum rank used in creating/filtering the pairlist. It's expected that some coins within the top `max_rank` marketcap will not be included in the resulting pairlist since not all pairs will have active trading pairs in your preferred market/stake/exchange combination.
|
||||
`number_assets` defines the maximum number of pairs returned by the pairlist if used in whitelist `mode`. In blacklist `mode`, this setting will be ignored.
|
||||
|
||||
`max_rank` will determine the maximum rank used in creating/filtering the pairlist. It's expected that some coins within the top `max_rank` marketcap will not be included in the resulting pairlist since not all pairs will have active trading pairs in your preferred market/stake/exchange combination.
|
||||
While using a `max_rank` bigger than 250 is supported, it's not recommended, as it'll cause multiple API calls to CoinGecko, which can lead to rate limit issues.
|
||||
|
||||
The `refresh_period` setting defines the interval (in seconds) at which the marketcap rank data will be refreshed. The default is 86,400 seconds (1 day). The pairlist cache (`refresh_period`) applies to both generating pairlists (when in the first position in the list) and filtering instances (when not in the first position in the list).
|
||||
|
||||
The `mode` setting defines whether the plugin will filters in (whitelist `mode`) or filters out (blacklist `mode`) top marketcap ranked coins. By default, the plugin will be in whitelist mode.
|
||||
|
||||
The `categories` setting specifies the [coingecko categories](https://www.coingecko.com/en/categories) from which to select coins from. The default is an empty list `[]`, meaning no category filtering is applied.
|
||||
If an incorrect category string is chosen, the plugin will print the available categories from CoinGecko and fail. The category should be the ID of the category, for example, for `https://www.coingecko.com/en/categories/layer-1`, the category ID would be `layer-1`. You can pass multiple categories such as `["layer-1", "meme-token"]` to select from several categories.
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||

|
||||
|
||||
[](https://github.com/freqtrade/freqtrade/actions/)
|
||||
[](https://github.com/freqtrade/freqtrade/actions/workflows/ci.yml)
|
||||
[](https://doi.org/10.21105/joss.04864)
|
||||
[](https://coveralls.io/github/freqtrade/freqtrade?branch=develop)
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
markdown==3.9
|
||||
markdown==3.10
|
||||
mkdocs==1.6.1
|
||||
mkdocs-material==9.6.22
|
||||
mkdocs-material==9.6.23
|
||||
mdx_truly_sane_lists==1.3
|
||||
pymdown-extensions==10.16.1
|
||||
jinja2==3.1.6
|
||||
|
||||
176
docs/rest-api.md
176
docs/rest-api.md
@@ -150,184 +150,16 @@ This method will work for all arguments - check the "show" command for a list of
|
||||
|
||||
For a full list of available commands, please refer to the list below.
|
||||
|
||||
#### Freqtrade client- available commands
|
||||
|
||||
Possible commands can be listed from the rest-client script using the `help` command.
|
||||
|
||||
``` bash
|
||||
freqtrade-client help
|
||||
```
|
||||
|
||||
``` output
|
||||
Possible commands:
|
||||
--8<-- "commands/freqtrade-client.md"
|
||||
|
||||
available_pairs
|
||||
Return available pair (backtest data) based on timeframe / stake_currency selection
|
||||
|
||||
:param timeframe: Only pairs with this timeframe available.
|
||||
:param stake_currency: Only pairs that include this timeframe
|
||||
|
||||
balance
|
||||
Get the account balance.
|
||||
|
||||
blacklist
|
||||
Show the current blacklist.
|
||||
|
||||
:param add: List of coins to add (example: "BNB/BTC")
|
||||
|
||||
cancel_open_order
|
||||
Cancel open order for trade.
|
||||
|
||||
:param trade_id: Cancels open orders for this trade.
|
||||
|
||||
count
|
||||
Return the amount of open trades.
|
||||
|
||||
daily
|
||||
Return the profits for each day, and amount of trades.
|
||||
|
||||
delete_lock
|
||||
Delete (disable) lock from the database.
|
||||
|
||||
:param lock_id: ID for the lock to delete
|
||||
|
||||
delete_trade
|
||||
Delete trade from the database.
|
||||
Tries to close open orders. Requires manual handling of this asset on the exchange.
|
||||
|
||||
:param trade_id: Deletes the trade with this ID from the database.
|
||||
|
||||
forcebuy
|
||||
Buy an asset.
|
||||
|
||||
:param pair: Pair to buy (ETH/BTC)
|
||||
:param price: Optional - price to buy
|
||||
|
||||
forceenter
|
||||
Force entering a trade
|
||||
|
||||
:param pair: Pair to buy (ETH/BTC)
|
||||
:param side: 'long' or 'short'
|
||||
:param price: Optional - price to buy
|
||||
|
||||
forceexit
|
||||
Force-exit a trade.
|
||||
|
||||
:param tradeid: Id of the trade (can be received via status command)
|
||||
:param ordertype: Order type to use (must be market or limit)
|
||||
:param amount: Amount to sell. Full sell if not given
|
||||
|
||||
health
|
||||
Provides a quick health check of the running bot.
|
||||
|
||||
lock_add
|
||||
Manually lock a specific pair
|
||||
|
||||
:param pair: Pair to lock
|
||||
:param until: Lock until this date (format "2024-03-30 16:00:00Z")
|
||||
:param side: Side to lock (long, short, *)
|
||||
:param reason: Reason for the lock
|
||||
|
||||
locks
|
||||
Return current locks
|
||||
|
||||
logs
|
||||
Show latest logs.
|
||||
|
||||
:param limit: Limits log messages to the last <limit> logs. No limit to get the entire log.
|
||||
|
||||
pair_candles
|
||||
Return live dataframe for <pair><timeframe>.
|
||||
|
||||
:param pair: Pair to get data for
|
||||
:param timeframe: Only pairs with this timeframe available.
|
||||
:param limit: Limit result to the last n candles.
|
||||
|
||||
pair_history
|
||||
Return historic, analyzed dataframe
|
||||
|
||||
:param pair: Pair to get data for
|
||||
:param timeframe: Only pairs with this timeframe available.
|
||||
:param strategy: Strategy to analyze and get values for
|
||||
:param timerange: Timerange to get data for (same format than --timerange endpoints)
|
||||
|
||||
performance
|
||||
Return the performance of the different coins.
|
||||
|
||||
ping
|
||||
simple ping
|
||||
|
||||
plot_config
|
||||
Return plot configuration if the strategy defines one.
|
||||
|
||||
profit
|
||||
Return the profit summary.
|
||||
|
||||
reload_config
|
||||
Reload configuration.
|
||||
|
||||
show_config
|
||||
Returns part of the configuration, relevant for trading operations.
|
||||
|
||||
start
|
||||
Start the bot if it's in the stopped state.
|
||||
|
||||
pause
|
||||
Pause the bot if it's in the running state. If triggered on stopped state will handle open positions.
|
||||
|
||||
stats
|
||||
Return the stats report (durations, sell-reasons).
|
||||
|
||||
status
|
||||
Get the status of open trades.
|
||||
|
||||
stop
|
||||
Stop the bot. Use `start` to restart.
|
||||
|
||||
stopbuy
|
||||
Stop buying (but handle sells gracefully). Use `reload_config` to reset.
|
||||
|
||||
strategies
|
||||
Lists available strategies
|
||||
|
||||
strategy
|
||||
Get strategy details
|
||||
|
||||
:param strategy: Strategy class name
|
||||
|
||||
sysinfo
|
||||
Provides system information (CPU, RAM usage)
|
||||
|
||||
trade
|
||||
Return specific trade
|
||||
|
||||
:param trade_id: Specify which trade to get.
|
||||
|
||||
trades
|
||||
Return trades history, sorted by id
|
||||
|
||||
:param limit: Limits trades to the X last trades. Max 500 trades.
|
||||
:param offset: Offset by this amount of trades.
|
||||
|
||||
list_open_trades_custom_data
|
||||
Return a dict containing open trades custom-datas
|
||||
|
||||
:param key: str, optional - Key of the custom-data
|
||||
:param limit: Limits trades to X trades.
|
||||
:param offset: Offset by this amount of trades.
|
||||
|
||||
list_custom_data
|
||||
Return a dict containing custom-datas of a specified trade
|
||||
|
||||
:param trade_id: int - ID of the trade
|
||||
:param key: str, optional - Key of the custom-data
|
||||
|
||||
version
|
||||
Return the version of the bot.
|
||||
|
||||
whitelist
|
||||
Show the current whitelist.
|
||||
|
||||
|
||||
```
|
||||
|
||||
### Available endpoints
|
||||
|
||||
@@ -359,7 +191,7 @@ All endpoints in the below table need to be prefixed with the base URL of the AP
|
||||
| `/locks/<lockid>` | DELETE | Deletes (disables) the lock by id.<br/>*Params:*<br/>- `lockid` (`int`)
|
||||
| `/profit` | GET | Display a summary of your profit/loss from close trades and some stats about your performance.
|
||||
| `/forceexit` | POST | Instantly exits the given trade (ignoring `minimum_roi`), using the given order type ("market" or "limit", uses your config setting if not specified), and the chosen amount (full sell if not specified). If `all` is supplied as the `tradeid`, then all currently open trades will be forced to exit.<br/>*Params:*<br/>- `<tradeid>` (`int` or `str`)<br/>- `<ordertype>` (`str`)<br/>- `[amount]` (`float`)
|
||||
| `/forceenter` | POST | Instantly enters the given pair. Side is optional and is either `long` or `short` (default is `long`). Rate is optional. (`force_entry_enable` must be set to True)<br/>*Params:*<br/>- `<pair>` (`str`)<br/>- `<side>` (`str`)<br/>- `[rate]` (`float`)
|
||||
| `/forceenter` | POST | Instantly enters the given pair. Side is optional and is either `long` or `short` (default is `long`). Price, stake amount, entry tag and leverage are optional. Order type is optional and is either `market` or `long` (default using the value set in config). (`force_entry_enable` must be set to True)<br/>*Params:*<br/>- `<pair>` (`str`)<br/>- `<side>` (`str`)<br/>- `[price]` (`float`)<br/>- `[ordertype]` (`str`)<br/>- `[stakeamount]` (`float`)<br/>- `[entry_tag]` (`str`)<br/>- `[leverage]` (`float`)
|
||||
| `/performance` | GET | Show performance of each finished trade grouped by pair.
|
||||
| `/balance` | GET | Show account balance per currency.
|
||||
| `/daily` | GET | Shows profit or loss per day, over the last n days (n defaults to 7).<br/>*Params:*<br/>- `timescale` (`int`)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
"""Freqtrade bot"""
|
||||
|
||||
__version__ = "2025.10"
|
||||
__version__ = "2025.11-dev"
|
||||
|
||||
if "dev" in __version__:
|
||||
from pathlib import Path
|
||||
|
||||
@@ -5,7 +5,10 @@ Definition of cli arguments used in arguments.py
|
||||
from argparse import ArgumentTypeError
|
||||
|
||||
from freqtrade import constants
|
||||
from freqtrade.constants import HYPEROPT_LOSS_BUILTIN
|
||||
from freqtrade.constants import (
|
||||
HYPEROPT_BUILTIN_SPACE_OPTIONS,
|
||||
HYPEROPT_LOSS_BUILTIN,
|
||||
)
|
||||
from freqtrade.enums import CandleType
|
||||
|
||||
|
||||
@@ -278,26 +281,18 @@ AVAILABLE_CLI_OPTIONS = {
|
||||
),
|
||||
"spaces": Arg(
|
||||
"--spaces",
|
||||
help="Specify which parameters to hyperopt. Space-separated list.",
|
||||
choices=[
|
||||
"all",
|
||||
"buy",
|
||||
"sell",
|
||||
"roi",
|
||||
"stoploss",
|
||||
"trailing",
|
||||
"protection",
|
||||
"trades",
|
||||
"default",
|
||||
],
|
||||
help=(
|
||||
"Specify which parameters to hyperopt. Space-separated list. "
|
||||
"Available builtin options (custom spaces will not be listed here): "
|
||||
f"{', '.join(HYPEROPT_BUILTIN_SPACE_OPTIONS)}. Default: `default` - "
|
||||
"which includes all spaces except for 'trailing', 'protection', and 'trades'."
|
||||
),
|
||||
nargs="+",
|
||||
default="default",
|
||||
),
|
||||
"analyze_per_epoch": Arg(
|
||||
"--analyze-per-epoch",
|
||||
help="Run populate_indicators once per epoch.",
|
||||
action="store_true",
|
||||
default=False,
|
||||
),
|
||||
"print_all": Arg(
|
||||
"--print-all",
|
||||
|
||||
@@ -101,7 +101,7 @@ def _print_objs_tabular(objs: list, print_colorized: bool) -> None:
|
||||
names = [s["name"] for s in objs]
|
||||
objs_to_print: list[dict[str, Text | str]] = [
|
||||
{
|
||||
"name": Text(s["name"] if s["name"] else "--"),
|
||||
"Strategy name": Text(s["name"] if s["name"] else "--"),
|
||||
"location": s["location_rel"],
|
||||
"status": (
|
||||
Text("LOAD FAILED", style="bold red")
|
||||
@@ -115,11 +115,19 @@ def _print_objs_tabular(objs: list, print_colorized: bool) -> None:
|
||||
]
|
||||
for idx, s in enumerate(objs):
|
||||
if "hyperoptable" in s:
|
||||
custom_params = [
|
||||
f"{space}: {len(params)}"
|
||||
for space, params in s["hyperoptable"].items()
|
||||
if space not in ["buy", "sell", "protection"]
|
||||
]
|
||||
hyp = s["hyperoptable"]
|
||||
objs_to_print[idx].update(
|
||||
{
|
||||
"hyperoptable": "Yes" if s["hyperoptable"]["count"] > 0 else "No",
|
||||
"buy-Params": str(len(s["hyperoptable"].get("buy", []))),
|
||||
"sell-Params": str(len(s["hyperoptable"].get("sell", []))),
|
||||
"hyperoptable": "Yes" if len(hyp) > 0 else "No",
|
||||
"buy-Params": str(len(hyp.get("buy", []))),
|
||||
"sell-Params": str(len(hyp.get("sell", []))),
|
||||
"protection-Params": str(len(hyp.get("protection", []))),
|
||||
"custom-Params": ", ".join(custom_params) if custom_params else "",
|
||||
}
|
||||
)
|
||||
table = Table()
|
||||
@@ -140,6 +148,7 @@ def start_list_strategies(args: dict[str, Any]) -> None:
|
||||
"""
|
||||
from freqtrade.configuration import setup_utils_configuration
|
||||
from freqtrade.resolvers import StrategyResolver
|
||||
from freqtrade.strategy.hyper import detect_all_parameters
|
||||
|
||||
config = setup_utils_configuration(args, RunMode.UTIL_NO_EXCHANGE)
|
||||
|
||||
@@ -153,9 +162,9 @@ def start_list_strategies(args: dict[str, Any]) -> None:
|
||||
strategy_objs = sorted(strategy_objs, key=lambda x: x["name"])
|
||||
for obj in strategy_objs:
|
||||
if obj["class"]:
|
||||
obj["hyperoptable"] = obj["class"].detect_all_parameters()
|
||||
obj["hyperoptable"] = detect_all_parameters(obj["class"])
|
||||
else:
|
||||
obj["hyperoptable"] = {"count": 0}
|
||||
obj["hyperoptable"] = {}
|
||||
|
||||
if args["print_one_column"]:
|
||||
print("\n".join([s["name"] for s in strategy_objs]))
|
||||
|
||||
@@ -1,11 +1,14 @@
|
||||
# Required json-schema for user specified config
|
||||
|
||||
|
||||
from freqtrade.constants import (
|
||||
AVAILABLE_DATAHANDLERS,
|
||||
AVAILABLE_PAIRLISTS,
|
||||
BACKTEST_BREAKDOWNS,
|
||||
BACKTEST_CACHE_AGE,
|
||||
DRY_RUN_WALLET,
|
||||
EXPORT_OPTIONS,
|
||||
HYPEROPT_LOSS_BUILTIN,
|
||||
MARGIN_MODES,
|
||||
ORDERTIF_POSSIBILITIES,
|
||||
ORDERTYPE_POSSIBILITIES,
|
||||
@@ -228,6 +231,76 @@ CONF_SCHEMA = {
|
||||
"type": "array",
|
||||
"items": {"type": "string", "enum": BACKTEST_BREAKDOWNS},
|
||||
},
|
||||
"backtest_cache": {
|
||||
"description": "Load a cached backtest result no older than specified age.",
|
||||
"type": "string",
|
||||
"enum": BACKTEST_CACHE_AGE,
|
||||
},
|
||||
# Hyperopt
|
||||
"hyperopt_path": {
|
||||
"description": "Specify additional lookup path for Hyperopt Loss functions.",
|
||||
"type": "string",
|
||||
},
|
||||
"epochs": {
|
||||
"description": "Number of training epochs for Hyperopt.",
|
||||
"type": "integer",
|
||||
"minimum": 1,
|
||||
},
|
||||
"early_stop": {
|
||||
"description": (
|
||||
"Early stop hyperopt if no improvement after <epochs>. Set to 0 to disable."
|
||||
),
|
||||
"type": "integer",
|
||||
"minimum": 0,
|
||||
},
|
||||
"spaces": {
|
||||
"description": (
|
||||
"Hyperopt parameter spaces to optimize. Default is the default set and"
|
||||
"includes all spaces except for 'trailing', 'protection', and 'trades'."
|
||||
),
|
||||
"type": "array",
|
||||
"items": {"type": "string"},
|
||||
"default": ["default"],
|
||||
},
|
||||
"analyze_per_epoch": {
|
||||
"description": "Perform analysis after each epoch in Hyperopt.",
|
||||
"type": "boolean",
|
||||
},
|
||||
"print_all": {
|
||||
"description": "Print all hyperopt trials, not just the best ones.",
|
||||
"type": "boolean",
|
||||
"default": False,
|
||||
},
|
||||
"hyperopt_jobs": {
|
||||
"description": (
|
||||
"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 is used."
|
||||
),
|
||||
"type": "integer",
|
||||
"default": -1,
|
||||
},
|
||||
"hyperopt_random_state": {
|
||||
"description": "Random state for hyperopt trials.",
|
||||
"type": "integer",
|
||||
"minimum": 0,
|
||||
},
|
||||
"hyperopt_min_trades": {
|
||||
"description": "Minimum number of trades per epoch for hyperopt.",
|
||||
"type": "integer",
|
||||
"minimum": 0,
|
||||
},
|
||||
"hyperopt_loss": {
|
||||
"description": (
|
||||
"The class name of the hyperopt loss function class (IHyperOptLoss). "
|
||||
"Different functions can generate completely different results, "
|
||||
"since the target for optimization is different. "
|
||||
f"Built-in Hyperopt-loss-functions are: {', '.join(HYPEROPT_LOSS_BUILTIN)}"
|
||||
),
|
||||
"type": "string",
|
||||
},
|
||||
# end hyperopt
|
||||
"bot_name": {
|
||||
"description": "Name of the trading bot. Passed via API to a client.",
|
||||
"type": "string",
|
||||
|
||||
@@ -41,6 +41,19 @@ HYPEROPT_LOSS_BUILTIN = [
|
||||
"ProfitDrawDownHyperOptLoss",
|
||||
"MultiMetricHyperOptLoss",
|
||||
]
|
||||
HYPEROPT_BUILTIN_SPACES = [
|
||||
"buy",
|
||||
"sell",
|
||||
"enter",
|
||||
"exit",
|
||||
"roi",
|
||||
"stoploss",
|
||||
"trailing",
|
||||
"protection",
|
||||
"trades",
|
||||
]
|
||||
HYPEROPT_BUILTIN_SPACE_OPTIONS = ["default", "all"] + HYPEROPT_BUILTIN_SPACES
|
||||
|
||||
AVAILABLE_PAIRLISTS = [
|
||||
"StaticPairList",
|
||||
"VolumePairList",
|
||||
|
||||
@@ -693,6 +693,9 @@ def download_data(
|
||||
"""
|
||||
Download data function. Used from both cli and API.
|
||||
"""
|
||||
exchange.validate_trading_mode_and_margin_mode(
|
||||
config.get("trading_mode", TradingMode.SPOT), None, allow_none_margin_mode=True
|
||||
)
|
||||
timerange = TimeRange()
|
||||
if "days" in config and config["days"] is not None:
|
||||
time_since = (datetime.now() - timedelta(days=config["days"])).strftime("%Y%m%d")
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -891,6 +891,7 @@ class Exchange:
|
||||
self,
|
||||
trading_mode: TradingMode,
|
||||
margin_mode: MarginMode | None, # Only None when trading_mode = TradingMode.SPOT
|
||||
allow_none_margin_mode: bool = False,
|
||||
):
|
||||
"""
|
||||
Checks if freqtrade can perform trades using the configured
|
||||
@@ -898,7 +899,18 @@ class Exchange:
|
||||
Throws OperationalException:
|
||||
If the trading_mode/margin_mode type are not supported by freqtrade on this exchange
|
||||
"""
|
||||
if trading_mode != TradingMode.SPOT and (
|
||||
if trading_mode == TradingMode.SPOT:
|
||||
return
|
||||
if allow_none_margin_mode and margin_mode is None:
|
||||
# Verify trading mode independent of margin mode
|
||||
if not any(
|
||||
trading_mode == pair[0] for pair in self._supported_trading_mode_margin_pairs
|
||||
):
|
||||
raise ConfigurationError(
|
||||
f"Freqtrade does not support '{trading_mode}' on {self.name}."
|
||||
)
|
||||
|
||||
if not allow_none_margin_mode and (
|
||||
(trading_mode, margin_mode) not in self._supported_trading_mode_margin_pairs
|
||||
):
|
||||
mm_value = margin_mode and margin_mode.value
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
"""
|
||||
Freqtrade is the main module of this bot. It contains the class Freqtrade()
|
||||
Freqtrade is the main module of this bot. It contains the FreqtradeBot class.
|
||||
"""
|
||||
|
||||
import logging
|
||||
|
||||
@@ -7,6 +7,7 @@ This module implements a convenience auto-hyperopt class, which can be used toge
|
||||
import logging
|
||||
from collections.abc import Callable
|
||||
from contextlib import suppress
|
||||
from typing import Literal
|
||||
|
||||
from freqtrade.exceptions import OperationalException
|
||||
|
||||
@@ -37,10 +38,17 @@ def _format_exception_message(space: str, ignore_missing_space: bool) -> None:
|
||||
class HyperOptAuto(IHyperOpt):
|
||||
"""
|
||||
This class delegates functionality to Strategy(IHyperStrategy) and Strategy.HyperOpt classes.
|
||||
Most of the time Strategy.HyperOpt class would only implement indicator_space and
|
||||
sell_indicator_space methods, but other hyperopt methods can be overridden as well.
|
||||
Most of the time Strategy.HyperOpt class would only implement indicator_space and
|
||||
sell_indicator_space methods, but other hyperopt methods can be overridden as well.
|
||||
"""
|
||||
|
||||
def get_available_spaces(self) -> list[str]:
|
||||
"""
|
||||
Get list of available spaces defined in strategy.
|
||||
:return: list of available spaces.
|
||||
"""
|
||||
return list(self.strategy._ft_hyper_params)
|
||||
|
||||
def _get_func(self, name) -> Callable:
|
||||
"""
|
||||
Return a function defined in Strategy.HyperOpt class, or one defined in super() class.
|
||||
@@ -54,31 +62,26 @@ class HyperOptAuto(IHyperOpt):
|
||||
else:
|
||||
return default_func
|
||||
|
||||
def _generate_indicator_space(self, category):
|
||||
for attr_name, attr in self.strategy.enumerate_parameters(category):
|
||||
if attr.optimize:
|
||||
yield attr.get_space(attr_name)
|
||||
|
||||
def _get_indicator_space(self, category) -> list:
|
||||
# TODO: is this necessary, or can we call "generate_space" directly?
|
||||
indicator_space = list(self._generate_indicator_space(category))
|
||||
def get_indicator_space(
|
||||
self, space: Literal["buy", "sell", "enter", "exit", "protection"] | str
|
||||
) -> list:
|
||||
"""
|
||||
Get indicator space for a given space.
|
||||
:param space: parameter space to get.
|
||||
"""
|
||||
indicator_space = [
|
||||
attr.get_space(attr_name)
|
||||
for attr_name, attr in self.strategy.enumerate_parameters(space)
|
||||
if attr.optimize
|
||||
]
|
||||
if len(indicator_space) > 0:
|
||||
return indicator_space
|
||||
else:
|
||||
_format_exception_message(
|
||||
category, self.config.get("hyperopt_ignore_missing_space", False)
|
||||
space, self.config.get("hyperopt_ignore_missing_space", False)
|
||||
)
|
||||
return []
|
||||
|
||||
def buy_indicator_space(self) -> list["Dimension"]:
|
||||
return self._get_indicator_space("buy")
|
||||
|
||||
def sell_indicator_space(self) -> list["Dimension"]:
|
||||
return self._get_indicator_space("sell")
|
||||
|
||||
def protection_space(self) -> list["Dimension"]:
|
||||
return self._get_indicator_space("protection")
|
||||
|
||||
def generate_roi_table(self, params: dict) -> dict[int, float]:
|
||||
return self._get_func("generate_roi_table")(params)
|
||||
|
||||
|
||||
@@ -70,13 +70,7 @@ class HyperOptimizer:
|
||||
"""
|
||||
|
||||
def __init__(self, config: Config, data_pickle_file: Path) -> None:
|
||||
self.buy_space: list[DimensionProtocol] = []
|
||||
self.sell_space: list[DimensionProtocol] = []
|
||||
self.protection_space: list[DimensionProtocol] = []
|
||||
self.roi_space: list[DimensionProtocol] = []
|
||||
self.stoploss_space: list[DimensionProtocol] = []
|
||||
self.trailing_space: list[DimensionProtocol] = []
|
||||
self.max_open_trades_space: list[DimensionProtocol] = []
|
||||
self.spaces: dict[str, list[DimensionProtocol]] = {}
|
||||
self.dimensions: list[DimensionProtocol] = []
|
||||
self.o_dimensions: dict = {}
|
||||
|
||||
@@ -167,37 +161,39 @@ class HyperOptimizer:
|
||||
"""
|
||||
result: dict = {}
|
||||
|
||||
if HyperoptTools.has_space(self.config, "buy"):
|
||||
result["buy"] = round_dict({p.name: params.get(p.name) for p in self.buy_space}, 13)
|
||||
if HyperoptTools.has_space(self.config, "sell"):
|
||||
result["sell"] = round_dict({p.name: params.get(p.name) for p in self.sell_space}, 13)
|
||||
if HyperoptTools.has_space(self.config, "protection"):
|
||||
result["protection"] = round_dict(
|
||||
{p.name: params.get(p.name) for p in self.protection_space}, 13
|
||||
)
|
||||
if HyperoptTools.has_space(self.config, "roi"):
|
||||
result["roi"] = round_dict(
|
||||
{str(k): v for k, v in self.custom_hyperopt.generate_roi_table(params).items()}, 13
|
||||
)
|
||||
if HyperoptTools.has_space(self.config, "stoploss"):
|
||||
result["stoploss"] = round_dict(
|
||||
{p.name: params.get(p.name) for p in self.stoploss_space}, 13
|
||||
)
|
||||
if HyperoptTools.has_space(self.config, "trailing"):
|
||||
result["trailing"] = round_dict(
|
||||
self.custom_hyperopt.generate_trailing_params(params), 13
|
||||
)
|
||||
if HyperoptTools.has_space(self.config, "trades"):
|
||||
result["max_open_trades"] = round_dict(
|
||||
{
|
||||
"max_open_trades": (
|
||||
self.backtesting.strategy.max_open_trades
|
||||
if self.backtesting.strategy.max_open_trades != float("inf")
|
||||
else -1
|
||||
)
|
||||
},
|
||||
13,
|
||||
)
|
||||
for space in self.spaces.keys():
|
||||
if space == "protection":
|
||||
result["protection"] = round_dict(
|
||||
{p.name: params.get(p.name) for p in self.spaces[space]}, 13
|
||||
)
|
||||
elif space == "roi":
|
||||
result["roi"] = round_dict(
|
||||
{str(k): v for k, v in self.custom_hyperopt.generate_roi_table(params).items()},
|
||||
13,
|
||||
)
|
||||
elif space == "stoploss":
|
||||
result["stoploss"] = round_dict(
|
||||
{p.name: params.get(p.name) for p in self.spaces[space]}, 13
|
||||
)
|
||||
elif space == "trailing":
|
||||
result["trailing"] = round_dict(
|
||||
self.custom_hyperopt.generate_trailing_params(params), 13
|
||||
)
|
||||
elif space == "trades":
|
||||
result["max_open_trades"] = round_dict(
|
||||
{
|
||||
"max_open_trades": (
|
||||
self.backtesting.strategy.max_open_trades
|
||||
if self.backtesting.strategy.max_open_trades != float("inf")
|
||||
else -1
|
||||
)
|
||||
},
|
||||
13,
|
||||
)
|
||||
else:
|
||||
result[space] = round_dict(
|
||||
{p.name: params.get(p.name) for p in self.spaces[space]}, 13
|
||||
)
|
||||
|
||||
return result
|
||||
|
||||
@@ -226,56 +222,39 @@ class HyperOptimizer:
|
||||
"""
|
||||
Assign the dimensions in the hyperoptimization space.
|
||||
"""
|
||||
if HyperoptTools.has_space(self.config, "protection"):
|
||||
# Protections can only be optimized when using the Parameter interface
|
||||
logger.debug("Hyperopt has 'protection' space")
|
||||
# Enable Protections if protection space is selected.
|
||||
self.config["enable_protections"] = True
|
||||
self.backtesting.enable_protections = True
|
||||
self.protection_space = self.custom_hyperopt.protection_space()
|
||||
spaces = ["buy", "sell", "protection", "roi", "stoploss", "trailing", "trades"]
|
||||
spaces += [s for s in self.custom_hyperopt.get_available_spaces() if s not in spaces]
|
||||
|
||||
if HyperoptTools.has_space(self.config, "buy"):
|
||||
logger.debug("Hyperopt has 'buy' space")
|
||||
self.buy_space = self.custom_hyperopt.buy_indicator_space()
|
||||
for space in spaces:
|
||||
if not HyperoptTools.has_space(self.config, space):
|
||||
continue
|
||||
logger.debug(f"Hyperopt has '{space}' space")
|
||||
if space == "protection":
|
||||
# Protections can only be optimized when using the Parameter interface
|
||||
# Enable Protections if protection space is selected.
|
||||
self.config["enable_protections"] = True
|
||||
self.backtesting.enable_protections = True
|
||||
self.spaces[space] = self.custom_hyperopt.get_indicator_space(space)
|
||||
elif space == "roi":
|
||||
self.spaces[space] = self.custom_hyperopt.roi_space()
|
||||
elif space == "stoploss":
|
||||
self.spaces[space] = self.custom_hyperopt.stoploss_space()
|
||||
elif space == "trailing":
|
||||
self.spaces[space] = self.custom_hyperopt.trailing_space()
|
||||
elif space == "trades":
|
||||
self.spaces[space] = self.custom_hyperopt.max_open_trades_space()
|
||||
else:
|
||||
self.spaces[space] = self.custom_hyperopt.get_indicator_space(space)
|
||||
|
||||
if HyperoptTools.has_space(self.config, "sell"):
|
||||
logger.debug("Hyperopt has 'sell' space")
|
||||
self.sell_space = self.custom_hyperopt.sell_indicator_space()
|
||||
|
||||
if HyperoptTools.has_space(self.config, "roi"):
|
||||
logger.debug("Hyperopt has 'roi' space")
|
||||
self.roi_space = self.custom_hyperopt.roi_space()
|
||||
|
||||
if HyperoptTools.has_space(self.config, "stoploss"):
|
||||
logger.debug("Hyperopt has 'stoploss' space")
|
||||
self.stoploss_space = self.custom_hyperopt.stoploss_space()
|
||||
|
||||
if HyperoptTools.has_space(self.config, "trailing"):
|
||||
logger.debug("Hyperopt has 'trailing' space")
|
||||
self.trailing_space = self.custom_hyperopt.trailing_space()
|
||||
|
||||
if HyperoptTools.has_space(self.config, "trades"):
|
||||
logger.debug("Hyperopt has 'trades' space")
|
||||
self.max_open_trades_space = self.custom_hyperopt.max_open_trades_space()
|
||||
|
||||
self.dimensions = (
|
||||
self.buy_space
|
||||
+ self.sell_space
|
||||
+ self.protection_space
|
||||
+ self.roi_space
|
||||
+ self.stoploss_space
|
||||
+ self.trailing_space
|
||||
+ self.max_open_trades_space
|
||||
)
|
||||
|
||||
def assign_params(self, params_dict: dict[str, Any], category: str) -> None:
|
||||
"""
|
||||
Assign hyperoptable parameters
|
||||
"""
|
||||
for attr_name, attr in self.backtesting.strategy.enumerate_parameters(category):
|
||||
if attr.optimize:
|
||||
# noinspection PyProtectedMember
|
||||
attr.value = params_dict[attr_name]
|
||||
self.dimensions = [s for space in self.spaces.values() for s in space]
|
||||
if len(self.dimensions) == 0:
|
||||
raise OperationalException(
|
||||
"No hyperopt parameters found to optimize."
|
||||
f"Available spaces: {', '.join(spaces)}. "
|
||||
"Check your strategy's parameter definitions or verify the configured spaces "
|
||||
"in your command."
|
||||
)
|
||||
self.o_dimensions = self.convert_dimensions_to_optuna_space(self.dimensions)
|
||||
|
||||
@delayed
|
||||
@wrap_non_picklable_objects
|
||||
@@ -292,15 +271,9 @@ class HyperOptimizer:
|
||||
HyperoptStateContainer.set_state(HyperoptState.OPTIMIZE)
|
||||
backtest_start_time = datetime.now(UTC)
|
||||
|
||||
# Apply parameters
|
||||
if HyperoptTools.has_space(self.config, "buy"):
|
||||
self.assign_params(params_dict, "buy")
|
||||
|
||||
if HyperoptTools.has_space(self.config, "sell"):
|
||||
self.assign_params(params_dict, "sell")
|
||||
|
||||
if HyperoptTools.has_space(self.config, "protection"):
|
||||
self.assign_params(params_dict, "protection")
|
||||
for attr_name, attr in self.backtesting.strategy.enumerate_parameters():
|
||||
if attr.in_space and attr.optimize:
|
||||
attr.value = params_dict[attr_name]
|
||||
|
||||
if HyperoptTools.has_space(self.config, "roi"):
|
||||
self.backtesting.strategy.minimal_roi = self.custom_hyperopt.generate_roi_table(
|
||||
@@ -436,7 +409,6 @@ class HyperOptimizer:
|
||||
o_sampler = self.custom_hyperopt.generate_estimator(
|
||||
dimensions=self.dimensions, random_state=random_state
|
||||
)
|
||||
self.o_dimensions = self.convert_dimensions_to_optuna_space(self.dimensions)
|
||||
|
||||
if isinstance(o_sampler, str):
|
||||
if o_sampler not in optuna_samplers_dict.keys():
|
||||
|
||||
@@ -9,7 +9,7 @@ import numpy as np
|
||||
import rapidjson
|
||||
from pandas import isna, json_normalize
|
||||
|
||||
from freqtrade.constants import FTHYPT_FILEVERSION, Config
|
||||
from freqtrade.constants import FTHYPT_FILEVERSION, HYPEROPT_BUILTIN_SPACES, Config
|
||||
from freqtrade.enums import HyperoptState
|
||||
from freqtrade.exceptions import OperationalException
|
||||
from freqtrade.misc import deep_merge_dicts, round_dict, safe_value_fallback2
|
||||
@@ -219,21 +219,22 @@ class HyperoptTools:
|
||||
print(rapidjson.dumps(result_dict, default=str, number_mode=HYPER_PARAMS_FILE_FORMAT))
|
||||
|
||||
else:
|
||||
HyperoptTools._params_pretty_print(
|
||||
params, "buy", "Buy hyperspace params:", non_optimized
|
||||
)
|
||||
HyperoptTools._params_pretty_print(
|
||||
params, "sell", "Sell hyperspace params:", non_optimized
|
||||
)
|
||||
HyperoptTools._params_pretty_print(
|
||||
params, "protection", "Protection hyperspace params:", non_optimized
|
||||
)
|
||||
HyperoptTools._params_pretty_print(params, "roi", "ROI table:", non_optimized)
|
||||
HyperoptTools._params_pretty_print(params, "stoploss", "Stoploss:", non_optimized)
|
||||
HyperoptTools._params_pretty_print(params, "trailing", "Trailing stop:", non_optimized)
|
||||
HyperoptTools._params_pretty_print(
|
||||
params, "max_open_trades", "Max Open Trades:", non_optimized
|
||||
)
|
||||
all_spaces = list(params.keys() | non_optimized.keys())
|
||||
# Explicitly listed to keep original sort order
|
||||
spaces = ["buy", "sell", "protection", "roi", "stoploss", "trailing", "max_open_trades"]
|
||||
spaces += [s for s in all_spaces if s not in spaces]
|
||||
lookup = {
|
||||
"roi": "ROI",
|
||||
"trailing": "Trailing stop",
|
||||
}
|
||||
for space in spaces:
|
||||
name = lookup.get(
|
||||
space, space.capitalize() if space in HYPEROPT_BUILTIN_SPACES else space
|
||||
)
|
||||
|
||||
HyperoptTools._params_pretty_print(
|
||||
params, space, f"{name} parameters:", non_optimized
|
||||
)
|
||||
|
||||
@staticmethod
|
||||
def _params_update_for_json(result_dict, params, non_optimized, space: str) -> None:
|
||||
|
||||
@@ -25,14 +25,16 @@ class MarketCapPairList(IPairList):
|
||||
def __init__(self, *args, **kwargs) -> None:
|
||||
super().__init__(*args, **kwargs)
|
||||
|
||||
if "number_assets" not in self._pairlistconfig:
|
||||
self._mode = self._pairlistconfig.get("mode", "whitelist")
|
||||
|
||||
if (self._mode == "whitelist") and ("number_assets" not in self._pairlistconfig):
|
||||
raise OperationalException(
|
||||
"`number_assets` not specified. Please check your configuration "
|
||||
'for "pairlist.config.number_assets"'
|
||||
)
|
||||
|
||||
self._stake_currency = self._config["stake_currency"]
|
||||
self._number_assets = self._pairlistconfig["number_assets"]
|
||||
self._number_assets = self._pairlistconfig.get("number_assets", 30)
|
||||
self._max_rank = self._pairlistconfig.get("max_rank", 30)
|
||||
self._refresh_period = self._pairlistconfig.get("refresh_period", 86400)
|
||||
self._categories = self._pairlistconfig.get("categories", [])
|
||||
@@ -78,7 +80,9 @@ class MarketCapPairList(IPairList):
|
||||
"""
|
||||
num = self._number_assets
|
||||
rank = self._max_rank
|
||||
msg = f"{self.name} - {num} pairs placed within top {rank} market cap."
|
||||
mode = self._mode
|
||||
pair_text = num if (mode == "whitelist") else "blacklisting"
|
||||
msg = f"{self.name} - {pair_text} pairs placed within top {rank} market cap."
|
||||
return msg
|
||||
|
||||
@staticmethod
|
||||
@@ -115,6 +119,13 @@ class MarketCapPairList(IPairList):
|
||||
"description": "Refresh period",
|
||||
"help": "Refresh period in seconds",
|
||||
},
|
||||
"mode": {
|
||||
"type": "option",
|
||||
"default": "whitelist",
|
||||
"options": ["whitelist", "blacklist"],
|
||||
"description": "Mode of operation",
|
||||
"help": "Mode of operation (whitelist/blacklist)",
|
||||
},
|
||||
}
|
||||
|
||||
def get_markets_exchange(self):
|
||||
@@ -186,6 +197,9 @@ class MarketCapPairList(IPairList):
|
||||
:return: new whitelist
|
||||
"""
|
||||
marketcap_list = self._marketcap_cache.get("marketcap")
|
||||
mode = self._mode
|
||||
is_whitelist_mode = mode == "whitelist"
|
||||
filtered_pairlist: list[str] = []
|
||||
|
||||
default_kwargs = {
|
||||
"vs_currency": "usd",
|
||||
@@ -219,12 +233,10 @@ class MarketCapPairList(IPairList):
|
||||
self._marketcap_cache["marketcap"] = marketcap_list
|
||||
|
||||
if marketcap_list:
|
||||
filtered_pairlist: list[str] = []
|
||||
|
||||
market = self._exchange._config["trading_mode"]
|
||||
pair_format = f"{self._stake_currency.upper()}"
|
||||
if market == "futures":
|
||||
pair_format += f":{self._stake_currency.upper()}"
|
||||
pair_format = f"{self._stake_currency.upper()}" + (
|
||||
f":{self._stake_currency.upper()}" if market == "futures" else ""
|
||||
)
|
||||
|
||||
top_marketcap = marketcap_list[: self._max_rank :]
|
||||
markets = self.get_markets_exchange()
|
||||
@@ -234,13 +246,16 @@ class MarketCapPairList(IPairList):
|
||||
resolved = self.resolve_marketcap_pair(pair, pairlist, markets, filtered_pairlist)
|
||||
|
||||
if resolved:
|
||||
if not is_whitelist_mode:
|
||||
pairlist.remove(resolved)
|
||||
continue
|
||||
|
||||
filtered_pairlist.append(resolved)
|
||||
if len(filtered_pairlist) == self._number_assets:
|
||||
break
|
||||
|
||||
if len(filtered_pairlist) == self._number_assets:
|
||||
break
|
||||
|
||||
if len(filtered_pairlist) > 0:
|
||||
return filtered_pairlist
|
||||
if not is_whitelist_mode:
|
||||
return pairlist
|
||||
|
||||
# If no pairs are found, return the original pairlist
|
||||
return []
|
||||
return filtered_pairlist
|
||||
|
||||
@@ -148,6 +148,9 @@ class IResolver:
|
||||
logger.debug("Ignoring broken symlink %s", entry)
|
||||
continue
|
||||
module_path = entry.resolve()
|
||||
if entry.read_text().find(f"class {object_name}(") == -1:
|
||||
logger.debug(f"Skipping {module_path} as it does not contain class {object_name}.")
|
||||
continue
|
||||
|
||||
if obj := next(cls._get_valid_object(module_path, object_name), None):
|
||||
obj[0].__file__ = str(entry)
|
||||
|
||||
@@ -4,9 +4,9 @@ This module defines a base class for auto-hyperoptable strategies.
|
||||
"""
|
||||
|
||||
import logging
|
||||
from collections import defaultdict
|
||||
from collections.abc import Iterator
|
||||
from pathlib import Path
|
||||
from typing import Any
|
||||
|
||||
from freqtrade.constants import Config
|
||||
from freqtrade.exceptions import OperationalException
|
||||
@@ -18,6 +18,11 @@ from freqtrade.strategy.parameters import BaseParameter
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
# Type aliases
|
||||
SpaceParams = dict[str, BaseParameter]
|
||||
AllSpaceParams = dict[str, SpaceParams]
|
||||
|
||||
|
||||
class HyperStrategyMixin:
|
||||
"""
|
||||
A helper base class which allows HyperOptAuto class to reuse implementations of buy/sell
|
||||
@@ -29,47 +34,22 @@ class HyperStrategyMixin:
|
||||
Initialize hyperoptable strategy mixin.
|
||||
"""
|
||||
self.config = config
|
||||
self.ft_buy_params: list[BaseParameter] = []
|
||||
self.ft_sell_params: list[BaseParameter] = []
|
||||
self.ft_protection_params: list[BaseParameter] = []
|
||||
self._ft_hyper_params: AllSpaceParams = {}
|
||||
|
||||
params = self.load_params_from_file()
|
||||
params = params.get("params", {})
|
||||
self._ft_params_from_file = params
|
||||
# Init/loading of parameters is done as part of ft_bot_start().
|
||||
|
||||
def enumerate_parameters(
|
||||
self, category: str | None = None
|
||||
) -> Iterator[tuple[str, BaseParameter]]:
|
||||
def enumerate_parameters(self, space: str | None = None) -> Iterator[tuple[str, BaseParameter]]:
|
||||
"""
|
||||
Find all optimizable parameters and return (name, attr) iterator.
|
||||
:param category:
|
||||
:param space: parameter space to filter for, or None for all spaces.
|
||||
:return:
|
||||
"""
|
||||
if category not in ("buy", "sell", "protection", None):
|
||||
raise OperationalException(
|
||||
'Category must be one of: "buy", "sell", "protection", None.'
|
||||
)
|
||||
|
||||
if category is None:
|
||||
params = self.ft_buy_params + self.ft_sell_params + self.ft_protection_params
|
||||
else:
|
||||
params = getattr(self, f"ft_{category}_params")
|
||||
|
||||
for par in params:
|
||||
yield par.name, par
|
||||
|
||||
@classmethod
|
||||
def detect_all_parameters(cls) -> dict:
|
||||
"""Detect all parameters and return them as a list"""
|
||||
params: dict[str, Any] = {
|
||||
"buy": list(detect_parameters(cls, "buy")),
|
||||
"sell": list(detect_parameters(cls, "sell")),
|
||||
"protection": list(detect_parameters(cls, "protection")),
|
||||
}
|
||||
params.update({"count": len(params["buy"] + params["sell"] + params["protection"])})
|
||||
|
||||
return params
|
||||
for space in [c for c in self._ft_hyper_params if space is None or c == space]:
|
||||
for par in self._ft_hyper_params[space].values():
|
||||
yield par.name, par
|
||||
|
||||
def ft_load_params_from_file(self) -> None:
|
||||
"""
|
||||
@@ -110,20 +90,13 @@ class HyperStrategyMixin:
|
||||
* Parameters defined in parameters objects (buy_params, sell_params, ...)
|
||||
* Parameter defaults
|
||||
"""
|
||||
self._ft_hyper_params = detect_all_parameters(self)
|
||||
|
||||
buy_params = deep_merge_dicts(
|
||||
self._ft_params_from_file.get("buy", {}), getattr(self, "buy_params", {})
|
||||
)
|
||||
sell_params = deep_merge_dicts(
|
||||
self._ft_params_from_file.get("sell", {}), getattr(self, "sell_params", {})
|
||||
)
|
||||
protection_params = deep_merge_dicts(
|
||||
self._ft_params_from_file.get("protection", {}), getattr(self, "protection_params", {})
|
||||
)
|
||||
|
||||
self._ft_load_params(buy_params, "buy", hyperopt)
|
||||
self._ft_load_params(sell_params, "sell", hyperopt)
|
||||
self._ft_load_params(protection_params, "protection", hyperopt)
|
||||
for space in self._ft_hyper_params.keys():
|
||||
params_values = deep_merge_dicts(
|
||||
self._ft_params_from_file.get(space, {}), getattr(self, f"{space}_params", {})
|
||||
)
|
||||
self._ft_load_params(self._ft_hyper_params[space], params_values, space, hyperopt)
|
||||
|
||||
def load_params_from_file(self) -> dict:
|
||||
filename_str = getattr(self, "__file__", "")
|
||||
@@ -145,72 +118,73 @@ class HyperStrategyMixin:
|
||||
|
||||
return {}
|
||||
|
||||
def _ft_load_params(self, params: dict, space: str, hyperopt: bool = False) -> None:
|
||||
def _ft_load_params(
|
||||
self, params: SpaceParams, param_values: dict, space: str, hyperopt: bool = False
|
||||
) -> None:
|
||||
"""
|
||||
Set optimizable parameter values.
|
||||
:param params: Dictionary with new parameter values.
|
||||
"""
|
||||
if not params:
|
||||
if not param_values:
|
||||
logger.info(f"No params for {space} found, using default values.")
|
||||
param_container: list[BaseParameter] = getattr(self, f"ft_{space}_params")
|
||||
|
||||
for attr_name, attr in detect_parameters(self, space):
|
||||
attr.name = attr_name
|
||||
attr.in_space = hyperopt and HyperoptTools.has_space(self.config, space)
|
||||
if not attr.category:
|
||||
attr.category = space
|
||||
for param_name, param in params.items():
|
||||
param.in_space = hyperopt and HyperoptTools.has_space(self.config, space)
|
||||
if not param.space:
|
||||
param.space = space
|
||||
|
||||
param_container.append(attr)
|
||||
|
||||
if params and attr_name in params:
|
||||
if attr.load:
|
||||
attr.value = params[attr_name]
|
||||
logger.info(f"Strategy Parameter: {attr_name} = {attr.value}")
|
||||
if param_values and param_name in param_values:
|
||||
if param.load:
|
||||
param.value = param_values[param_name]
|
||||
logger.info(f"Strategy Parameter: {param_name} = {param.value}")
|
||||
else:
|
||||
logger.warning(
|
||||
f'Parameter "{attr_name}" exists, but is disabled. '
|
||||
f'Default value "{attr.value}" used.'
|
||||
f'Parameter "{param_name}" exists, but is disabled. '
|
||||
f'Default value "{param.value}" used.'
|
||||
)
|
||||
else:
|
||||
logger.info(f"Strategy Parameter(default): {attr_name} = {attr.value}")
|
||||
logger.info(f"Strategy Parameter(default): {param_name} = {param.value}")
|
||||
|
||||
def get_no_optimize_params(self) -> dict[str, dict]:
|
||||
"""
|
||||
Returns list of Parameters that are not part of the current optimize job
|
||||
"""
|
||||
params: dict[str, dict] = {
|
||||
"buy": {},
|
||||
"sell": {},
|
||||
"protection": {},
|
||||
}
|
||||
params: dict[str, dict] = defaultdict(dict)
|
||||
for name, p in self.enumerate_parameters():
|
||||
if p.category and (not p.optimize or not p.in_space):
|
||||
params[p.category][name] = p.value
|
||||
if p.space and (not p.optimize or not p.in_space):
|
||||
params[p.space][name] = p.value
|
||||
return params
|
||||
|
||||
|
||||
def detect_parameters(
|
||||
obj: HyperStrategyMixin | type[HyperStrategyMixin], category: str
|
||||
) -> Iterator[tuple[str, BaseParameter]]:
|
||||
def detect_all_parameters(
|
||||
obj: HyperStrategyMixin | type[HyperStrategyMixin],
|
||||
) -> AllSpaceParams:
|
||||
"""
|
||||
Detect all parameters for 'category' for "obj"
|
||||
Detect all hyperoptable parameters for this object.
|
||||
:param obj: Strategy object or class
|
||||
:param category: category - usually `'buy', 'sell', 'protection',...
|
||||
:return: Dictionary of detected parameters by space
|
||||
"""
|
||||
auto_categories = ["buy", "sell", "enter", "exit", "protection"]
|
||||
result: AllSpaceParams = defaultdict(dict)
|
||||
for attr_name in dir(obj):
|
||||
if not attr_name.startswith("__"): # Ignore internals, not strictly necessary.
|
||||
attr = getattr(obj, attr_name)
|
||||
if issubclass(attr.__class__, BaseParameter):
|
||||
if (
|
||||
attr_name.startswith(category + "_")
|
||||
and attr.category is not None
|
||||
and attr.category != category
|
||||
):
|
||||
raise OperationalException(
|
||||
f"Inconclusive parameter name {attr_name}, category: {attr.category}."
|
||||
)
|
||||
if attr_name.startswith("__"): # Ignore internals
|
||||
continue
|
||||
attr = getattr(obj, attr_name)
|
||||
if not issubclass(attr.__class__, BaseParameter):
|
||||
continue
|
||||
if not attr.space:
|
||||
# space auto detection
|
||||
for space in auto_categories:
|
||||
if attr_name.startswith(space + "_"):
|
||||
attr.space = space
|
||||
break
|
||||
if attr.space is None:
|
||||
raise OperationalException(f"Cannot determine parameter space for {attr_name}.")
|
||||
|
||||
if category == attr.category or (
|
||||
attr_name.startswith(category + "_") and attr.category is None
|
||||
):
|
||||
yield attr_name, attr
|
||||
if attr.space in ("all", "default") or attr.space.isidentifier() is False:
|
||||
raise OperationalException(
|
||||
f"'{attr.space}' is not a valid space. Parameter: {attr_name}."
|
||||
)
|
||||
attr.name = attr_name
|
||||
result[attr.space][attr_name] = attr
|
||||
return result
|
||||
|
||||
@@ -32,7 +32,7 @@ class BaseParameter(ABC):
|
||||
Defines a parameter that can be optimized by hyperopt.
|
||||
"""
|
||||
|
||||
category: str | None
|
||||
space: str | None
|
||||
default: Any
|
||||
value: Any
|
||||
in_space: bool = False
|
||||
@@ -49,9 +49,9 @@ class BaseParameter(ABC):
|
||||
):
|
||||
"""
|
||||
Initialize hyperopt-optimizable parameter.
|
||||
:param space: A parameter category. Can be 'buy' or 'sell'. This parameter is optional if
|
||||
parameter field
|
||||
name is prefixed with 'buy_' or 'sell_'.
|
||||
:param space: The parameter space. Can be 'buy', 'sell', or a string that's also a
|
||||
valid python identifier.
|
||||
This parameter is optional if parameter name is prefixed with 'buy_' or 'sell_'.
|
||||
:param optimize: Include parameter in hyperopt optimizations.
|
||||
:param load: Load parameter value from {space}_params.
|
||||
:param kwargs: Extra parameters to optuna.distributions.
|
||||
@@ -61,7 +61,7 @@ class BaseParameter(ABC):
|
||||
raise OperationalException(
|
||||
"Name is determined by parameter field name and can not be specified manually."
|
||||
)
|
||||
self.category = space
|
||||
self.space = space
|
||||
self._space_params = kwargs
|
||||
self.value = default
|
||||
self.optimize = optimize
|
||||
@@ -109,8 +109,9 @@ class NumericParameter(BaseParameter):
|
||||
:param high: Upper end (inclusive) of optimization space.
|
||||
Must be none of entire range is passed first parameter.
|
||||
:param default: A default value.
|
||||
:param space: A parameter category. Can be 'buy' or 'sell'. This parameter is optional if
|
||||
parameter fieldname is prefixed with 'buy_' or 'sell_'.
|
||||
:param space: The parameter space. Can be 'buy', 'sell', or a string that's also a
|
||||
valid python identifier.
|
||||
This parameter is optional if parameter name is prefixed with 'buy_' or 'sell_'.
|
||||
:param optimize: Include parameter in hyperopt optimizations.
|
||||
:param load: Load parameter value from {space}_params.
|
||||
:param kwargs: Extra parameters to optuna.distributions.*.
|
||||
@@ -151,8 +152,9 @@ class IntParameter(NumericParameter):
|
||||
:param high: Upper end (inclusive) of optimization space.
|
||||
Must be none of entire range is passed first parameter.
|
||||
:param default: A default value.
|
||||
:param space: A parameter category. Can be 'buy' or 'sell'. This parameter is optional if
|
||||
parameter fieldname is prefixed with 'buy_' or 'sell_'.
|
||||
:param space: The parameter space. Can be 'buy', 'sell', or a string that's also a
|
||||
valid python identifier.
|
||||
This parameter is optional if parameter name is prefixed with 'buy_' or 'sell_'.
|
||||
:param optimize: Include parameter in hyperopt optimizations.
|
||||
:param load: Load parameter value from {space}_params.
|
||||
:param kwargs: Extra parameters to optuna.distributions.IntDistribution.
|
||||
@@ -205,8 +207,9 @@ class RealParameter(NumericParameter):
|
||||
:param high: Upper end (inclusive) of optimization space.
|
||||
Must be none if entire range is passed first parameter.
|
||||
:param default: A default value.
|
||||
:param space: A parameter category. Can be 'buy' or 'sell'. This parameter is optional if
|
||||
parameter fieldname is prefixed with 'buy_' or 'sell_'.
|
||||
:param space: The parameter space. Can be 'buy', 'sell', or a string that's also a
|
||||
valid python identifier.
|
||||
This parameter is optional if parameter name is prefixed with 'buy_' or 'sell_'.
|
||||
:param optimize: Include parameter in hyperopt optimizations.
|
||||
:param load: Load parameter value from {space}_params.
|
||||
:param kwargs: Extra parameters to optuna.distributions.FloatDistribution.
|
||||
@@ -245,8 +248,9 @@ class DecimalParameter(NumericParameter):
|
||||
Must be none if entire range is passed first parameter.
|
||||
:param default: A default value.
|
||||
:param decimals: A number of decimals after floating point to be included in testing.
|
||||
:param space: A parameter category. Can be 'buy' or 'sell'. This parameter is optional if
|
||||
parameter fieldname is prefixed with 'buy_' or 'sell_'.
|
||||
:param space: The parameter space. Can be 'buy', 'sell', or a string that's also a
|
||||
valid python identifier.
|
||||
This parameter is optional if parameter name is prefixed with 'buy_' or 'sell_'.
|
||||
:param optimize: Include parameter in hyperopt optimizations.
|
||||
:param load: Load parameter value from {space}_params.
|
||||
:param kwargs: Extra parameters to optuna's NumericParameter.
|
||||
@@ -310,10 +314,10 @@ class CategoricalParameter(BaseParameter):
|
||||
Initialize hyperopt-optimizable parameter.
|
||||
:param categories: Optimization space, [a, b, ...].
|
||||
:param default: A default value. If not specified, first item from specified space will be
|
||||
used.
|
||||
:param space: A parameter category. Can be 'buy' or 'sell'. This parameter is optional if
|
||||
parameter field
|
||||
name is prefixed with 'buy_' or 'sell_'.
|
||||
used.
|
||||
:param space: The parameter space. Can be 'buy', 'sell', or a string that's also a
|
||||
valid python identifier.
|
||||
This parameter is optional if parameter name is prefixed with 'buy_' or 'sell_'.
|
||||
:param optimize: Include parameter in hyperopt optimizations.
|
||||
:param load: Load parameter value from {space}_params.
|
||||
:param kwargs: Compatibility. Optuna's CategoricalDistribution does not
|
||||
@@ -361,10 +365,10 @@ class BooleanParameter(CategoricalParameter):
|
||||
Initialize hyperopt-optimizable Boolean Parameter.
|
||||
It's a shortcut to `CategoricalParameter([True, False])`.
|
||||
:param default: A default value. If not specified, first item from specified space will be
|
||||
used.
|
||||
:param space: A parameter category. Can be 'buy' or 'sell'. This parameter is optional if
|
||||
parameter field
|
||||
name is prefixed with 'buy_' or 'sell_'.
|
||||
used.
|
||||
:param space: The parameter space. Can be 'buy', 'sell', or a string that's also a
|
||||
valid python identifier.
|
||||
This parameter is optional if parameter name is prefixed with 'buy_' or 'sell_'.
|
||||
:param optimize: Include parameter in hyperopt optimizations.
|
||||
:param load: Load parameter value from {space}_params.
|
||||
:param kwargs: Extra parameters to optuna.distributions.CategoricalDistribution.
|
||||
|
||||
@@ -96,7 +96,9 @@ class SampleStrategy(IStrategy):
|
||||
buy_rsi = IntParameter(low=1, high=50, default=30, space="buy", optimize=True, load=True)
|
||||
sell_rsi = IntParameter(low=50, high=100, default=70, space="sell", optimize=True, load=True)
|
||||
short_rsi = IntParameter(low=51, high=100, default=70, space="sell", optimize=True, load=True)
|
||||
exit_short_rsi = IntParameter(low=1, high=50, default=30, space="buy", optimize=True, load=True)
|
||||
exit_short_rsi = IntParameter(
|
||||
low=1, high=50, default=30, space="exit", optimize=True, load=True
|
||||
)
|
||||
|
||||
# Number of candles the strategy requires before producing valid signals
|
||||
startup_candle_count: int = 200
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
from freqtrade_client.ft_rest_client import FtRestClient
|
||||
|
||||
|
||||
__version__ = "2025.10"
|
||||
__version__ = "2025.11-dev"
|
||||
|
||||
if "dev" in __version__:
|
||||
from pathlib import Path
|
||||
|
||||
@@ -82,7 +82,7 @@ def print_commands():
|
||||
|
||||
|
||||
def main_exec(parsed: dict[str, Any]):
|
||||
if parsed.get("show"):
|
||||
if parsed.get("show") or parsed.get("command") in ("show", "help"):
|
||||
print_commands()
|
||||
sys.exit()
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
-r requirements-freqai-rl.txt
|
||||
-r docs/requirements-docs.txt
|
||||
|
||||
ruff==0.14.1
|
||||
ruff==0.14.3
|
||||
mypy==1.18.2
|
||||
pre-commit==4.3.0
|
||||
pytest==8.4.2
|
||||
@@ -24,7 +24,7 @@ time-machine==2.19.0
|
||||
nbconvert==7.16.6
|
||||
|
||||
# mypy types
|
||||
scipy-stubs==1.16.2.4 # keep in sync with `scipy` in `requirements-hyperopt.txt`
|
||||
scipy-stubs==1.16.3.0 # keep in sync with `scipy` in `requirements-hyperopt.txt`
|
||||
types-cachetools==6.2.0.20251022
|
||||
types-filelock==3.2.7
|
||||
types-requests==2.32.4.20250913
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
# Required for freqai-rl
|
||||
torch==2.9.0; sys_platform != 'darwin' or platform_machine != 'x86_64'
|
||||
gymnasium==1.2.1
|
||||
gymnasium==1.2.2
|
||||
# SB3 >=2.5.0 depends on torch 2.3.0 - which implies it dropped support x86 macos
|
||||
stable_baselines3==2.7.0; sys_platform != 'darwin' or platform_machine != 'x86_64'
|
||||
sb3_contrib>=2.2.1; sys_platform != 'darwin' or platform_machine != 'x86_64'
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
# Required for freqai
|
||||
scikit-learn==1.7.2
|
||||
joblib==1.5.2
|
||||
catboost==1.2.8; 'arm' not in platform_machine
|
||||
catboost==1.2.8; 'arm' not in platform_machine and python_version < '3.14'
|
||||
lightgbm==4.6.0
|
||||
xgboost==3.1.1
|
||||
tensorboard==2.20.0
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
-r requirements.txt
|
||||
|
||||
# Required for hyperopt
|
||||
scipy==1.16.2
|
||||
scipy==1.16.3
|
||||
scikit-learn==1.7.2
|
||||
filelock==3.20.0
|
||||
optuna==4.5.0
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# Include all requirements to run the bot.
|
||||
-r requirements.txt
|
||||
|
||||
plotly==6.3.1
|
||||
plotly==6.4.0
|
||||
|
||||
@@ -7,9 +7,9 @@ ft-pandas-ta==0.3.16
|
||||
ta-lib==0.6.8
|
||||
technical==1.5.3
|
||||
|
||||
ccxt==4.5.12
|
||||
ccxt==4.5.17
|
||||
cryptography==46.0.3
|
||||
aiohttp==3.13.1
|
||||
aiohttp==3.13.2
|
||||
SQLAlchemy==2.0.44
|
||||
python-telegram-bot==22.5
|
||||
# can't be hard-pinned due to telegram-bot pinning httpx with ~
|
||||
@@ -25,25 +25,24 @@ pycoingecko==3.2.0
|
||||
jinja2==3.1.6
|
||||
joblib==1.5.2
|
||||
rich==14.2.0
|
||||
pyarrow==21.0.0; platform_machine != 'armv7l' and platform_machine != "aarch64"
|
||||
# TODO: downgrade for aarch64 until https://github.com/apache/arrow/issues/47229 is resolved
|
||||
pyarrow==20.0.0; platform_machine == "aarch64"
|
||||
pyarrow==22.0.0; platform_machine != 'armv7l'
|
||||
|
||||
|
||||
# Load ticker files 30% faster
|
||||
python-rapidjson==1.22
|
||||
# Properly format api responses
|
||||
orjson==3.11.3
|
||||
orjson==3.11.4
|
||||
|
||||
# Notify systemd
|
||||
sdnotify==0.3.2
|
||||
|
||||
# API Server
|
||||
fastapi==0.119.1
|
||||
pydantic==2.12.3
|
||||
fastapi==0.121.0
|
||||
pydantic==2.12.4
|
||||
uvicorn==0.38.0
|
||||
pyjwt==2.10.1
|
||||
aiofiles==25.1.0
|
||||
psutil==7.1.1
|
||||
psutil==7.1.3
|
||||
|
||||
# Building config files interactively
|
||||
questionary==2.1.1
|
||||
|
||||
2
setup.sh
2
setup.sh
@@ -92,7 +92,7 @@ function updateenv() {
|
||||
read -p "Do you want to install dependencies for freqai [y/N]? "
|
||||
if [[ $REPLY =~ ^[Yy]$ ]]
|
||||
then
|
||||
REQUIREMENTS_FREQAI="-r requirements-freqai.txt --use-pep517"
|
||||
REQUIREMENTS_FREQAI="-r requirements-freqai.txt"
|
||||
read -p "Do you also want dependencies for freqai-rl or PyTorch (~700mb additional space required) [y/N]? "
|
||||
if [[ $REPLY =~ ^[Yy]$ ]]
|
||||
then
|
||||
|
||||
@@ -1319,10 +1319,10 @@ def test_hyperopt_list(mocker, capsys, caplog, tmp_path):
|
||||
" 2/12",
|
||||
" 10/12",
|
||||
"Best result:",
|
||||
"Buy hyperspace params",
|
||||
"Sell hyperspace params",
|
||||
"ROI table",
|
||||
"Stoploss",
|
||||
"Buy parameters",
|
||||
"Sell parameters",
|
||||
"ROI parameters",
|
||||
"Stoploss parameters",
|
||||
]
|
||||
)
|
||||
assert all(
|
||||
|
||||
@@ -4897,53 +4897,66 @@ def test_set_margin_mode(mocker, default_conf, margin_mode):
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
"exchange_name, trading_mode, margin_mode, exception_thrown",
|
||||
"exchange_name, trading_mode, margin_mode, allow_none_margin_mode, exception_thrown",
|
||||
[
|
||||
("binance", TradingMode.SPOT, None, False),
|
||||
("binance", TradingMode.MARGIN, MarginMode.ISOLATED, True),
|
||||
("kraken", TradingMode.SPOT, None, False),
|
||||
("kraken", TradingMode.MARGIN, MarginMode.ISOLATED, True),
|
||||
("kraken", TradingMode.FUTURES, MarginMode.ISOLATED, True),
|
||||
("bitmart", TradingMode.SPOT, None, False),
|
||||
("bitmart", TradingMode.MARGIN, MarginMode.CROSS, True),
|
||||
("bitmart", TradingMode.MARGIN, MarginMode.ISOLATED, True),
|
||||
("bitmart", TradingMode.FUTURES, MarginMode.CROSS, True),
|
||||
("bitmart", TradingMode.FUTURES, MarginMode.ISOLATED, True),
|
||||
("gate", TradingMode.MARGIN, MarginMode.ISOLATED, True),
|
||||
("okx", TradingMode.SPOT, None, False),
|
||||
("okx", TradingMode.MARGIN, MarginMode.CROSS, True),
|
||||
("okx", TradingMode.MARGIN, MarginMode.ISOLATED, True),
|
||||
("okx", TradingMode.FUTURES, MarginMode.CROSS, True),
|
||||
("binance", TradingMode.FUTURES, MarginMode.ISOLATED, False),
|
||||
("gate", TradingMode.FUTURES, MarginMode.ISOLATED, False),
|
||||
("okx", TradingMode.FUTURES, MarginMode.ISOLATED, False),
|
||||
("binance", TradingMode.SPOT, None, False, False),
|
||||
("binance", TradingMode.MARGIN, MarginMode.ISOLATED, False, True),
|
||||
("kraken", TradingMode.SPOT, None, False, False),
|
||||
("kraken", TradingMode.MARGIN, MarginMode.ISOLATED, False, True),
|
||||
("kraken", TradingMode.FUTURES, MarginMode.ISOLATED, False, True),
|
||||
("bitmart", TradingMode.SPOT, None, False, False),
|
||||
("bitmart", TradingMode.MARGIN, MarginMode.CROSS, False, True),
|
||||
("bitmart", TradingMode.MARGIN, MarginMode.ISOLATED, False, True),
|
||||
("bitmart", TradingMode.FUTURES, MarginMode.CROSS, False, True),
|
||||
("bitmart", TradingMode.FUTURES, MarginMode.ISOLATED, False, True),
|
||||
("gate", TradingMode.MARGIN, MarginMode.ISOLATED, False, True),
|
||||
("okx", TradingMode.SPOT, None, False, False),
|
||||
("okx", TradingMode.MARGIN, MarginMode.CROSS, False, True),
|
||||
("okx", TradingMode.MARGIN, MarginMode.ISOLATED, False, True),
|
||||
("okx", TradingMode.FUTURES, MarginMode.CROSS, False, True),
|
||||
("binance", TradingMode.FUTURES, MarginMode.ISOLATED, False, False),
|
||||
("gate", TradingMode.FUTURES, MarginMode.ISOLATED, False, False),
|
||||
("okx", TradingMode.FUTURES, MarginMode.ISOLATED, False, False),
|
||||
# * Remove once implemented
|
||||
("binance", TradingMode.MARGIN, MarginMode.CROSS, True),
|
||||
("binance", TradingMode.FUTURES, MarginMode.CROSS, False),
|
||||
("kraken", TradingMode.MARGIN, MarginMode.CROSS, True),
|
||||
("kraken", TradingMode.FUTURES, MarginMode.CROSS, True),
|
||||
("gate", TradingMode.MARGIN, MarginMode.CROSS, True),
|
||||
("gate", TradingMode.FUTURES, MarginMode.CROSS, True),
|
||||
("binance", TradingMode.MARGIN, MarginMode.CROSS, False, True),
|
||||
("binance", TradingMode.FUTURES, MarginMode.CROSS, False, False),
|
||||
("binance", TradingMode.FUTURES, None, False, True),
|
||||
# Validate without margin mode
|
||||
("binance", TradingMode.FUTURES, None, True, False),
|
||||
("kraken", TradingMode.MARGIN, MarginMode.CROSS, False, True),
|
||||
("kraken", TradingMode.FUTURES, MarginMode.CROSS, False, True),
|
||||
("gate", TradingMode.MARGIN, MarginMode.CROSS, False, True),
|
||||
("gate", TradingMode.FUTURES, MarginMode.CROSS, False, True),
|
||||
# * Uncomment once implemented
|
||||
# ("binance", TradingMode.MARGIN, MarginMode.CROSS, False),
|
||||
# ("binance", TradingMode.FUTURES, MarginMode.CROSS, False),
|
||||
# ("kraken", TradingMode.MARGIN, MarginMode.CROSS, False),
|
||||
# ("kraken", TradingMode.FUTURES, MarginMode.CROSS, False),
|
||||
# ("gate", TradingMode.MARGIN, MarginMode.CROSS, False),
|
||||
# ("gate", TradingMode.FUTURES, MarginMode.CROSS, False),
|
||||
# ("binance", TradingMode.MARGIN, MarginMode.CROSS, False, False),
|
||||
# ("binance", TradingMode.FUTURES, MarginMode.CROSS, False, False),
|
||||
# ("kraken", TradingMode.MARGIN, MarginMode.CROSS, False, False),
|
||||
# ("kraken", TradingMode.FUTURES, MarginMode.CROSS, False, False),
|
||||
# ("gate", TradingMode.MARGIN, MarginMode.CROSS, False, False),
|
||||
# ("gate", TradingMode.FUTURES, MarginMode.CROSS, False, False),
|
||||
],
|
||||
)
|
||||
def test_validate_trading_mode_and_margin_mode(
|
||||
default_conf, mocker, exchange_name, trading_mode, margin_mode, exception_thrown
|
||||
default_conf,
|
||||
mocker,
|
||||
exchange_name,
|
||||
trading_mode,
|
||||
margin_mode,
|
||||
allow_none_margin_mode,
|
||||
exception_thrown,
|
||||
):
|
||||
exchange = get_patched_exchange(
|
||||
mocker, default_conf, exchange=exchange_name, mock_supported_modes=False
|
||||
)
|
||||
if exception_thrown:
|
||||
with pytest.raises(OperationalException):
|
||||
exchange.validate_trading_mode_and_margin_mode(trading_mode, margin_mode)
|
||||
exchange.validate_trading_mode_and_margin_mode(
|
||||
trading_mode, margin_mode, allow_none_margin_mode
|
||||
)
|
||||
else:
|
||||
exchange.validate_trading_mode_and_margin_mode(trading_mode, margin_mode)
|
||||
exchange.validate_trading_mode_and_margin_mode(
|
||||
trading_mode, margin_mode, allow_none_margin_mode
|
||||
)
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import logging
|
||||
import shutil
|
||||
import sys
|
||||
from pathlib import Path
|
||||
from unittest.mock import MagicMock
|
||||
|
||||
@@ -34,6 +35,9 @@ def can_run_model(model: str) -> None:
|
||||
if is_arm() and "Catboost" in model:
|
||||
pytest.skip("CatBoost is not supported on ARM.")
|
||||
|
||||
if "Catboost" in model and sys.version_info >= (3, 14):
|
||||
pytest.skip("CatBoost is not supported on Python 3.14+.")
|
||||
|
||||
if is_pytorch_model and is_mac():
|
||||
pytest.skip("Reinforcement learning / PyTorch module not available on intel based Mac OS.")
|
||||
|
||||
|
||||
@@ -501,7 +501,7 @@ def test_populate_indicators(hyperopt, testdatadir) -> None:
|
||||
def test_generate_optimizer(mocker, hyperopt_conf) -> None:
|
||||
hyperopt_conf.update(
|
||||
{
|
||||
"spaces": "all",
|
||||
"spaces": ["all"],
|
||||
"hyperopt_min_trades": 1,
|
||||
}
|
||||
)
|
||||
@@ -569,6 +569,8 @@ def test_generate_optimizer(mocker, hyperopt_conf) -> None:
|
||||
"buy_rsi": 35,
|
||||
"sell_minusdi": 0.02,
|
||||
"sell_rsi": 75,
|
||||
"exit_rsi": 7,
|
||||
"exitaaa": 7,
|
||||
"protection_cooldown_lookback": 20,
|
||||
"protection_enabled": True,
|
||||
"roi_t1": 60.0,
|
||||
@@ -597,6 +599,12 @@ def test_generate_optimizer(mocker, hyperopt_conf) -> None:
|
||||
"buy_plusdi": 0.02,
|
||||
"buy_rsi": 35,
|
||||
},
|
||||
"exitaspace": {
|
||||
"exitaaa": 7,
|
||||
},
|
||||
"exit": {
|
||||
"exit_rsi": 7,
|
||||
},
|
||||
"roi": {"0": 0.12, "20.0": 0.02, "50.0": 0.01, "110.0": 0},
|
||||
"protection": {
|
||||
"protection_cooldown_lookback": 20,
|
||||
@@ -616,7 +624,7 @@ def test_generate_optimizer(mocker, hyperopt_conf) -> None:
|
||||
"max_open_trades": {"max_open_trades": 3},
|
||||
},
|
||||
"params_dict": optimizer_param,
|
||||
"params_not_optimized": {"buy": {}, "protection": {}, "sell": {}},
|
||||
"params_not_optimized": {},
|
||||
"results_metrics": ANY,
|
||||
"total_profit": 3.1e-08,
|
||||
}
|
||||
@@ -897,23 +905,48 @@ def test_simplified_interface_all_failed(mocker, hyperopt_conf, caplog) -> None:
|
||||
}
|
||||
)
|
||||
|
||||
mocker.patch(
|
||||
"freqtrade.optimize.hyperopt.hyperopt_auto.HyperOptAuto._generate_indicator_space",
|
||||
return_value=[],
|
||||
)
|
||||
|
||||
hyperopt = Hyperopt(hyperopt_conf)
|
||||
hyperopt.hyperopter.backtesting.strategy.advise_all_indicators = MagicMock()
|
||||
hyperopt.hyperopter.backtesting.strategy.enumerate_parameters = MagicMock(return_value=[])
|
||||
hyperopt.hyperopter.custom_hyperopt.generate_roi_table = MagicMock(return_value={})
|
||||
|
||||
with pytest.raises(OperationalException, match=r"The 'protection' space is included into *"):
|
||||
# The first one to fail raises the exception
|
||||
with pytest.raises(OperationalException, match=r"The 'buy' space is included into *"):
|
||||
hyperopt.hyperopter.init_spaces()
|
||||
|
||||
hyperopt.config["hyperopt_ignore_missing_space"] = True
|
||||
caplog.clear()
|
||||
hyperopt.hyperopter.init_spaces()
|
||||
assert log_has_re(r"The 'protection' space is included into *", caplog)
|
||||
assert hyperopt.hyperopter.protection_space == []
|
||||
assert hyperopt.hyperopter.spaces["protection"] == []
|
||||
|
||||
|
||||
def test_simplified_interface_none_selected(mocker, hyperopt_conf, caplog) -> None:
|
||||
mocker.patch("freqtrade.optimize.hyperopt.hyperopt_optimizer.dump", MagicMock())
|
||||
mocker.patch("freqtrade.optimize.hyperopt.hyperopt.file_dump_json")
|
||||
mocker.patch(
|
||||
"freqtrade.optimize.backtesting.Backtesting.load_bt_data",
|
||||
MagicMock(return_value=(MagicMock(), None)),
|
||||
)
|
||||
mocker.patch(
|
||||
"freqtrade.optimize.hyperopt.hyperopt_optimizer.get_timerange",
|
||||
MagicMock(return_value=(datetime(2017, 12, 10), datetime(2017, 12, 13))),
|
||||
)
|
||||
|
||||
patch_exchange(mocker)
|
||||
|
||||
hyperopt_conf.update(
|
||||
{
|
||||
"spaces": [],
|
||||
}
|
||||
)
|
||||
|
||||
hyperopt = Hyperopt(hyperopt_conf)
|
||||
hyperopt.hyperopter.backtesting.strategy.advise_all_indicators = MagicMock()
|
||||
hyperopt.hyperopter.custom_hyperopt.generate_roi_table = MagicMock(return_value={})
|
||||
|
||||
with pytest.raises(OperationalException, match=r"No hyperopt parameters found to optimize\..*"):
|
||||
hyperopt.hyperopter.init_spaces()
|
||||
|
||||
|
||||
def test_simplified_interface_buy(mocker, hyperopt_conf, capsys) -> None:
|
||||
@@ -1047,16 +1080,13 @@ def test_simplified_interface_failed(mocker, hyperopt_conf, space) -> None:
|
||||
"freqtrade.optimize.hyperopt.hyperopt_optimizer.get_timerange",
|
||||
MagicMock(return_value=(datetime(2017, 12, 10), datetime(2017, 12, 13))),
|
||||
)
|
||||
mocker.patch(
|
||||
"freqtrade.optimize.hyperopt.hyperopt_auto.HyperOptAuto._generate_indicator_space",
|
||||
return_value=[],
|
||||
)
|
||||
|
||||
patch_exchange(mocker)
|
||||
|
||||
hyperopt_conf.update({"spaces": [space]})
|
||||
|
||||
hyperopt = Hyperopt(hyperopt_conf)
|
||||
hyperopt.hyperopter.backtesting.strategy.enumerate_parameters = MagicMock(return_value=[])
|
||||
hyperopt.hyperopter.backtesting.strategy.advise_all_indicators = MagicMock()
|
||||
hyperopt.hyperopter.custom_hyperopt.generate_roi_table = MagicMock(return_value={})
|
||||
|
||||
|
||||
@@ -296,14 +296,14 @@ def test_show_epoch_details(capsys):
|
||||
|
||||
HyperoptTools.show_epoch_details(test_result, 5, False, no_header=True)
|
||||
captured = capsys.readouterr()
|
||||
assert "# Trailing stop:" in captured.out
|
||||
assert "# Trailing stop parameters:" in captured.out
|
||||
# re.match(r"Pairs for .*", captured.out)
|
||||
assert re.search(r"^\s+trailing_stop = True$", captured.out, re.MULTILINE)
|
||||
assert re.search(r"^\s+trailing_stop_positive = 0.02$", captured.out, re.MULTILINE)
|
||||
assert re.search(r"^\s+trailing_stop_positive_offset = 0.04$", captured.out, re.MULTILINE)
|
||||
assert re.search(r"^\s+trailing_only_offset_is_reached = True$", captured.out, re.MULTILINE)
|
||||
|
||||
assert "# ROI table:" in captured.out
|
||||
assert "# ROI parameters:" in captured.out
|
||||
assert re.search(r"^\s+minimal_roi = \{$", captured.out, re.MULTILINE)
|
||||
assert re.search(r"^\s+\"90\"\:\s0.14,\s*$", captured.out, re.MULTILINE)
|
||||
|
||||
|
||||
@@ -2334,6 +2334,36 @@ def test_FullTradesFilter(mocker, default_conf_usdt, fee, caplog) -> None:
|
||||
["ETH/USDT:USDT", "ADA/USDT:USDT"],
|
||||
["layer-1", "protocol"],
|
||||
),
|
||||
(
|
||||
[
|
||||
# Blacklist high MC pairs
|
||||
{"method": "StaticPairList", "allow_inactive": True},
|
||||
{"method": "MarketCapPairList", "mode": "blacklist"},
|
||||
],
|
||||
"spot",
|
||||
["LTC/USDT", "NEO/USDT", "TKN/USDT", "ETC/USDT"],
|
||||
1,
|
||||
),
|
||||
(
|
||||
[
|
||||
# Blacklist high MC pairs
|
||||
{"method": "StaticPairList", "allow_inactive": True},
|
||||
{"method": "MarketCapPairList", "mode": "blacklist", "max_rank": 2},
|
||||
],
|
||||
"spot",
|
||||
["LTC/USDT", "XRP/USDT", "NEO/USDT", "TKN/USDT", "ETC/USDT", "ADA/USDT"],
|
||||
1,
|
||||
),
|
||||
(
|
||||
[
|
||||
# Blacklist top 6 MarketCap pairs - removes XRP which is at spot 6.
|
||||
{"method": "StaticPairList", "allow_inactive": True},
|
||||
{"method": "MarketCapPairList", "mode": "blacklist", "max_rank": 6},
|
||||
],
|
||||
"spot",
|
||||
["LTC/USDT", "NEO/USDT", "TKN/USDT", "ETC/USDT", "ADA/USDT"],
|
||||
1,
|
||||
),
|
||||
],
|
||||
)
|
||||
def test_MarketCapPairList_filter(
|
||||
|
||||
@@ -35,6 +35,9 @@ class HyperoptableStrategy(StrategyTestV3):
|
||||
sell_minusdi = DecimalParameter(
|
||||
low=0, high=1, default=0.5001, decimals=3, space="sell", load=False
|
||||
)
|
||||
exitaaa = IntParameter(low=0, high=10, default=5, space="exitaspace")
|
||||
|
||||
exit_rsi = IntParameter(low=0, high=10, default=5)
|
||||
protection_enabled = BooleanParameter(default=True)
|
||||
protection_cooldown_lookback = IntParameter([0, 50], default=30)
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ from freqtrade.enums import ExitCheckTuple, ExitType, SignalDirection
|
||||
from freqtrade.exceptions import OperationalException, StrategyError
|
||||
from freqtrade.persistence import PairLocks, Trade
|
||||
from freqtrade.resolvers import StrategyResolver
|
||||
from freqtrade.strategy.hyper import detect_parameters
|
||||
from freqtrade.strategy.hyper import detect_all_parameters
|
||||
from freqtrade.strategy.parameters import (
|
||||
IntParameter,
|
||||
)
|
||||
@@ -928,8 +928,7 @@ def test_auto_hyperopt_interface(default_conf):
|
||||
PairLocks.timeframe = default_conf["timeframe"]
|
||||
strategy = StrategyResolver.load_strategy(default_conf)
|
||||
strategy.ft_bot_start()
|
||||
with pytest.raises(OperationalException):
|
||||
next(strategy.enumerate_parameters("deadBeef"))
|
||||
assert list(strategy.enumerate_parameters("deadBeef")) == []
|
||||
|
||||
assert strategy.buy_rsi.value == strategy.buy_params["buy_rsi"]
|
||||
# PlusDI is NOT in the buy-params, so default should be used
|
||||
@@ -940,20 +939,52 @@ def test_auto_hyperopt_interface(default_conf):
|
||||
|
||||
# Parameter is disabled - so value from sell_param dict will NOT be used.
|
||||
assert strategy.sell_minusdi.value == 0.5
|
||||
all_params = strategy.detect_all_parameters()
|
||||
all_params = detect_all_parameters(strategy.__class__)
|
||||
assert isinstance(all_params, dict)
|
||||
# Only one buy param at class level
|
||||
assert len(all_params["buy"]) == 1
|
||||
# Running detect params at instance level reveals both parameters.
|
||||
assert len(list(detect_parameters(strategy, "buy"))) == 2
|
||||
assert len(all_params["sell"]) == 2
|
||||
# Number of Hyperoptable parameters
|
||||
assert all_params["count"] == 5
|
||||
params_inst = detect_all_parameters(strategy)
|
||||
assert len(params_inst["buy"]) == 2
|
||||
assert len(params_inst["sell"]) == 2
|
||||
|
||||
strategy.__class__.sell_rsi = IntParameter([0, 10], default=5, space="buy")
|
||||
|
||||
with pytest.raises(OperationalException, match=r"Inconclusive parameter.*"):
|
||||
[x for x in detect_parameters(strategy, "sell")]
|
||||
spaces = detect_all_parameters(strategy.__class__)
|
||||
assert "buy" in spaces
|
||||
assert spaces["buy"]["sell_rsi"] == strategy.sell_rsi
|
||||
del strategy.__class__.sell_rsi
|
||||
|
||||
strategy.__class__.exit22_rsi = IntParameter([0, 10], default=5)
|
||||
|
||||
with pytest.raises(
|
||||
OperationalException, match=r"Cannot determine parameter space for exit22_rsi\."
|
||||
):
|
||||
detect_all_parameters(strategy.__class__)
|
||||
|
||||
# Invalid parameter space
|
||||
strategy.__class__.exit22_rsi = IntParameter([0, 10], default=5, space="all")
|
||||
with pytest.raises(
|
||||
OperationalException, match=r"'all' is not a valid space\. Parameter: exit22_rsi\."
|
||||
):
|
||||
detect_all_parameters(strategy.__class__)
|
||||
|
||||
strategy.__class__.exit22_rsi = IntParameter([0, 10], default=5, space="hello:world:22")
|
||||
with pytest.raises(
|
||||
OperationalException,
|
||||
match=r"'hello:world:22' is not a valid space\. Parameter: exit22_rsi\.",
|
||||
):
|
||||
detect_all_parameters(strategy.__class__)
|
||||
del strategy.__class__.exit22_rsi
|
||||
|
||||
# Valid exit parameter
|
||||
strategy.__class__.exit_rsi = IntParameter([0, 10], default=5)
|
||||
strategy.__class__.enter_rsi = IntParameter([0, 10], default=5)
|
||||
spaces = detect_all_parameters(strategy.__class__)
|
||||
assert "exit" in spaces
|
||||
assert "enter" in spaces
|
||||
del strategy.__class__.exit_rsi
|
||||
del strategy.__class__.enter_rsi
|
||||
|
||||
|
||||
def test_auto_hyperopt_interface_loadparams(default_conf, mocker, caplog):
|
||||
|
||||
@@ -96,6 +96,16 @@ def test_load_strategy_invalid_directory(caplog, default_conf, tmp_path):
|
||||
assert log_has_re(r"Path .*" + r"some.*path.*" + r".* does not exist", caplog)
|
||||
|
||||
|
||||
def test_load_strategy_skip_other_files(caplog, default_conf, tmp_path):
|
||||
default_conf["user_data_dir"] = tmp_path
|
||||
caplog.set_level(logging.DEBUG)
|
||||
|
||||
s = StrategyResolver._load_strategy("StrategyTestV3", config=default_conf)
|
||||
assert isinstance(s, IStrategy)
|
||||
|
||||
assert log_has_re(r"Skipping .* as it does not contain class StrategyTestV3\.", caplog)
|
||||
|
||||
|
||||
def test_load_not_found_strategy(default_conf, tmp_path):
|
||||
default_conf["user_data_dir"] = tmp_path
|
||||
default_conf["strategy"] = "NotFoundStrategy"
|
||||
|
||||
Reference in New Issue
Block a user