Compare commits

..

255 Commits

Author SHA1 Message Date
Matthias 157cb7d982 Merge pull request #10725 from freqtrade/new_release
New release 2024.9
2024-09-30 11:25:43 +02:00
Matthias 27af9455f5 chore: bump version to 2024.9 2024-09-29 19:53:20 +02:00
Matthias 98ff572afe Merge branch 'stable' into new_release 2024-09-29 19:53:03 +02:00
Matthias 415b8354f4 fix: if coingecko when no pair returned
fails to return valid pairs, the pairlist should be empty
2024-09-28 19:45:01 +02:00
Matthias 51c596a21f chore: add test for "no pair from coingecko" case
this should return an empty list
2024-09-28 19:44:38 +02:00
Matthias 5816a594fd Merge pull request #10671 from jakubikan/category-for-market-cap-pairlist
Category for market cap pairlist
2024-09-28 11:51:42 +02:00
Matthias f4d76aa360 chore: improved wording 2024-09-28 10:18:59 +02:00
Matthias 56835f5f09 chore: manually check for symlink 2024-09-28 10:17:52 +02:00
Matthias 255ad7cac5 tests: test invalid category in list 2024-09-28 10:14:31 +02:00
Matthias 8c097a81ea tests: enhance test for marketcappairlist 2024-09-28 10:10:07 +02:00
Matthias 3dc92b42fe fix: Check if sub-directories are actually directories and fail otherwise.
This will explicitly fail if a file (or an invalid symlink) is present.
Freqtrade requires these files to be valid files - so failing here is correct behavior.

closes #10720
2024-09-28 09:54:49 +02:00
Jakub W. 1ed5a37280 Update freqtrade/plugins/pairlist/IPairList.py
Co-authored-by: Matthias <xmatthias@outlook.com>
2024-09-26 23:38:17 +02:00
Matthias cb36f2844e chore: Improve "wrong category" error. 2024-09-26 20:21:27 +02:00
Matthias 7b93b55b78 docs: rephrase categories docs and add performance warning 2024-09-26 20:07:41 +02:00
Matthias 6837196e44 fix: treat marketcap as optional parameter 2024-09-26 19:59:23 +02:00
Matthias 31680f3b59 chore: Improve UI wording 2024-09-26 19:31:43 +02:00
Matthias 91d9c9b4d5 Merge pull request #10711 from freqtrade/fix/pytorch-scaling
fix: Update BasePyTorchRegressor.py
2024-09-26 18:53:14 +02:00
Robert Caulk d18d8cf0ea freqai_info -> ft_params 2024-09-26 17:54:14 +02:00
Robert Caulk 123909cdac fix: Update BasePyTorchRegressor.py 2024-09-26 16:31:43 +02:00
Matthias f0eaccc6ac Merge pull request #10709 from freqtrade/update/binance-leverage-tiers
Update Binance Leverage Tiers
2024-09-26 06:20:14 +02:00
xmatthias 1d66ef2f2d chore: update pre-commit hooks 2024-09-26 03:17:36 +00:00
Jakub Werner (jakubikan) 8aefae3aff format 2024-09-25 21:22:40 +02:00
Jakub Werner (jakubikan) 514558796b double quotes 2024-09-25 21:21:56 +02:00
Jakub Werner (jakubikan) b00ca54707 adding docu 2024-09-25 21:20:35 +02:00
Jakub Werner (jakubikan) 0dbe507b26 making list of categories available 2024-09-25 21:11:52 +02:00
Matthias 4b70bea21f chore: reset params for emulated call 2024-09-25 19:11:12 +02:00
Matthias 096a051b99 test: update test 2024-09-25 19:03:03 +02:00
Matthias a3ca1ff1e9 fix: send acknoledged to bybit fetch_order calls 2024-09-25 19:02:32 +02:00
Matthias 28eabfe477 tests: update test for retryable okx behavior 2024-09-25 06:20:49 +02:00
Matthias 0a68b0515c chore: reduce retry count for stop orders 2024-09-24 20:20:33 +02:00
Matthias 566c0c8f72 refactor: split okx fetch stop fallback 2024-09-24 20:20:33 +02:00
Matthias 333f2cb472 fix: Improve error handling for OKX stop orders
closes #10704
2024-09-24 19:38:36 +02:00
Matthias 3d1acc65af tests: add test for #10704 2024-09-24 19:38:11 +02:00
Matthias 5907de90c1 Merge pull request #10687 from freqtrade/refactor/trade_init_0
Initialize Trade objects with amount=0
2024-09-24 06:30:24 +02:00
Matthias 25d8a9d1f8 Merge pull request #10701 from freqtrade/update/pre-commit-hooks
Update pre-commit hooks
2024-09-24 06:30:09 +02:00
xmatthias b44e8199b5 chore: update pre-commit hooks 2024-09-24 03:06:51 +00:00
Matthias 91449d0c8b Merge pull request #10699 from freqtrade/dependabot/pip/develop/ccxt-4.4.6
chore(deps): bump ccxt from 4.4.5 to 4.4.6
2024-09-23 13:05:49 +02:00
dependabot[bot] b228f177f3 chore(deps): bump ccxt from 4.4.5 to 4.4.6
Bumps [ccxt](https://github.com/ccxt/ccxt) from 4.4.5 to 4.4.6.
- [Release notes](https://github.com/ccxt/ccxt/releases)
- [Changelog](https://github.com/ccxt/ccxt/blob/master/CHANGELOG.md)
- [Commits](https://github.com/ccxt/ccxt/compare/4.4.5...4.4.6)

---
updated-dependencies:
- dependency-name: ccxt
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-09-23 09:57:20 +00:00
Matthias 9a40a2d4f2 Merge pull request #10695 from freqtrade/dependabot/pip/develop/sqlalchemy-2.0.35
chore(deps): bump sqlalchemy from 2.0.34 to 2.0.35
2024-09-23 11:56:28 +02:00
Matthias cdc3dabba1 Merge pull request #10693 from freqtrade/dependabot/pip/develop/fastapi-0.115.0
chore(deps): bump fastapi from 0.114.2 to 0.115.0
2024-09-23 11:30:26 +02:00
Matthias 40ba2cbe79 Merge pull request #10690 from freqtrade/dependabot/pip/develop/pymdown-extensions-10.10.1
chore(deps): bump pymdown-extensions from 10.9 to 10.10.1
2024-09-23 11:03:54 +02:00
Matthias 7ede8af193 Merge branch 'develop' into dependabot/pip/develop/sqlalchemy-2.0.35 2024-09-23 10:52:07 +02:00
Matthias a835b8cc8f Merge pull request #10698 from freqtrade/dependabot/pip/develop/filelock-3.16.1
chore(deps): bump filelock from 3.16.0 to 3.16.1
2024-09-23 09:44:11 +02:00
Matthias e54b47b857 Merge pull request #10697 from freqtrade/dependabot/pip/develop/python-telegram-bot-21.6
chore(deps): bump python-telegram-bot from 21.5 to 21.6
2024-09-23 09:28:28 +02:00
Matthias c93c25829b Merge pull request #10696 from freqtrade/dependabot/pip/develop/ruff-0.6.7
chore(deps-dev): bump ruff from 0.6.5 to 0.6.7
2024-09-23 09:24:19 +02:00
dependabot[bot] 1cdf8b29a5 chore(deps): bump fastapi from 0.114.2 to 0.115.0
Bumps [fastapi](https://github.com/fastapi/fastapi) from 0.114.2 to 0.115.0.
- [Release notes](https://github.com/fastapi/fastapi/releases)
- [Commits](https://github.com/fastapi/fastapi/compare/0.114.2...0.115.0)

---
updated-dependencies:
- dependency-name: fastapi
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-09-23 06:38:27 +00:00
Matthias b6eacf0771 Merge pull request #10694 from freqtrade/dependabot/pip/develop/pandas-2.2.3
chore(deps): bump pandas from 2.2.2 to 2.2.3
2024-09-23 08:37:49 +02:00
Matthias 4ea23c1bd8 Merge pull request #10692 from freqtrade/dependabot/pip/develop/websockets-13.1
chore(deps): bump websockets from 13.0.1 to 13.1
2024-09-23 08:37:01 +02:00
Matthias 70398820c0 Merge pull request #10691 from freqtrade/dependabot/pip/develop/pydantic-2.9.2
chore(deps): bump pydantic from 2.9.1 to 2.9.2
2024-09-23 08:36:21 +02:00
dependabot[bot] 04abc4d12f chore(deps): bump pymdown-extensions from 10.9 to 10.10.1
Bumps [pymdown-extensions](https://github.com/facelessuser/pymdown-extensions) from 10.9 to 10.10.1.
- [Release notes](https://github.com/facelessuser/pymdown-extensions/releases)
- [Commits](https://github.com/facelessuser/pymdown-extensions/compare/10.9...10.10.1)

---
updated-dependencies:
- dependency-name: pymdown-extensions
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-09-23 06:24:37 +00:00
Matthias 8491f46045 Merge pull request #10689 from freqtrade/dependabot/pip/develop/mkdocs-73612938eb
chore(deps): bump mkdocs-material from 9.5.34 to 9.5.36 in the mkdocs group
2024-09-23 08:23:40 +02:00
Matthias 4aa909e587 Merge pull request #10688 from freqtrade/dependabot/github_actions/develop/pypa/gh-action-pypi-publish-1.10.2
chore(deps): bump pypa/gh-action-pypi-publish from 1.10.1 to 1.10.2
2024-09-23 08:23:22 +02:00
Matthias 9f5e4b5812 chore: update sqlalchemy in pre-commit config 2024-09-23 06:34:12 +02:00
dependabot[bot] 06eb5abf11 chore(deps): bump filelock from 3.16.0 to 3.16.1
Bumps [filelock](https://github.com/tox-dev/py-filelock) from 3.16.0 to 3.16.1.
- [Release notes](https://github.com/tox-dev/py-filelock/releases)
- [Changelog](https://github.com/tox-dev/filelock/blob/main/docs/changelog.rst)
- [Commits](https://github.com/tox-dev/py-filelock/compare/3.16.0...3.16.1)

---
updated-dependencies:
- dependency-name: filelock
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-09-23 03:48:44 +00:00
dependabot[bot] 29e6e3b374 chore(deps): bump python-telegram-bot from 21.5 to 21.6
Bumps [python-telegram-bot](https://github.com/python-telegram-bot/python-telegram-bot) from 21.5 to 21.6.
- [Release notes](https://github.com/python-telegram-bot/python-telegram-bot/releases)
- [Changelog](https://github.com/python-telegram-bot/python-telegram-bot/blob/master/CHANGES.rst)
- [Commits](https://github.com/python-telegram-bot/python-telegram-bot/compare/v21.5...v21.6)

---
updated-dependencies:
- dependency-name: python-telegram-bot
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-09-23 03:48:38 +00:00
dependabot[bot] 2fc97f83f4 chore(deps-dev): bump ruff from 0.6.5 to 0.6.7
Bumps [ruff](https://github.com/astral-sh/ruff) from 0.6.5 to 0.6.7.
- [Release notes](https://github.com/astral-sh/ruff/releases)
- [Changelog](https://github.com/astral-sh/ruff/blob/main/CHANGELOG.md)
- [Commits](https://github.com/astral-sh/ruff/compare/0.6.5...0.6.7)

---
updated-dependencies:
- dependency-name: ruff
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-09-23 03:48:26 +00:00
dependabot[bot] 1e761b4c7d chore(deps): bump sqlalchemy from 2.0.34 to 2.0.35
Bumps [sqlalchemy](https://github.com/sqlalchemy/sqlalchemy) from 2.0.34 to 2.0.35.
- [Release notes](https://github.com/sqlalchemy/sqlalchemy/releases)
- [Changelog](https://github.com/sqlalchemy/sqlalchemy/blob/main/CHANGES.rst)
- [Commits](https://github.com/sqlalchemy/sqlalchemy/commits)

---
updated-dependencies:
- dependency-name: sqlalchemy
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-09-23 03:48:12 +00:00
dependabot[bot] a2ca136f1f chore(deps): bump pandas from 2.2.2 to 2.2.3
Bumps [pandas](https://github.com/pandas-dev/pandas) from 2.2.2 to 2.2.3.
- [Release notes](https://github.com/pandas-dev/pandas/releases)
- [Commits](https://github.com/pandas-dev/pandas/compare/v2.2.2...v2.2.3)

---
updated-dependencies:
- dependency-name: pandas
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-09-23 03:47:58 +00:00
dependabot[bot] 94322664f2 chore(deps): bump websockets from 13.0.1 to 13.1
Bumps [websockets](https://github.com/python-websockets/websockets) from 13.0.1 to 13.1.
- [Release notes](https://github.com/python-websockets/websockets/releases)
- [Commits](https://github.com/python-websockets/websockets/compare/13.0.1...13.1)

---
updated-dependencies:
- dependency-name: websockets
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-09-23 03:47:39 +00:00
dependabot[bot] cbd5c6d3e9 chore(deps): bump pydantic from 2.9.1 to 2.9.2
Bumps [pydantic](https://github.com/pydantic/pydantic) from 2.9.1 to 2.9.2.
- [Release notes](https://github.com/pydantic/pydantic/releases)
- [Changelog](https://github.com/pydantic/pydantic/blob/main/HISTORY.md)
- [Commits](https://github.com/pydantic/pydantic/compare/v2.9.1...v2.9.2)

---
updated-dependencies:
- dependency-name: pydantic
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-09-23 03:47:32 +00:00
dependabot[bot] 0428dc8381 chore(deps): bump mkdocs-material in the mkdocs group
Bumps the mkdocs group with 1 update: [mkdocs-material](https://github.com/squidfunk/mkdocs-material).


Updates `mkdocs-material` from 9.5.34 to 9.5.36
- [Release notes](https://github.com/squidfunk/mkdocs-material/releases)
- [Changelog](https://github.com/squidfunk/mkdocs-material/blob/master/CHANGELOG)
- [Commits](https://github.com/squidfunk/mkdocs-material/compare/9.5.34...9.5.36)

---
updated-dependencies:
- dependency-name: mkdocs-material
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: mkdocs
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-09-23 03:47:22 +00:00
dependabot[bot] 01e7b0da46 chore(deps): bump pypa/gh-action-pypi-publish from 1.10.1 to 1.10.2
Bumps [pypa/gh-action-pypi-publish](https://github.com/pypa/gh-action-pypi-publish) from 1.10.1 to 1.10.2.
- [Release notes](https://github.com/pypa/gh-action-pypi-publish/releases)
- [Commits](https://github.com/pypa/gh-action-pypi-publish/compare/v1.10.1...v1.10.2)

---
updated-dependencies:
- dependency-name: pypa/gh-action-pypi-publish
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-09-23 03:22:42 +00:00
Matthias b37dadcc05 tests: dry-wallets test update 2024-09-22 13:22:37 +02:00
Matthias 8e6151fe65 fix: properly consider open order values as "tied up" stake. 2024-09-22 13:17:27 +02:00
Matthias 9b346c0937 docs: add hint about amount being 0 2024-09-22 09:20:49 +02:00
Matthias b09f80ca30 tests: improve create_trade test 2024-09-22 08:47:52 +02:00
Matthias 0e0af82290 fix: odd calculation in calc_profit_ratio 2024-09-22 08:47:52 +02:00
Matthias c69b09cbff tests: fix amount=0 test 2024-09-22 08:47:52 +02:00
Matthias b8ba6cd970 tests: update rpc_status 2024-09-22 08:47:52 +02:00
Matthias 004e30d6be tests: update force_sell test to not use empty amount column 2024-09-22 08:47:52 +02:00
Matthias b084efdd06 feat: initialize trade objects with 0 amount
This way, it'll represent the owned amount
which will be updated once the order fills
2024-09-22 08:47:52 +02:00
Matthias d377d8462f fix: improve resiliance of order parsing
closes #10676
2024-09-22 08:28:29 +02:00
Matthias 2bbec9f9b1 tests: fix random test failure by reading time only once 2024-09-21 16:59:02 +02:00
Matthias b326908487 tests: Improve test resiliance 2024-09-21 16:40:00 +02:00
Matthias b21156a886 tests: improve stoploss test 2024-09-21 16:34:58 +02:00
Matthias 85138b0bc8 tests: Have exchange test get_historic_ohlcv properly 2024-09-21 09:06:26 +02:00
Matthias e0df0257d1 tests: Update history tests for new response 2024-09-20 07:26:45 +02:00
Matthias d23c1e8f92 refactor: Move dataframe parsing into get_historic_ohlcv 2024-09-20 07:23:52 +02:00
Matthias 670a40e67b chore: remove no longer valid todo 2024-09-20 07:06:21 +02:00
Matthias 3bbc6cbab1 chore: bump ccxt to 4.4.5
closes #10677
2024-09-19 20:41:32 +02:00
Matthias 15de53a22d chore: bump ccxt to 4.4.5
closes #10677
2024-09-19 20:36:56 +02:00
Matthias 59a44d6973 Merge pull request #10679 from freqtrade/update/binance-leverage-tiers
Update Binance Leverage Tiers
2024-09-19 06:29:02 +02:00
xmatthias 7561692352 chore: update pre-commit hooks 2024-09-19 03:15:32 +00:00
Matthias f50a633f87 docs: order table formatting 2024-09-18 07:11:12 +02:00
Jakub Werner (jakubikan) 50f07e7b11 only doing this if the category is set 2024-09-17 23:03:51 +02:00
Jakub Werner (jakubikan) 660623181a adding category list if the category is not from the category 2024-09-17 22:36:21 +02:00
Jakub Werner (jakubikan) 03ee3aaf40 adding category list if the category is not from the category 2024-09-17 22:35:00 +02:00
Matthias ad295946c0 fix: use precise calculation for decrease adjustment calculations 2024-09-17 20:19:22 +02:00
Matthias c28446dad0 Merge pull request #10672 from freqtrade/update/pre-commit-hooks
Update pre-commit hooks
2024-09-17 06:28:16 +02:00
xmatthias ff9d1f2728 chore: update pre-commit hooks 2024-09-17 03:03:39 +00:00
Jakub Werner (jakubikan) 0b7cb2a1a8 cleanup 2024-09-16 22:52:26 +02:00
Jakub Werner (jakubikan) 92af01b0cb adding category for MarketCapPairList.py 2024-09-16 22:51:42 +02:00
Jakub Werner (jakubikan) dc26d0d7ba adding category for MarketCapPairList.py 2024-09-16 22:50:08 +02:00
Matthias 2fe67edab3 chore: update link to okx liquidation formula 2024-09-16 19:05:00 +02:00
Matthias 167e43cbef Merge pull request #10655 from freqtrade/dependabot/pip/develop/types-dda07fe7e8
chore(deps-dev): bump types-requests from 2.32.0.20240907 to 2.32.0.20240914 in the types group
2024-09-16 11:12:07 +02:00
Matthias d8cb407c25 Merge pull request #10666 from freqtrade/dependabot/pip/develop/pydantic-2.9.1
chore(deps): bump pydantic from 2.9.0 to 2.9.1
2024-09-16 10:56:51 +02:00
Matthias 9452afe3f7 Merge pull request #10660 from freqtrade/dependabot/pip/develop/ruff-0.6.5
chore(deps-dev): bump ruff from 0.6.4 to 0.6.5
2024-09-16 10:21:12 +02:00
Matthias 8dc6d9ce7d Merge pull request #10665 from freqtrade/dependabot/pip/develop/rich-13.8.1
chore(deps): bump rich from 13.8.0 to 13.8.1
2024-09-16 09:45:01 +02:00
Matthias bf4b8a318d Merge pull request #10661 from freqtrade/dependabot/pip/develop/scikit-learn-1.5.2
chore(deps): bump scikit-learn from 1.5.1 to 1.5.2
2024-09-16 09:44:31 +02:00
Matthias 20f6022050 Merge pull request #10663 from freqtrade/dependabot/pip/develop/ccxt-4.4.3
chore(deps): bump ccxt from 4.3.98 to 4.4.3
2024-09-16 09:33:16 +02:00
dependabot[bot] 65e6c737cd chore(deps): bump pydantic from 2.9.0 to 2.9.1
Bumps [pydantic](https://github.com/pydantic/pydantic) from 2.9.0 to 2.9.1.
- [Release notes](https://github.com/pydantic/pydantic/releases)
- [Changelog](https://github.com/pydantic/pydantic/blob/main/HISTORY.md)
- [Commits](https://github.com/pydantic/pydantic/compare/v2.9.0...v2.9.1)

---
updated-dependencies:
- dependency-name: pydantic
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-09-16 07:07:06 +00:00
Matthias 6d2572e347 Merge pull request #10662 from freqtrade/dependabot/pip/develop/fastapi-0.114.2
chore(deps): bump fastapi from 0.114.0 to 0.114.2
2024-09-16 09:06:12 +02:00
Matthias 52a35197c7 Merge pull request #10659 from freqtrade/dependabot/pip/develop/pytz-2024.2
chore(deps): bump pytz from 2024.1 to 2024.2
2024-09-16 08:33:08 +02:00
Matthias 2b3a41db3e Merge pull request #10658 from freqtrade/dependabot/pip/develop/urllib3-2.2.3
chore(deps): bump urllib3 from 2.2.2 to 2.2.3
2024-09-16 08:32:52 +02:00
dependabot[bot] 09c1459411 chore(deps-dev): bump ruff from 0.6.4 to 0.6.5
Bumps [ruff](https://github.com/astral-sh/ruff) from 0.6.4 to 0.6.5.
- [Release notes](https://github.com/astral-sh/ruff/releases)
- [Changelog](https://github.com/astral-sh/ruff/blob/main/CHANGELOG.md)
- [Commits](https://github.com/astral-sh/ruff/compare/0.6.4...0.6.5)

---
updated-dependencies:
- dependency-name: ruff
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-09-16 06:17:40 +00:00
Matthias 98f18b89da Merge pull request #10657 from freqtrade/dependabot/pip/develop/plotly-5.24.1
chore(deps): bump plotly from 5.24.0 to 5.24.1
2024-09-16 08:16:56 +02:00
Matthias 4249db4330 Merge pull request #10656 from freqtrade/dependabot/pip/develop/pytest-baa91b6655
chore(deps-dev): bump pytest from 8.3.2 to 8.3.3 in the pytest group
2024-09-16 08:16:43 +02:00
Matthias a7f46500ed chore: bump types-requests in pre-commit 2024-09-16 06:38:45 +02:00
dependabot[bot] c73fa2b0eb chore(deps): bump rich from 13.8.0 to 13.8.1
Bumps [rich](https://github.com/Textualize/rich) from 13.8.0 to 13.8.1.
- [Release notes](https://github.com/Textualize/rich/releases)
- [Changelog](https://github.com/Textualize/rich/blob/master/CHANGELOG.md)
- [Commits](https://github.com/Textualize/rich/compare/v13.8.0...v13.8.1)

---
updated-dependencies:
- dependency-name: rich
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-09-16 03:18:09 +00:00
dependabot[bot] db4c4b971a chore(deps): bump ccxt from 4.3.98 to 4.4.3
Bumps [ccxt](https://github.com/ccxt/ccxt) from 4.3.98 to 4.4.3.
- [Release notes](https://github.com/ccxt/ccxt/releases)
- [Changelog](https://github.com/ccxt/ccxt/blob/master/CHANGELOG.md)
- [Commits](https://github.com/ccxt/ccxt/compare/4.3.98...4.4.3)

---
updated-dependencies:
- dependency-name: ccxt
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-09-16 03:17:58 +00:00
dependabot[bot] e9ccc98ada chore(deps): bump fastapi from 0.114.0 to 0.114.2
Bumps [fastapi](https://github.com/fastapi/fastapi) from 0.114.0 to 0.114.2.
- [Release notes](https://github.com/fastapi/fastapi/releases)
- [Commits](https://github.com/fastapi/fastapi/compare/0.114.0...0.114.2)

---
updated-dependencies:
- dependency-name: fastapi
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-09-16 03:17:46 +00:00
dependabot[bot] 11d6ec33b3 chore(deps): bump scikit-learn from 1.5.1 to 1.5.2
Bumps [scikit-learn](https://github.com/scikit-learn/scikit-learn) from 1.5.1 to 1.5.2.
- [Release notes](https://github.com/scikit-learn/scikit-learn/releases)
- [Commits](https://github.com/scikit-learn/scikit-learn/compare/1.5.1...1.5.2)

---
updated-dependencies:
- dependency-name: scikit-learn
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-09-16 03:17:39 +00:00
dependabot[bot] c3b6f4ca85 chore(deps): bump pytz from 2024.1 to 2024.2
Bumps [pytz](https://github.com/stub42/pytz) from 2024.1 to 2024.2.
- [Release notes](https://github.com/stub42/pytz/releases)
- [Commits](https://github.com/stub42/pytz/compare/release_2024.1...release_2024.2)

---
updated-dependencies:
- dependency-name: pytz
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-09-16 03:17:21 +00:00
dependabot[bot] d37405a307 chore(deps): bump urllib3 from 2.2.2 to 2.2.3
Bumps [urllib3](https://github.com/urllib3/urllib3) from 2.2.2 to 2.2.3.
- [Release notes](https://github.com/urllib3/urllib3/releases)
- [Changelog](https://github.com/urllib3/urllib3/blob/main/CHANGES.rst)
- [Commits](https://github.com/urllib3/urllib3/compare/2.2.2...2.2.3)

---
updated-dependencies:
- dependency-name: urllib3
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-09-16 03:17:05 +00:00
dependabot[bot] d7a9841328 chore(deps): bump plotly from 5.24.0 to 5.24.1
Bumps [plotly](https://github.com/plotly/plotly.py) from 5.24.0 to 5.24.1.
- [Release notes](https://github.com/plotly/plotly.py/releases)
- [Changelog](https://github.com/plotly/plotly.py/blob/master/CHANGELOG.md)
- [Commits](https://github.com/plotly/plotly.py/compare/v5.24.0...v5.24.1)

---
updated-dependencies:
- dependency-name: plotly
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-09-16 03:17:01 +00:00
dependabot[bot] cf3af42477 chore(deps-dev): bump pytest from 8.3.2 to 8.3.3 in the pytest group
Bumps the pytest group with 1 update: [pytest](https://github.com/pytest-dev/pytest).


Updates `pytest` from 8.3.2 to 8.3.3
- [Release notes](https://github.com/pytest-dev/pytest/releases)
- [Changelog](https://github.com/pytest-dev/pytest/blob/main/CHANGELOG.rst)
- [Commits](https://github.com/pytest-dev/pytest/compare/8.3.2...8.3.3)

---
updated-dependencies:
- dependency-name: pytest
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: pytest
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-09-16 03:16:39 +00:00
dependabot[bot] ad8e6e7d67 chore(deps-dev): bump types-requests in the types group
Bumps the types group with 1 update: [types-requests](https://github.com/python/typeshed).


Updates `types-requests` from 2.32.0.20240907 to 2.32.0.20240914
- [Commits](https://github.com/python/typeshed/commits)

---
updated-dependencies:
- dependency-name: types-requests
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: types
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-09-16 03:15:58 +00:00
Matthias ae41ab101a docs: remove skip_pair_validation - it's no longer used. 2024-09-15 11:28:57 +02:00
Matthias f4881e7c6f tests: Adjust tests for removed validate_pairlist functionality 2024-09-15 11:28:57 +02:00
Matthias 94ef4380d4 chore: remove validate_pairs from exchange class
Invalid pairs were filtered out before this was called in most cases.
in cases where it's not - regular pairlist-filtering provides proper warnings.
2024-09-15 11:28:57 +02:00
Matthias 7ebe1b8c14 chore: remove pointless validation
pairs are validated through expand_pairlist.
If they're not in markets, they'll no longer be in the
pairlist once this function function is hit.
2024-09-15 11:02:49 +02:00
Matthias 79020bba28 chore: Remove "prohibitedIn" check
it's only been used for bitrex, which does no longer exist.
apparently this was forgotten when decomissioning bittrex.
2024-09-15 10:49:26 +02:00
Matthias 95c250ebcc chore: add explaining comment 2024-09-15 10:37:28 +02:00
Matthias bfb14614cc chore: enhance change with comment 2024-09-15 09:48:44 +02:00
Matthias 12299d4810 feat: staticPairlist to warn for invalid pairs
Warnings about invalid pairs were "covered" by the implicit
filtering of `expand_pairlist()`
2024-09-15 09:46:47 +02:00
Matthias c67a9d4e84 docs: update pairlist creation docs 2024-09-15 09:29:45 +02:00
Matthias af422c7cd4 Merge pull request #10645 from dxbstyle/develop
added check for Kraken exchange
2024-09-14 10:44:23 +02:00
Matthias 51bdecea53 Improve check to cover more potential api oddities 2024-09-14 10:09:15 +02:00
Matthias 0f505c6d7b Improve check to cover more potential api oddities 2024-09-14 10:04:28 +02:00
Matthias ae72f10448 Merge pull request #10619 from KingND/pixel/feat/freqai_labels_are_okay_in_lookahead_analysis
feat: include lookahead-analysis table caption when biased_indicator is likely from FreqAI target
2024-09-14 09:51:38 +02:00
Matthias 9f34153c84 chore: update typing for reload function 2024-09-13 19:45:30 +02:00
Matthias c04cf6c5cb test: Improve test coverage of retry/fail logic 2024-09-13 07:24:08 +02:00
Matthias 5112736385 feat: Simplify reload_markets logic 2024-09-13 07:24:08 +02:00
Matthias 11eaa6d77c test: Add tests for new behavior 2024-09-13 07:24:08 +02:00
Matthias 6024903bde feat: conditionally apply retrier to market-reload
closes #10641
2024-09-13 07:23:58 +02:00
Matthias e96928588e Merge pull request #10639 from jainanuj94/backtesting
Add entry-only and exit-only filters to --indicator-list in backtesting analysis
2024-09-12 06:43:24 +02:00
Matthias 94e38d4cdd Merge pull request #10646 from freqtrade/update/binance-leverage-tiers
Update Binance Leverage Tiers
2024-09-12 06:36:11 +02:00
xmatthias d15921b3f2 chore: update pre-commit hooks 2024-09-12 03:12:54 +00:00
Matthias 3c6e2b89a4 Merge pull request #10640 from TheJoeSchr/fix/plot-orderflow-data-missing
fix: orderflow data was missing for plotting
2024-09-11 19:11:55 +02:00
Joe Schr 439658fcf1 fix: remove tests for orderflow data missing of other runmodes 2024-09-11 17:12:35 +02:00
Joe Schr c9acb1466c fix: orderflow data missing for plotting and other runmodes 2024-09-11 17:12:35 +02:00
Anuj Jain addd27faf8 Update tests and docs 2024-09-11 15:33:26 +05:30
Matthias 5605bdc7a3 Merge pull request #10644 from iridescentGray/develop
chore: remove redundant method
2024-09-11 06:40:53 +02:00
colorfulgray0 f1df7e9bdc chore: remove redundant method 2024-09-11 11:33:38 +08:00
Anuj Jain 4765656f87 Add filter for entry and exit only parameter 2024-09-10 15:21:56 +05:30
Matthias c3a00b93c2 Merge pull request #10637 from freqtrade/dependabot/docker/docker/python-3.12.6-slim-bookworm
chore(deps): bump python from 3.11.9-slim-bookworm to 3.11.10-slim-bookworm in /docker
2024-09-10 07:20:36 +02:00
Matthias e5d2ba7835 Merge pull request #10636 from freqtrade/dependabot/docker/python-3.12.6-slim-bookworm
chore(deps): bump python from 3.12.5-slim-bookworm to 3.12.6-slim-bookworm
2024-09-10 06:53:17 +02:00
Matthias 8c1b119e84 chore: rpi image should remain on 3.11 series 2024-09-10 06:25:17 +02:00
Matthias 593a54e6cb Merge pull request #10635 from freqtrade/update/pre-commit-hooks
Update pre-commit hooks
2024-09-10 06:23:20 +02:00
dependabot[bot] 95fa7083a9 chore(deps): bump python in /docker
Bumps python from 3.11.9-slim-bookworm to 3.12.6-slim-bookworm.

---
updated-dependencies:
- dependency-name: python
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-09-10 04:07:33 +00:00
dependabot[bot] 98e08df807 chore(deps): bump python
Bumps python from 3.12.5-slim-bookworm to 3.12.6-slim-bookworm.

---
updated-dependencies:
- dependency-name: python
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-09-10 04:07:26 +00:00
xmatthias 01da36f984 chore: update pre-commit hooks 2024-09-10 03:03:23 +00:00
dxbstyle ae155c78c2 added check 2024-09-09 21:29:49 +02:00
Matthias 9742216479 chore: run ruff-format on pre-commit 2024-09-09 18:23:07 +02:00
Matthias f720183281 Merge pull request #10630 from freqtrade/dependabot/pip/develop/sqlalchemy-2.0.34
chore(deps): bump sqlalchemy from 2.0.32 to 2.0.34
2024-09-09 14:54:33 +02:00
Matthias 4bc84acac6 Merge branch 'develop' into dependabot/pip/develop/sqlalchemy-2.0.34 2024-09-09 13:37:43 +02:00
Matthias 14a8086677 Merge pull request #10631 from freqtrade/dependabot/pip/develop/fastapi-0.114.0
chore(deps): bump fastapi from 0.112.2 to 0.114.0
2024-09-09 13:37:09 +02:00
Matthias 686b96222e Merge pull request #10621 from freqtrade/dependabot/pip/develop/types-a674cee9e2
chore(deps-dev): bump the types group with 2 updates
2024-09-09 10:57:28 +02:00
Matthias 0962f37f55 Merge pull request #10632 from freqtrade/dependabot/github_actions/develop/peter-evans/create-pull-request-7
chore(deps): bump peter-evans/create-pull-request from 6 to 7
2024-09-09 10:43:52 +02:00
Matthias 2c17551b27 chore: bump sqlalchemy in mypy additional deps 2024-09-09 10:15:18 +02:00
Matthias 3f5a5e35c2 Merge pull request #10633 from freqtrade/dependabot/github_actions/develop/pypa/gh-action-pypi-publish-1.10.1
chore(deps): bump pypa/gh-action-pypi-publish from 1.10.0 to 1.10.1
2024-09-09 09:56:28 +02:00
Matthias 07c6d37ff0 Merge pull request #10628 from freqtrade/dependabot/pip/develop/ccxt-4.3.98
chore(deps): bump ccxt from 4.3.93 to 4.3.98
2024-09-09 09:12:56 +02:00
Matthias 916ea7acc0 Merge pull request #10627 from freqtrade/dependabot/pip/develop/ruff-0.6.4
chore(deps-dev): bump ruff from 0.6.3 to 0.6.4
2024-09-09 09:12:28 +02:00
Matthias eae7e865a5 Merge pull request #10626 from freqtrade/dependabot/pip/develop/filelock-3.16.0
chore(deps): bump filelock from 3.15.4 to 3.16.0
2024-09-09 09:10:55 +02:00
Matthias 776e5054aa Merge pull request #10624 from freqtrade/dependabot/pip/develop/torch-2.4.1
chore(deps): bump torch from 2.2.2 to 2.4.1
2024-09-09 09:10:27 +02:00
Matthias bf2b8b280e Merge pull request #10623 from freqtrade/dependabot/pip/develop/catboost-1.2.7
chore(deps): bump catboost from 1.2.5 to 1.2.7
2024-09-09 09:10:15 +02:00
dependabot[bot] 7aa7027a34 chore(deps): bump fastapi from 0.112.2 to 0.114.0
Bumps [fastapi](https://github.com/fastapi/fastapi) from 0.112.2 to 0.114.0.
- [Release notes](https://github.com/fastapi/fastapi/releases)
- [Commits](https://github.com/fastapi/fastapi/compare/0.112.2...0.114.0)

---
updated-dependencies:
- dependency-name: fastapi
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-09-09 06:55:07 +00:00
Matthias d4713b2091 Merge pull request #10622 from freqtrade/dependabot/pip/develop/pydantic-2.9.0
chore(deps): bump pydantic from 2.8.2 to 2.9.0
2024-09-09 08:54:14 +02:00
Matthias 9b97be4aa4 Bump pre-commit dependencies 2024-09-09 06:44:35 +02:00
dependabot[bot] 621be11395 chore(deps): bump pypa/gh-action-pypi-publish from 1.10.0 to 1.10.1
Bumps [pypa/gh-action-pypi-publish](https://github.com/pypa/gh-action-pypi-publish) from 1.10.0 to 1.10.1.
- [Release notes](https://github.com/pypa/gh-action-pypi-publish/releases)
- [Commits](https://github.com/pypa/gh-action-pypi-publish/compare/v1.10.0...v1.10.1)

---
updated-dependencies:
- dependency-name: pypa/gh-action-pypi-publish
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-09-09 03:59:34 +00:00
dependabot[bot] 05af6df536 chore(deps): bump peter-evans/create-pull-request from 6 to 7
Bumps [peter-evans/create-pull-request](https://github.com/peter-evans/create-pull-request) from 6 to 7.
- [Release notes](https://github.com/peter-evans/create-pull-request/releases)
- [Commits](https://github.com/peter-evans/create-pull-request/compare/v6...v7)

---
updated-dependencies:
- dependency-name: peter-evans/create-pull-request
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-09-09 03:59:29 +00:00
dependabot[bot] b7bda2355d chore(deps): bump sqlalchemy from 2.0.32 to 2.0.34
Bumps [sqlalchemy](https://github.com/sqlalchemy/sqlalchemy) from 2.0.32 to 2.0.34.
- [Release notes](https://github.com/sqlalchemy/sqlalchemy/releases)
- [Changelog](https://github.com/sqlalchemy/sqlalchemy/blob/main/CHANGES.rst)
- [Commits](https://github.com/sqlalchemy/sqlalchemy/commits)

---
updated-dependencies:
- dependency-name: sqlalchemy
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-09-09 03:46:24 +00:00
dependabot[bot] b0976031ae chore(deps): bump ccxt from 4.3.93 to 4.3.98
Bumps [ccxt](https://github.com/ccxt/ccxt) from 4.3.93 to 4.3.98.
- [Release notes](https://github.com/ccxt/ccxt/releases)
- [Changelog](https://github.com/ccxt/ccxt/blob/master/CHANGELOG.md)
- [Commits](https://github.com/ccxt/ccxt/compare/4.3.93...4.3.98)

---
updated-dependencies:
- dependency-name: ccxt
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-09-09 03:46:05 +00:00
dependabot[bot] d099f30a34 chore(deps-dev): bump ruff from 0.6.3 to 0.6.4
Bumps [ruff](https://github.com/astral-sh/ruff) from 0.6.3 to 0.6.4.
- [Release notes](https://github.com/astral-sh/ruff/releases)
- [Changelog](https://github.com/astral-sh/ruff/blob/main/CHANGELOG.md)
- [Commits](https://github.com/astral-sh/ruff/compare/0.6.3...0.6.4)

---
updated-dependencies:
- dependency-name: ruff
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-09-09 03:45:51 +00:00
dependabot[bot] 699be03bb7 chore(deps): bump filelock from 3.15.4 to 3.16.0
Bumps [filelock](https://github.com/tox-dev/py-filelock) from 3.15.4 to 3.16.0.
- [Release notes](https://github.com/tox-dev/py-filelock/releases)
- [Changelog](https://github.com/tox-dev/filelock/blob/main/docs/changelog.rst)
- [Commits](https://github.com/tox-dev/py-filelock/compare/3.15.4...3.16.0)

---
updated-dependencies:
- dependency-name: filelock
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-09-09 03:45:29 +00:00
dependabot[bot] ccf93cfdcd chore(deps): bump torch from 2.2.2 to 2.4.1
Bumps [torch](https://github.com/pytorch/pytorch) from 2.2.2 to 2.4.1.
- [Release notes](https://github.com/pytorch/pytorch/releases)
- [Changelog](https://github.com/pytorch/pytorch/blob/main/RELEASE.md)
- [Commits](https://github.com/pytorch/pytorch/compare/v2.2.2...v2.4.1)

---
updated-dependencies:
- dependency-name: torch
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-09-09 03:45:14 +00:00
dependabot[bot] 47358a8229 chore(deps): bump catboost from 1.2.5 to 1.2.7
Bumps [catboost](https://github.com/catboost/catboost) from 1.2.5 to 1.2.7.
- [Release notes](https://github.com/catboost/catboost/releases)
- [Changelog](https://github.com/catboost/catboost/blob/master/RELEASE.md)
- [Commits](https://github.com/catboost/catboost/compare/v1.2.5...v1.2.7)

---
updated-dependencies:
- dependency-name: catboost
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-09-09 03:45:03 +00:00
dependabot[bot] 9856c2cfc4 chore(deps): bump pydantic from 2.8.2 to 2.9.0
Bumps [pydantic](https://github.com/pydantic/pydantic) from 2.8.2 to 2.9.0.
- [Release notes](https://github.com/pydantic/pydantic/releases)
- [Changelog](https://github.com/pydantic/pydantic/blob/main/HISTORY.md)
- [Commits](https://github.com/pydantic/pydantic/compare/v2.8.2...v2.9.0)

---
updated-dependencies:
- dependency-name: pydantic
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-09-09 03:44:57 +00:00
dependabot[bot] df9669ba2c chore(deps-dev): bump the types group with 2 updates
Bumps the types group with 2 updates: [types-requests](https://github.com/python/typeshed) and [types-python-dateutil](https://github.com/python/typeshed).


Updates `types-requests` from 2.32.0.20240712 to 2.32.0.20240907
- [Commits](https://github.com/python/typeshed/commits)

Updates `types-python-dateutil` from 2.9.0.20240821 to 2.9.0.20240906
- [Commits](https://github.com/python/typeshed/commits)

---
updated-dependencies:
- dependency-name: types-requests
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: types
- dependency-name: types-python-dateutil
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: types
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-09-09 03:43:50 +00:00
KingND f970454cb4 chore: ruff format 2024-09-08 13:57:48 -04:00
KingND 69678574d4 fix: support python 3.9 union type hinting 2024-09-08 12:04:58 -04:00
KingND 53cab5074b chore: refactor and cleanup tests 2024-09-08 12:04:58 -04:00
KingND c6c65b1799 chore: flake8 2024-09-08 12:04:58 -04:00
KingND bb9f64027a chore: improve language in docs 2024-09-08 12:04:58 -04:00
KingND 5f52fc4338 feat: update lookahead-analysis doc caveats to include info regarding the false positive on FreqAI targets 2024-09-08 12:04:58 -04:00
KingND 82e30c8519 feat: if a biased_indicator starting with & appears in a lookahead-analysis, caption the table with a note that freqai targets appearing here can be ignored 2024-09-08 12:04:58 -04:00
Matthias 6e2aa6b4b8 tests: remove unused imports 2024-09-08 08:28:40 +02:00
Matthias a1681cdd63 chore: improve typing 2024-09-08 08:28:40 +02:00
Matthias 611a3ce138 Merge pull request #10485 from jainanuj94/feature/8902
Add exit signals to export in backtesting
2024-09-07 20:12:05 +02:00
Matthias 396d933e34 feat(bybit): add support for unified Accounts 2024-09-07 18:28:56 +02:00
Matthias 0858e0a21e Minor update to docs 2024-09-07 15:29:23 +02:00
Matthias 704e32b0dc feat: properly parse marginmode on startup 2024-09-07 09:28:35 +02:00
Matthias f95cc960e1 test: tests should consider additional ff-update call 2024-09-07 09:25:20 +02:00
Matthias 1b00f512c1 fix: call order_filled callback for left open trades 2024-09-07 09:24:21 +02:00
Matthias d9ec66695c docs: update backtesting docs with new row 2024-09-07 08:49:30 +02:00
Matthias 1a2578a4b7 feat: Add margin/Trading mode output to bt-output 2024-09-07 08:47:45 +02:00
Matthias f714e306da test: add margin and trading mode to test config 2024-09-06 21:15:10 +02:00
Matthias 6a4b641250 feat: implement __str__ for marign and tradingmode enums 2024-09-06 20:58:54 +02:00
Anuj Jain 8d96844312 use BT_DATA_COLUMNS for trade wide indicators 2024-09-06 12:28:02 +05:30
Anuj Jain b7145debfb handle trade wide indicators 2024-09-05 21:52:09 +05:30
Matthias 990dbb6c06 Merge pull request #10616 from freqtrade/update/binance-leverage-tiers
Update Binance Leverage Tiers
2024-09-05 05:57:37 +02:00
xmatthias c6a66a8fac chore: update pre-commit hooks 2024-09-05 03:12:48 +00:00
Matthias 65ba67dedc chore: re-add analytics. 2024-09-04 21:08:34 +02:00
Matthias 824db78234 chore: update site_url again 2024-09-04 21:07:16 +02:00
Matthias 2fdf108198 chore: update site_url to work correctly 2024-09-04 21:04:39 +02:00
Matthias 63092d7d1a chore: re-add analytics to docs page 2024-09-04 20:44:18 +02:00
Matthias 964d437c7a chore: type _ft_has 2024-09-04 07:15:17 +02:00
Matthias d49c556291 chore: rename ft_has setting from ws.enabled to ws_enabled 2024-09-04 06:57:13 +02:00
Matthias d6b2748293 chore: rename types to ft_types 2024-09-04 06:44:48 +02:00
Matthias e3a5831d64 refactor: rename exchange.types 2024-09-04 06:42:51 +02:00
Anuj Jain 08d5174d02 update documentation and add default values 2024-09-04 09:56:12 +05:30
Matthias dacb926db5 Merge pull request #10614 from freqtrade/dependabot/pip/cryptography-43.0.1
chore(deps): bump cryptography from 42.0.8 to 43.0.1
2024-09-04 06:11:59 +02:00
dependabot[bot] c0e9173c9b chore(deps): bump cryptography from 42.0.8 to 43.0.1
Bumps [cryptography](https://github.com/pyca/cryptography) from 42.0.8 to 43.0.1.
- [Changelog](https://github.com/pyca/cryptography/blob/main/CHANGELOG.rst)
- [Commits](https://github.com/pyca/cryptography/compare/42.0.8...43.0.1)

---
updated-dependencies:
- dependency-name: cryptography
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-09-04 00:25:37 +00:00
Matthias f46308bbdb Merge pull request #10612 from freqtrade/update/pre-commit-hooks
Update pre-commit hooks
2024-09-03 06:18:55 +02:00
xmatthias 331db99a4e chore: update pre-commit hooks 2024-09-03 03:02:47 +00:00
Matthias d84f32f27d Merge pull request #10607 from freqtrade/dependabot/pip/develop/ccxt-4.3.93
chore(deps): bump ccxt from 4.3.88 to 4.3.93
2024-09-02 08:33:44 +02:00
Matthias ac28a44b92 Merge pull request #10609 from freqtrade/dependabot/github_actions/develop/pypa/gh-action-pypi-publish-1.10.0
chore(deps): bump pypa/gh-action-pypi-publish from 1.9.0 to 1.10.0
2024-09-02 08:13:28 +02:00
Matthias 003a41b920 Merge pull request #10608 from freqtrade/dependabot/pip/develop/python-telegram-bot-21.5
chore(deps): bump python-telegram-bot from 21.4 to 21.5
2024-09-02 07:49:17 +02:00
dependabot[bot] bc4c693525 chore(deps): bump ccxt from 4.3.88 to 4.3.93
Bumps [ccxt](https://github.com/ccxt/ccxt) from 4.3.88 to 4.3.93.
- [Release notes](https://github.com/ccxt/ccxt/releases)
- [Changelog](https://github.com/ccxt/ccxt/blob/master/CHANGELOG.md)
- [Commits](https://github.com/ccxt/ccxt/compare/4.3.88...4.3.93)

---
updated-dependencies:
- dependency-name: ccxt
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-09-02 05:08:37 +00:00
Matthias d4ba837641 chore: mark Bybit as supported exchange 2024-09-02 07:03:04 +02:00
Matthias 4a1592dd92 feat: initialize hyperliquid in spot mode by default 2024-09-02 07:03:04 +02:00
Matthias ac145a0b65 Merge pull request #10606 from freqtrade/dependabot/pip/develop/websockets-13.0.1
chore(deps): bump websockets from 13.0 to 13.0.1
2024-09-02 06:58:04 +02:00
Matthias 50c00dcae6 Merge pull request #10605 from freqtrade/dependabot/pip/develop/plotly-5.24.0
chore(deps): bump plotly from 5.23.0 to 5.24.0
2024-09-02 06:57:47 +02:00
Matthias 95d964140b Merge pull request #10604 from freqtrade/dependabot/pip/develop/rich-13.8.0
chore(deps): bump rich from 13.7.1 to 13.8.0
2024-09-02 06:57:34 +02:00
Matthias 0a73a7eb52 Merge pull request #10603 from freqtrade/dependabot/pip/develop/ruff-0.6.3
chore(deps-dev): bump ruff from 0.6.2 to 0.6.3
2024-09-02 06:57:25 +02:00
Matthias 0aecb24930 Merge pull request #10602 from freqtrade/dependabot/pip/develop/mkdocs-4a19445461
chore(deps): bump the mkdocs group with 2 updates
2024-09-02 06:57:03 +02:00
dependabot[bot] 904f5303a6 chore(deps): bump pypa/gh-action-pypi-publish from 1.9.0 to 1.10.0
Bumps [pypa/gh-action-pypi-publish](https://github.com/pypa/gh-action-pypi-publish) from 1.9.0 to 1.10.0.
- [Release notes](https://github.com/pypa/gh-action-pypi-publish/releases)
- [Commits](https://github.com/pypa/gh-action-pypi-publish/compare/v1.9.0...v1.10.0)

---
updated-dependencies:
- dependency-name: pypa/gh-action-pypi-publish
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-09-02 03:05:58 +00:00
dependabot[bot] 585761e931 chore(deps): bump python-telegram-bot from 21.4 to 21.5
Bumps [python-telegram-bot](https://github.com/python-telegram-bot/python-telegram-bot) from 21.4 to 21.5.
- [Release notes](https://github.com/python-telegram-bot/python-telegram-bot/releases)
- [Changelog](https://github.com/python-telegram-bot/python-telegram-bot/blob/master/CHANGES.rst)
- [Commits](https://github.com/python-telegram-bot/python-telegram-bot/compare/v21.4...v21.5)

---
updated-dependencies:
- dependency-name: python-telegram-bot
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-09-02 03:05:45 +00:00
dependabot[bot] 4d53797cba chore(deps): bump websockets from 13.0 to 13.0.1
Bumps [websockets](https://github.com/python-websockets/websockets) from 13.0 to 13.0.1.
- [Release notes](https://github.com/python-websockets/websockets/releases)
- [Commits](https://github.com/python-websockets/websockets/compare/13.0...13.0.1)

---
updated-dependencies:
- dependency-name: websockets
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-09-02 03:05:21 +00:00
dependabot[bot] 803677e884 chore(deps): bump plotly from 5.23.0 to 5.24.0
Bumps [plotly](https://github.com/plotly/plotly.py) from 5.23.0 to 5.24.0.
- [Release notes](https://github.com/plotly/plotly.py/releases)
- [Changelog](https://github.com/plotly/plotly.py/blob/master/CHANGELOG.md)
- [Commits](https://github.com/plotly/plotly.py/compare/v5.23.0...v5.24.0)

---
updated-dependencies:
- dependency-name: plotly
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-09-02 03:05:14 +00:00
dependabot[bot] 17617c58d7 chore(deps): bump rich from 13.7.1 to 13.8.0
Bumps [rich](https://github.com/Textualize/rich) from 13.7.1 to 13.8.0.
- [Release notes](https://github.com/Textualize/rich/releases)
- [Changelog](https://github.com/Textualize/rich/blob/master/CHANGELOG.md)
- [Commits](https://github.com/Textualize/rich/compare/v13.7.1...v13.8.0)

---
updated-dependencies:
- dependency-name: rich
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-09-02 03:05:10 +00:00
dependabot[bot] 96d03ec13d chore(deps-dev): bump ruff from 0.6.2 to 0.6.3
Bumps [ruff](https://github.com/astral-sh/ruff) from 0.6.2 to 0.6.3.
- [Release notes](https://github.com/astral-sh/ruff/releases)
- [Changelog](https://github.com/astral-sh/ruff/blob/main/CHANGELOG.md)
- [Commits](https://github.com/astral-sh/ruff/compare/0.6.2...0.6.3)

---
updated-dependencies:
- dependency-name: ruff
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-09-02 03:05:06 +00:00
dependabot[bot] 4726afbebf chore(deps): bump the mkdocs group with 2 updates
Bumps the mkdocs group with 2 updates: [mkdocs](https://github.com/mkdocs/mkdocs) and [mkdocs-material](https://github.com/squidfunk/mkdocs-material).


Updates `mkdocs` from 1.6.0 to 1.6.1
- [Release notes](https://github.com/mkdocs/mkdocs/releases)
- [Commits](https://github.com/mkdocs/mkdocs/compare/1.6.0...1.6.1)

Updates `mkdocs-material` from 9.5.33 to 9.5.34
- [Release notes](https://github.com/squidfunk/mkdocs-material/releases)
- [Changelog](https://github.com/squidfunk/mkdocs-material/blob/master/CHANGELOG)
- [Commits](https://github.com/squidfunk/mkdocs-material/compare/9.5.33...9.5.34)

---
updated-dependencies:
- dependency-name: mkdocs
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: mkdocs
- dependency-name: mkdocs-material
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: mkdocs
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-09-02 03:04:55 +00:00
Matthias 97c937e554 chore: add Bugbear Ruff checking 2024-09-01 08:32:42 +02:00
Matthias b25520cf18 chore: improve rhci_progress typing, remove mutable arguments 2024-09-01 08:27:53 +02:00
Matthias c6b46d75cb chore: fix B018 violation 2024-09-01 08:24:47 +02:00
Matthias a554352ae0 test: remove unused mutable argument 2024-09-01 08:24:21 +02:00
Matthias a7fd03f1b7 chore: improve ccxt test 2024-09-01 08:22:58 +02:00
Matthias ef96116c3f docs: add note about freqUI support of dp.current_whitelist
closes #10600
2024-08-31 20:34:02 +02:00
Matthias 7edc50865f docs: improve release documentation 2024-08-31 08:34:48 +02:00
Matthias a881d3fd81 chore: bump version to 2024.9-dev 2024-08-31 08:31:42 +02:00
jainanuj94 268683f8ea update documentation 2024-08-19 12:50:54 +05:30
jainanuj94 b6702d1d32 simplify merging logic 2024-08-18 23:22:20 +05:30
jainanuj94 c3679910a4 remove additional argument 2024-08-18 23:14:21 +05:30
jainanuj94 19a2e06c0b #000 | Anuj | Merge Dfs for entry and exit in one table 2024-08-18 18:41:04 +05:30
jainanuj94 8085e24dcd update tests 2024-08-06 20:00:05 +05:30
jainanuj94 d351ed0173 refactor: change analyse_on variable name to date_col 2024-08-06 15:16:30 +05:30
jainanuj94 3ebc5b136c review comments and update test for exit signals 2024-08-06 12:55:48 +05:30
jainanuj94 103991746b chore: type safety and refactoring 2024-08-05 23:57:24 +05:30
jainanuj94 7f0e5dd335 Refactor and add documentation 2024-08-05 23:19:38 +05:30
jainanuj94 ecf9c173c4 Add test for backtesitng-analysis 2024-08-02 20:46:19 +05:30
jainanuj94 b0e863dbbb Introduce --exit-signals flag to backtesting-analysis command 2024-08-02 20:09:56 +05:30
jainanuj94 8f8859a5f5 Initial commit - create a different file for signals 2024-08-02 15:54:03 +05:30
jainanuj94 2ad921f99e Merge remote-tracking branch 'upstream/develop' into develop 2024-08-01 23:55:01 +05:30
jainanuj94 3a481df45d Merge remote-tracking branch 'upstream/develop' into develop 2024-07-28 22:26:00 +05:30
120 changed files with 6814 additions and 3294 deletions
@@ -32,7 +32,7 @@ jobs:
run: python build_helpers/binance_update_lev_tiers.py
- uses: peter-evans/create-pull-request@v6
- uses: peter-evans/create-pull-request@v7
with:
token: ${{ secrets.REPO_SCOPED_TOKEN }}
add-paths: freqtrade/exchange/binance_leverage_tiers.json
+2 -2
View File
@@ -537,12 +537,12 @@ jobs:
- name: Publish to PyPI (Test)
uses: pypa/gh-action-pypi-publish@v1.9.0
uses: pypa/gh-action-pypi-publish@v1.10.2
with:
repository-url: https://test.pypi.org/legacy/
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@v1.9.0
uses: pypa/gh-action-pypi-publish@v1.10.2
deploy-docker:
+1 -1
View File
@@ -26,7 +26,7 @@ jobs:
- name: Run auto-update
run: pre-commit autoupdate
- uses: peter-evans/create-pull-request@v6
- uses: peter-evans/create-pull-request@v7
with:
token: ${{ secrets.REPO_SCOPED_TOKEN }}
add-paths: .pre-commit-config.yaml
+5 -4
View File
@@ -16,10 +16,10 @@ repos:
additional_dependencies:
- types-cachetools==5.5.0.20240820
- types-filelock==3.2.7
- types-requests==2.32.0.20240712
- types-requests==2.32.0.20240914
- types-tabulate==0.9.0.20240106
- types-python-dateutil==2.9.0.20240821
- SQLAlchemy==2.0.32
- types-python-dateutil==2.9.0.20240906
- SQLAlchemy==2.0.35
# stages: [push]
- repo: https://github.com/pycqa/isort
@@ -31,9 +31,10 @@ repos:
- repo: https://github.com/charliermarsh/ruff-pre-commit
# Ruff version.
rev: 'v0.6.2'
rev: 'v0.6.7'
hooks:
- id: ruff
- id: ruff-format
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
+1 -1
View File
@@ -1,4 +1,4 @@
FROM python:3.12.5-slim-bookworm as base
FROM python:3.12.6-slim-bookworm as base
# Setup env
ENV LANG C.UTF-8
+1
View File
@@ -30,6 +30,7 @@ Please read the [exchange specific notes](docs/exchanges.md) to learn about even
- [X] [Binance](https://www.binance.com/)
- [X] [Bitmart](https://bitmart.com/)
- [X] [BingX](https://bingx.com/invite/0EM9RX)
- [X] [Bybit](https://bybit.com/)
- [X] [Gate.io](https://www.gate.io/ref/6266643)
- [X] [HTX](https://www.htx.com/) (Former Huobi)
- [X] [Kraken](https://kraken.com/)
+1 -1
View File
@@ -1,4 +1,4 @@
FROM python:3.11.9-slim-bookworm as base
FROM python:3.11.10-slim-bookworm as base
# Setup env
ENV LANG C.UTF-8
+54 -5
View File
@@ -18,15 +18,13 @@ freqtrade backtesting -c <config.json> --timeframe <tf> --strategy <strategy_nam
```
This will tell freqtrade to output a pickled dictionary of strategy, pairs and corresponding
DataFrame of the candles that resulted in buy signals. Depending on how many buys your strategy
makes, this file may get quite large, so periodically check your `user_data/backtest_results`
folder to delete old exports.
DataFrame of the candles that resulted in entry and exit signals.
Depending on how many entries your strategy makes, this file may get quite large, so periodically check your `user_data/backtest_results` folder to delete old exports.
Before running your next backtest, make sure you either delete your old backtest results or run
backtesting with the `--cache none` option to make sure no cached results are used.
If all goes well, you should now see a `backtest-result-{timestamp}_signals.pkl` file in the
`user_data/backtest_results` folder.
If all goes well, you should now see a `backtest-result-{timestamp}_signals.pkl` and `backtest-result-{timestamp}_exited.pkl` files in the `user_data/backtest_results` folder.
To analyze the entry/exit tags, we now need to use the `freqtrade backtesting-analysis` command
with `--analysis-groups` option provided with space-separated arguments:
@@ -103,6 +101,10 @@ The indicators have to be present in your strategy's main DataFrame (either for
timeframe or for informative timeframes) otherwise they will simply be ignored in the script
output.
!!! Note "Indicator List"
The indicator values will be displayed for both entry and exit points. If `--indicator-list all` is specified,
only the indicators at the entry point will be shown to avoid excessively large lists, which could occur depending on the strategy.
There are a range of candle and trade-related fields that are included in the analysis so are
automatically accessible by including them on the indicator-list, and these include:
@@ -118,6 +120,53 @@ automatically accessible by including them on the indicator-list, and these incl
- **profit_ratio :** trade profit ratio
- **profit_abs :** absolute profit return of the trade
#### Sample Output for Indicator Values
```bash
freqtrade backtesting-analysis -c user_data/config.json --analysis-groups 0 --indicator-list chikou_span tenkan_sen
```
In this example,
we aim to display the `chikou_span` and `tenkan_sen` indicator values at both the entry and exit points of trades.
A sample output for indicators might look like this:
| pair | open_date | enter_reason | exit_reason | chikou_span (entry) | tenkan_sen (entry) | chikou_span (exit) | tenkan_sen (exit) |
|-----------|---------------------------|--------------|-------------|---------------------|--------------------|--------------------|-------------------|
| DOGE/USDT | 2024-07-06 00:35:00+00:00 | | exit_signal | 0.105 | 0.106 | 0.105 | 0.107 |
| BTC/USDT | 2024-08-05 14:20:00+00:00 | | roi | 54643.440 | 51696.400 | 54386.000 | 52072.010 |
As shown in the table, `chikou_span (entry)` represents the indicator value at the time of trade entry,
while `chikou_span (exit)` reflects its value at the time of exit.
This detailed view of indicator values enhances the analysis.
The `(entry)` and `(exit)` suffixes are added to indicators
to distinguish the values at the entry and exit points of the trade.
!!! Note "Trade-wide Indicators"
Certain trade-wide indicators do not have the `(entry)` or `(exit)` suffix. These indicators include: `pair`, `stake_amount`,
`max_stake_amount`, `amount`, `open_date`, `close_date`, `open_rate`, `close_rate`, `fee_open`, `fee_close`, `trade_duration`,
`profit_ratio`, `profit_abs`, `exit_reason`,`initial_stop_loss_abs`, `initial_stop_loss_ratio`, `stop_loss_abs`, `stop_loss_ratio`,
`min_rate`, `max_rate`, `is_open`, `enter_tag`, `leverage`, `is_short`, `open_timestamp`, `close_timestamp` and `orders`
#### Filtering Indicators Based on Entry or Exit Signals
The `--indicator-list` option, by default, displays indicator values for both entry and exit signals. To filter the indicator values exclusively for entry signals, you can use the `--entry-only` argument. Similarly, to display indicator values only at exit signals, use the `--exit-only` argument.
Example: Display indicator values at entry signals:
```bash
freqtrade backtesting-analysis -c user_data/config.json --analysis-groups 0 --indicator-list chikou_span tenkan_sen --entry-only
```
Example: Display indicator values at exit signals:
```bash
freqtrade backtesting-analysis -c user_data/config.json --analysis-groups 0 --indicator-list chikou_span tenkan_sen --exit-only
```
!!! note
When using these filters, the indicator names will not be suffixed with `(entry)` or `(exit)`.
### Filtering the trade output by date
+3
View File
@@ -293,6 +293,7 @@ A backtesting result will look like that:
|-----------------------------+---------------------|
| Backtesting from | 2019-01-01 00:00:00 |
| Backtesting to | 2019-05-01 00:00:00 |
| Trading Mode | Spot |
| Max open trades | 3 |
| | |
| Total/Daily Avg Trades | 429 / 3.575 |
@@ -398,6 +399,7 @@ It contains some useful key metrics about performance of your strategy on backte
|-----------------------------+---------------------|
| Backtesting from | 2019-01-01 00:00:00 |
| Backtesting to | 2019-05-01 00:00:00 |
| Trading Mode | Spot |
| Max open trades | 3 |
| | |
| Total/Daily Avg Trades | 429 / 3.575 |
@@ -452,6 +454,7 @@ It contains some useful key metrics about performance of your strategy on backte
- `Backtesting from` / `Backtesting to`: Backtesting range (usually defined with the `--timerange` option).
- `Max open trades`: Setting of `max_open_trades` (or `--max-open-trades`) - or number of pairs in the pairlist (whatever is lower).
- `Trading Mode`: Spot or Futures trading.
- `Total/Daily Avg Trades`: Identical to the total trades of the backtest output table / Total trades divided by the backtesting duration in days (this will give you information about how many trades to expect from the strategy).
- `Starting balance`: Start balance - as given by dry-run-wallet (config or command line).
- `Final balance`: Final balance - starting balance + absolute profit.
-1
View File
@@ -222,7 +222,6 @@ Mandatory parameters are marked as **Required**, which means that they are requi
| `exchange.ccxt_async_config` | Additional CCXT parameters passed to the async ccxt instance. Parameters may differ from exchange to exchange and are documented in the [ccxt documentation](https://docs.ccxt.com/#/README?id=overriding-exchange-properties-upon-instantiation) <br> **Datatype:** Dict
| `exchange.enable_ws` | Enable the usage of Websockets for the exchange. <br>[More information](#consuming-exchange-websockets).<br>*Defaults to `true`.* <br> **Datatype:** Boolean
| `exchange.markets_refresh_interval` | The interval in minutes in which markets are reloaded. <br>*Defaults to `60` minutes.* <br> **Datatype:** Positive Integer
| `exchange.skip_pair_validation` | Skip pairlist validation on startup.<br>*Defaults to `false`*<br> **Datatype:** Boolean
| `exchange.skip_open_order_update` | Skips open order updates on startup should the exchange cause problems. Only relevant in live conditions.<br>*Defaults to `false`*<br> **Datatype:** Boolean
| `exchange.unknown_fee_rate` | Fallback value to use when calculating trading fees. This can be useful for exchanges which have fees in non-tradable currencies. The value provided here will be multiplied with the "fee cost".<br>*Defaults to `None`<br> **Datatype:** float
| `exchange.log_responses` | Log relevant exchange responses. For debug mode only - use with care.<br>*Defaults to `false`*<br> **Datatype:** Boolean
+17 -14
View File
@@ -205,7 +205,7 @@ This is called with each iteration of the bot (only if the Pairlist Handler is a
It must return the resulting pairlist (which may then be passed into the chain of Pairlist Handlers).
Validations are optional, the parent class exposes a `_verify_blacklist(pairlist)` and `_whitelist_for_active_markets(pairlist)` to do default filtering. Use this if you limit your result to a certain number of pairs - so the end-result is not shorter than expected.
Validations are optional, the parent class exposes a `verify_blacklist(pairlist)` and `_whitelist_for_active_markets(pairlist)` to do default filtering. Use this if you limit your result to a certain number of pairs - so the end-result is not shorter than expected.
#### filter_pairlist
@@ -219,7 +219,7 @@ The default implementation in the base class simply calls the `_validate_pair()`
If overridden, it must return the resulting pairlist (which may then be passed into the next Pairlist Handler in the chain).
Validations are optional, the parent class exposes a `_verify_blacklist(pairlist)` and `_whitelist_for_active_markets(pairlist)` to do default filters. Use this if you limit your result to a certain number of pairs - so the end result is not shorter than expected.
Validations are optional, the parent class exposes a `verify_blacklist(pairlist)` and `_whitelist_for_active_markets(pairlist)` to do default filters. Use this if you limit your result to a certain number of pairs - so the end result is not shorter than expected.
In `VolumePairList`, this implements different methods of sorting, does early validation so only the expected number of pairs is returned.
@@ -481,21 +481,24 @@ Once the PR against stable is merged (best right after merging):
### pypi
!!! Note
This process is now automated as part of Github Actions.
!!! Warning "Manual Releases"
This process is automated as part of Github Actions.
Manual pypi pushes should not be necessary.
To create a pypi release, please run the following commands:
??? example "Manual release"
To manually create a pypi release, please run the following commands:
Additional requirement: `wheel`, `twine` (for uploading), account on pypi with proper permissions.
Additional requirement: `wheel`, `twine` (for uploading), account on pypi with proper permissions.
``` bash
python setup.py sdist bdist_wheel
``` bash
pip install -U build
python -m build --sdist --wheel
# For pypi test (to check if some change to the installation did work)
twine upload --repository-url https://test.pypi.org/legacy/ dist/*
# For pypi test (to check if some change to the installation did work)
twine upload --repository-url https://test.pypi.org/legacy/ dist/*
# For production:
twine upload dist/*
```
# For production:
twine upload dist/*
```
Please don't push non-releases to the productive / real pypi instance.
Please don't push non-releases to the productive / real pypi instance.
+9 -3
View File
@@ -255,18 +255,24 @@ The configuration parameter `exchange.unknown_fee_rate` can be used to specify t
## Bybit
Futures trading on bybit is currently supported for USDT markets, and will use isolated futures mode.
Users with unified accounts (there's no way back) can create a Sub-account which will start as "non-unified", and can therefore use isolated futures.
On startup, freqtrade will set the position mode to "One-way Mode" for the whole (sub)account. This avoids making this call over and over again (slowing down bot operations), but means that changes to this setting may result in exceptions and errors
On startup, freqtrade will set the position mode to "One-way Mode" for the whole (sub)account. This avoids making this call over and over again (slowing down bot operations), but means that changes to this setting may result in exceptions and errors.
As bybit doesn't provide funding rate history, the dry-run calculation is used for live trades as well.
API Keys for live futures trading (Subaccount on non-unified) must have the following permissions:
API Keys for live futures trading must have the following permissions:
* Read-write
* Contract - Orders
* Contract - Positions
We do strongly recommend to limit all API keys to the IP you're going to use it from.
!!! Warning "Unified accounts"
Freqtrade assumes accounts to be dedicated to the bot.
We therefore recommend the usage of one subaccount per bot. This is especially important when using unified accounts.
Other configurations (multiple bots on one account, manual non-bot trades on the bot account) are not supported and may lead to unexpected behavior.
!!! Tip "Stoploss on Exchange"
Bybit (futures only) supports `stoploss_on_exchange` and uses `stop-loss-limit` orders. It provides great advantages, so we recommend to benefit from it by enabling stoploss on exchange.
On futures, Bybit supports both `stop-limit` as well as `stop-market` orders. You can use either `"limit"` or `"market"` in the `order_types.stoploss` configuration setting to decide which type to use.
-1
View File
@@ -58,7 +58,6 @@ The plot configuration can be accessed via the "Plot Configurator" (Cog icon) bu
### Settings
Several UI related settings can be changed by accessing the settings page.
Things you can change (among others):
+9 -3
View File
@@ -55,7 +55,6 @@ It uses configuration from `exchange.pair_whitelist` and `exchange.pair_blacklis
By default, only currently enabled pairs are allowed.
To skip pair validation against active markets, set `"allow_inactive": true` within the `StaticPairList` configuration.
This can be useful for backtesting expired pairs (like quarterly spot-markets).
This option must be configured along with `exchange.skip_pair_validation` in the exchange configuration.
When used in a "follow-up" position (e.g. after VolumePairlist), all pairs in `'pair_whitelist'` will be added to the end of the pairlist.
@@ -361,14 +360,21 @@ The optional `bearer_token` will be included in the requests Authorization Heade
"method": "MarketCapPairList",
"number_assets": 20,
"max_rank": 50,
"refresh_period": 86400
"refresh_period": 86400,
"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.
`refresh_period` setting defines the period (in seconds) at which the marketcap rank data will be refreshed. Defaults to 86,400s (1 day). The pairlist cache (`refresh_period`) is applicable on both generating pairlists (first position in the list) and filtering instances (not the first position in the list).
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 `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.
!!! Warning "Many categories"
Each added category corresponds to one API call to CoinGecko. The more categories you add, the longer the pairlist generation will take, potentially causing rate limit issues.
#### AgeFilter
+1
View File
@@ -42,6 +42,7 @@ Please read the [exchange specific notes](exchanges.md) to learn about eventual,
- [X] [Binance](https://www.binance.com/)
- [X] [Bitmart](https://bitmart.com/)
- [X] [BingX](https://bingx.com/invite/0EM9RX)
- [X] [Bybit](https://bybit.com/)
- [X] [Gate.io](https://www.gate.io/ref/6266643)
- [X] [HTX](https://www.htx.com/) (Former Huobi)
- [X] [Kraken](https://kraken.com/)
+1
View File
@@ -101,3 +101,4 @@ This could lead to a false-negative (the strategy will then be reported as non-b
- `lookahead-analysis` has access to everything that backtesting has too.
Please don't provoke any configs like enabling position stacking.
If you decide to do so, then make doubly sure that you won't ever run out of `max_open_trades` amount and neither leftover money in your wallet.
- In the results table, the `biased_indicators` column will falsely flag FreqAI target indicators defined in `set_freqai_targets()` as biased. These are not biased and can safely be ignored.
+3 -3
View File
@@ -1,7 +1,7 @@
markdown==3.7
mkdocs==1.6.0
mkdocs-material==9.5.33
mkdocs==1.6.1
mkdocs-material==9.5.36
mdx_truly_sane_lists==1.3
pymdown-extensions==10.9
pymdown-extensions==10.10.1
jinja2==3.1.4
mike==2.1.3
+1
View File
@@ -717,6 +717,7 @@ This is where calling `self.dp.current_whitelist()` comes in handy.
??? Note "Plotting with current_whitelist"
Current whitelist is not supported for `plot-dataframe`, as this command is usually used by providing an explicit pairlist - and would therefore make the return values of this method misleading.
It's also not supported for freqUI visualization in [webserver mode](utils.md#webserver-mode) - as the configuration for webserver mode doesn't require a pairlist to be set.
### *get_pair_dataframe(pair, timeframe)*
+18 -18
View File
@@ -18,7 +18,7 @@ The following attributes / properties are available for each individual trade -
| `open_rate` | float | Rate this trade was entered at (Avg. entry rate in case of trade-adjustments). |
| `close_rate` | float | Close rate - only set when is_open = False. |
| `stake_amount` | float | Amount in Stake (or Quote) currency. |
| `amount` | float | Amount in Asset / Base currency that is currently owned. |
| `amount` | float | Amount in Asset / Base currency that is currently owned. Will be 0.0 until the initial order fills. |
| `open_date` | datetime | Timestamp when trade was opened **use `open_date_utc` instead** |
| `open_date_utc` | datetime | Timestamp when trade was opened - in UTC. |
| `close_date` | datetime | Timestamp when trade was closed **use `close_date_utc` instead** |
@@ -130,20 +130,20 @@ Most properties here can be None as they are dependent on the exchange response.
| Attribute | DataType | Description |
|------------|-------------|-------------|
`trade` | Trade | Trade object this order is attached to
`ft_pair` | string | Pair this order is for
`ft_is_open` | boolean | is the order filled?
`order_type` | string | Order type as defined on the exchange - usually market, limit or stoploss
`status` | string | Status as defined by ccxt. Usually open, closed, expired or canceled
`side` | string | Buy or Sell
`price` | float | Price the order was placed at
`average` | float | Average price the order filled at
`amount` | float | Amount in base currency
`filled` | float | Filled amount (in base currency)
`remaining` | float | Remaining amount
`cost` | float | Cost of the order - usually average * filled (*Exchange dependent on futures, may contain the cost with or without leverage and may be in contracts.*)
`stake_amount` | float | Stake amount used for this order. *Added in 2023.7.*
`order_date` | datetime | Order creation date **use `order_date_utc` instead**
`order_date_utc` | datetime | Order creation date (in UTC)
`order_fill_date` | datetime | Order fill date **use `order_fill_utc` instead**
`order_fill_date_utc` | datetime | Order fill date
| `trade` | Trade | Trade object this order is attached to |
| `ft_pair` | string | Pair this order is for |
| `ft_is_open` | boolean | is the order filled? |
| `order_type` | string | Order type as defined on the exchange - usually market, limit or stoploss |
| `status` | string | Status as defined by ccxt. Usually open, closed, expired or canceled |
| `side` | string | Buy or Sell |
| `price` | float | Price the order was placed at |
| `average` | float | Average price the order filled at |
| `amount` | float | Amount in base currency |
| `filled` | float | Filled amount (in base currency) |
| `remaining` | float | Remaining amount |
| `cost` | float | Cost of the order - usually average * filled (*Exchange dependent on futures, may contain the cost with or without leverage and may be in contracts.*) |
| `stake_amount` | float | Stake amount used for this order. *Added in 2023.7.* |
| `order_date` | datetime | Order creation date **use `order_date_utc` instead** |
| `order_date_utc` | datetime | Order creation date (in UTC) |
| `order_fill_date` | datetime | Order fill date **use `order_fill_utc` instead** |
| `order_fill_date_utc` | datetime | Order fill date |
+1 -1
View File
@@ -1,6 +1,6 @@
"""Freqtrade bot"""
__version__ = "2024.8"
__version__ = "2024.9"
if "dev" in __version__:
from pathlib import Path
+2
View File
@@ -228,6 +228,8 @@ ARGS_ANALYZE_ENTRIES_EXITS = [
"enter_reason_list",
"exit_reason_list",
"indicator_list",
"entry_only",
"exit_only",
"timerange",
"analysis_rejected",
"analysis_to_csv",
@@ -274,8 +274,6 @@ def start_new_config(args: Dict[str, Any]) -> None:
def start_show_config(args: Dict[str, Any]) -> None:
config = setup_utils_configuration(args, RunMode.UTIL_EXCHANGE, set_dry=False)
# TODO: Sanitize from sensitive info before printing
print("Your combined configuration is:")
config_sanitized = sanitize_config(
config["original_config"], show_sensitive=args.get("show_sensitive", False)
+6
View File
@@ -719,6 +719,12 @@ AVAILABLE_CLI_OPTIONS = {
nargs="+",
default=[],
),
"entry_only": Arg(
"--entry-only", help=("Only analyze entry signals."), action="store_true", default=False
),
"exit_only": Arg(
"--exit-only", help=("Only analyze exit signals."), action="store_true", default=False
),
"analysis_rejected": Arg(
"--rejected-signals",
help="Analyse rejected signals",
+1 -1
View File
@@ -12,9 +12,9 @@ from freqtrade.configuration import setup_utils_configuration
from freqtrade.enums import RunMode
from freqtrade.exceptions import ConfigurationError, OperationalException
from freqtrade.exchange import list_available_exchanges, market_is_active
from freqtrade.ft_types import ValidExchangesType
from freqtrade.misc import parse_db_uri_for_logging, plural
from freqtrade.resolvers import ExchangeResolver, StrategyResolver
from freqtrade.types.valid_exchanges_type import ValidExchangesType
from freqtrade.util import print_rich_table
+12 -2
View File
@@ -15,7 +15,14 @@ from freqtrade.configuration.directory_operations import create_datadir, create_
from freqtrade.configuration.environment_vars import enironment_vars_to_dict
from freqtrade.configuration.load_config import load_file, load_from_files
from freqtrade.constants import Config
from freqtrade.enums import NON_UTIL_MODES, TRADE_MODES, CandleType, RunMode, TradingMode
from freqtrade.enums import (
NON_UTIL_MODES,
TRADE_MODES,
CandleType,
MarginMode,
RunMode,
TradingMode,
)
from freqtrade.exceptions import OperationalException
from freqtrade.loggers import setup_logging
from freqtrade.misc import deep_merge_dicts, parse_db_uri_for_logging
@@ -389,6 +396,7 @@ class Configuration:
config.get("trading_mode", "spot") or "spot"
)
config["trading_mode"] = TradingMode(config.get("trading_mode", "spot") or "spot")
config["margin_mode"] = MarginMode(config.get("margin_mode", "") or "")
self._args_to_config(
config, argname="candle_types", logstring="Detected --candle-types: {}"
)
@@ -399,6 +407,8 @@ class Configuration:
("enter_reason_list", "Analysis enter tag list: {}"),
("exit_reason_list", "Analysis exit tag list: {}"),
("indicator_list", "Analysis indicator list: {}"),
("entry_only", "Only analyze entry signals: {}"),
("exit_only", "Only analyze exit signals: {}"),
("timerange", "Filter trades by timerange: {}"),
("analysis_rejected", "Analyse rejected signals: {}"),
("analysis_to_csv", "Store analysis tables to CSV: {}"),
@@ -468,7 +478,7 @@ class Configuration:
else:
logger.info(logstring.format(config[argname]))
if deprecated_msg:
warnings.warn(f"DEPRECATED: {deprecated_msg}", DeprecationWarning)
warnings.warn(f"DEPRECATED: {deprecated_msg}", DeprecationWarning, stacklevel=1)
def _resolve_pairs_list(self, config: Config) -> None:
"""
@@ -82,6 +82,11 @@ def create_userdata_dir(directory: str, create_dir: bool = False) -> Path:
for f in sub_dirs:
subfolder = folder / f
if not subfolder.is_dir():
if subfolder.exists() or subfolder.is_symlink():
raise OperationalException(
f"File `{subfolder}` exists already and is not a directory. "
"Freqtrade requires this to be a directory."
)
subfolder.mkdir(parents=False)
return folder
+1 -1
View File
@@ -13,10 +13,10 @@ import pandas as pd
from freqtrade.constants import LAST_BT_RESULT_FN, IntOrInf
from freqtrade.exceptions import ConfigurationError, OperationalException
from freqtrade.ft_types import BacktestHistoryEntryType, BacktestResultType
from freqtrade.misc import file_dump_json, json_load
from freqtrade.optimize.backtest_caching import get_backtest_metadata_filename
from freqtrade.persistence import LocalTrade, Trade, init_db
from freqtrade.types import BacktestHistoryEntryType, BacktestResultType
logger = logging.getLogger(__name__)
+2 -2
View File
@@ -12,7 +12,7 @@ from typing import Tuple
import numpy as np
import pandas as pd
from freqtrade.constants import DEFAULT_ORDERFLOW_COLUMNS
from freqtrade.constants import DEFAULT_ORDERFLOW_COLUMNS, Config
from freqtrade.enums import RunMode
from freqtrade.exceptions import DependencyException
@@ -63,7 +63,7 @@ def _calculate_ohlcv_candle_start_and_end(df: pd.DataFrame, timeframe: str):
def populate_dataframe_with_trades(
cached_grouped_trades: OrderedDict[Tuple[datetime, datetime], pd.DataFrame],
config,
config: Config,
dataframe: pd.DataFrame,
trades: pd.DataFrame,
) -> Tuple[pd.DataFrame, OrderedDict[Tuple[datetime, datetime], pd.DataFrame]]:
+2 -5
View File
@@ -23,7 +23,7 @@ from freqtrade.data.history import get_datahandler, load_pair_history
from freqtrade.enums import CandleType, RPCMessageType, RunMode, TradingMode
from freqtrade.exceptions import ExchangeError, OperationalException
from freqtrade.exchange import Exchange, timeframe_to_prev_date, timeframe_to_seconds
from freqtrade.exchange.types import OrderBook
from freqtrade.exchange.exchange_types import OrderBook
from freqtrade.misc import append_candles_to_dataframe
from freqtrade.rpc import RPCManager
from freqtrade.rpc.rpc_types import RPCAnalyzedDFMsg
@@ -520,7 +520,7 @@ class DataProvider:
return self._exchange.trades(
(pair, timeframe or self._config["timeframe"], _candle_type), copy=copy
)
elif self.runmode in (RunMode.BACKTEST, RunMode.HYPEROPT):
else:
data_handler = get_datahandler(
self._config["datadir"], data_format=self._config["dataformat_trades"]
)
@@ -529,9 +529,6 @@ class DataProvider:
)
return trades_df
else:
return DataFrame()
def market(self, pair: str) -> Optional[Dict[str, Any]]:
"""
Return market data for the pair
+111 -20
View File
@@ -1,6 +1,6 @@
import logging
from pathlib import Path
from typing import List
from typing import Dict, List
import joblib
import pandas as pd
@@ -8,6 +8,7 @@ import pandas as pd
from freqtrade.configuration import TimeRange
from freqtrade.constants import Config
from freqtrade.data.btanalysis import (
BT_DATA_COLUMNS,
get_latest_backtest_filename,
load_backtest_data,
load_backtest_stats,
@@ -47,9 +48,14 @@ def _load_signal_candles(backtest_dir: Path):
return _load_backtest_analysis_data(backtest_dir, "signals")
def _process_candles_and_indicators(pairlist, strategy_name, trades, signal_candles):
analysed_trades_dict = {}
analysed_trades_dict[strategy_name] = {}
def _load_exit_signal_candles(backtest_dir: Path) -> Dict[str, Dict[str, pd.DataFrame]]:
return _load_backtest_analysis_data(backtest_dir, "exited")
def _process_candles_and_indicators(
pairlist, strategy_name, trades, signal_candles, date_col: str = "open_date"
):
analysed_trades_dict: Dict[str, Dict] = {strategy_name: {}}
try:
logger.info(f"Processing {strategy_name} : {len(pairlist)} pairs")
@@ -57,7 +63,7 @@ def _process_candles_and_indicators(pairlist, strategy_name, trades, signal_cand
for pair in pairlist:
if pair in signal_candles[strategy_name]:
analysed_trades_dict[strategy_name][pair] = _analyze_candles_and_indicators(
pair, trades, signal_candles[strategy_name][pair]
pair, trades, signal_candles[strategy_name][pair], date_col
)
except Exception as e:
print(f"Cannot process entry/exit reasons for {strategy_name}: ", e)
@@ -65,7 +71,9 @@ def _process_candles_and_indicators(pairlist, strategy_name, trades, signal_cand
return analysed_trades_dict
def _analyze_candles_and_indicators(pair, trades: pd.DataFrame, signal_candles: pd.DataFrame):
def _analyze_candles_and_indicators(
pair: str, trades: pd.DataFrame, signal_candles: pd.DataFrame, date_col: str = "open_date"
) -> pd.DataFrame:
buyf = signal_candles
if len(buyf) > 0:
@@ -75,8 +83,8 @@ def _analyze_candles_and_indicators(pair, trades: pd.DataFrame, signal_candles:
trades_inds = pd.DataFrame()
if trades_red.shape[0] > 0 and buyf.shape[0] > 0:
for t, v in trades_red.open_date.items():
allinds = buyf.loc[(buyf["date"] < v)]
for t, v in trades_red.iterrows():
allinds = buyf.loc[(buyf["date"] < v[date_col])]
if allinds.shape[0] > 0:
tmp_inds = allinds.iloc[[-1]]
@@ -235,7 +243,7 @@ def _select_rows_by_tags(df, enter_reason_list, exit_reason_list):
def prepare_results(
analysed_trades, stratname, enter_reason_list, exit_reason_list, timerange=None
):
) -> pd.DataFrame:
res_df = pd.DataFrame()
for pair, trades in analysed_trades[stratname].items():
if trades.shape[0] > 0:
@@ -252,8 +260,11 @@ def prepare_results(
def print_results(
res_df: pd.DataFrame,
exit_df: pd.DataFrame,
analysis_groups: List[str],
indicator_list: List[str],
entry_only: bool,
exit_only: bool,
csv_path: Path,
rejected_signals=None,
to_csv=False,
@@ -278,9 +289,11 @@ def print_results(
for ind in indicator_list:
if ind in res_df:
available_inds.append(ind)
ilist = ["pair", "enter_reason", "exit_reason"] + available_inds
merged_df = _merge_dfs(res_df, exit_df, available_inds, entry_only, exit_only)
_print_table(
res_df[ilist],
merged_df,
sortcols=["exit_reason"],
show_index=False,
name="Indicators:",
@@ -291,6 +304,36 @@ def print_results(
print("\\No trades to show")
def _merge_dfs(
entry_df: pd.DataFrame,
exit_df: pd.DataFrame,
available_inds: List[str],
entry_only: bool,
exit_only: bool,
):
merge_on = ["pair", "open_date"]
signal_wide_indicators = list(set(available_inds) - set(BT_DATA_COLUMNS))
columns_to_keep = merge_on + ["enter_reason", "exit_reason"]
if exit_df is None or exit_df.empty or entry_only is True:
return entry_df[columns_to_keep + available_inds]
if exit_only is True:
return pd.merge(
entry_df[columns_to_keep],
exit_df[merge_on + signal_wide_indicators],
on=merge_on,
suffixes=(" (entry)", " (exit)"),
)
return pd.merge(
entry_df[columns_to_keep + available_inds],
exit_df[merge_on + signal_wide_indicators],
on=merge_on,
suffixes=(" (entry)", " (exit)"),
)
def _print_table(
df: pd.DataFrame, sortcols=None, *, show_index=False, name=None, to_csv=False, csv_path: Path
):
@@ -316,9 +359,16 @@ def process_entry_exit_reasons(config: Config):
enter_reason_list = config.get("enter_reason_list", ["all"])
exit_reason_list = config.get("exit_reason_list", ["all"])
indicator_list = config.get("indicator_list", [])
entry_only = config.get("entry_only", False)
exit_only = config.get("exit_only", False)
do_rejected = config.get("analysis_rejected", False)
to_csv = config.get("analysis_to_csv", False)
csv_path = Path(config.get("analysis_csv_path", config["exportfilename"]))
if entry_only is True and exit_only is True:
raise OperationalException(
"Cannot use --entry-only and --exit-only at the same time. Please choose one."
)
if to_csv and not csv_path.is_dir():
raise OperationalException(f"Specified directory {csv_path} does not exist.")
@@ -333,6 +383,7 @@ def process_entry_exit_reasons(config: Config):
if trades is not None and not trades.empty:
signal_candles = _load_signal_candles(config["exportfilename"])
exit_signals = _load_exit_signal_candles(config["exportfilename"])
rej_df = None
if do_rejected:
@@ -345,22 +396,35 @@ def process_entry_exit_reasons(config: Config):
timerange=timerange,
)
analysed_trades_dict = _process_candles_and_indicators(
config["exchange"]["pair_whitelist"], strategy_name, trades, signal_candles
)
res_df = prepare_results(
analysed_trades_dict,
strategy_name,
entry_df = _generate_dfs(
config["exchange"]["pair_whitelist"],
enter_reason_list,
exit_reason_list,
timerange=timerange,
signal_candles,
strategy_name,
timerange,
trades,
"open_date",
)
exit_df = _generate_dfs(
config["exchange"]["pair_whitelist"],
enter_reason_list,
exit_reason_list,
exit_signals,
strategy_name,
timerange,
trades,
"close_date",
)
print_results(
res_df,
entry_df,
exit_df,
analysis_groups,
indicator_list,
entry_only,
exit_only,
rejected_signals=rej_df,
to_csv=to_csv,
csv_path=csv_path,
@@ -368,3 +432,30 @@ def process_entry_exit_reasons(config: Config):
except ValueError as e:
raise OperationalException(e) from e
def _generate_dfs(
pairlist: list,
enter_reason_list: list,
exit_reason_list: list,
signal_candles: Dict,
strategy_name: str,
timerange: TimeRange,
trades: pd.DataFrame,
date_col: str,
) -> pd.DataFrame:
analysed_trades_dict = _process_candles_and_indicators(
pairlist,
strategy_name,
trades,
signal_candles,
date_col,
)
res_df = prepare_results(
analysed_trades_dict,
strategy_name,
enter_reason_list,
exit_reason_list,
timerange=timerange,
)
return res_df
+1 -9
View File
@@ -17,7 +17,6 @@ from freqtrade.constants import (
from freqtrade.data.converter import (
clean_ohlcv_dataframe,
convert_trades_to_ohlcv,
ohlcv_to_dataframe,
trades_df_remove_duplicates,
trades_list_to_df,
)
@@ -273,7 +272,7 @@ def _download_pair_history(
)
# Default since_ms to 30 days if nothing is given
new_data = exchange.get_historic_ohlcv(
new_dataframe = exchange.get_historic_ohlcv(
pair=pair,
timeframe=timeframe,
since_ms=(
@@ -285,10 +284,6 @@ def _download_pair_history(
candle_type=candle_type,
until_ms=until_ms if until_ms else None,
)
# TODO: Maybe move parsing to exchange class (?)
new_dataframe = ohlcv_to_dataframe(
new_data, timeframe, pair, fill_missing=False, drop_incomplete=True
)
if data.empty:
data = new_dataframe
else:
@@ -610,9 +605,6 @@ def download_data_main(config: Config) -> None:
if "timeframes" not in config:
config["timeframes"] = DL_DATA_TIMEFRAMES
# Manual validations of relevant settings
if not config["exchange"].get("skip_pair_validation", False):
exchange.validate_pairs(expanded_pairs)
logger.info(
f"About to download pairs: {expanded_pairs}, "
f"intervals: {config['timeframes']} to {config['datadir']}"
+3
View File
@@ -11,3 +11,6 @@ class MarginMode(str, Enum):
CROSS = "cross"
ISOLATED = "isolated"
NONE = ""
def __str__(self):
return f"{self.name.lower()}"
+3
View File
@@ -10,3 +10,6 @@ class TradingMode(str, Enum):
SPOT = "spot"
MARGIN = "margin"
FUTURES = "futures"
def __str__(self):
return f"{self.name.lower()}"
+6 -6
View File
@@ -11,7 +11,7 @@ from freqtrade.enums import CandleType, MarginMode, PriceType, TradingMode
from freqtrade.exceptions import DDosProtection, OperationalException, TemporaryError
from freqtrade.exchange import Exchange
from freqtrade.exchange.common import retrier
from freqtrade.exchange.types import OHLCVResponse, Tickers
from freqtrade.exchange.exchange_types import FtHas, OHLCVResponse, Tickers
from freqtrade.misc import deep_merge_dicts, json_load
@@ -19,7 +19,7 @@ logger = logging.getLogger(__name__)
class Binance(Exchange):
_ft_has: Dict = {
_ft_has: FtHas = {
"stoploss_on_exchange": True,
"stop_price_param": "stopPrice",
"stop_price_prop": "stopPrice",
@@ -30,9 +30,9 @@ class Binance(Exchange):
"trades_pagination_arg": "fromId",
"trades_has_history": True,
"l2_limit_range": [5, 10, 20, 50, 100, 500, 1000],
"ws.enabled": True,
"ws_enabled": True,
}
_ft_has_futures: Dict = {
_ft_has_futures: FtHas = {
"stoploss_order_types": {"limit": "stop", "market": "stop_market"},
"order_time_in_force": ["GTC", "FOK", "IOC"],
"tickers_have_price": False,
@@ -43,7 +43,7 @@ class Binance(Exchange):
PriceType.LAST: "CONTRACT_PRICE",
PriceType.MARK: "MARK_PRICE",
},
"ws.enabled": False,
"ws_enabled": False,
}
_supported_trading_mode_margin_pairs: List[Tuple[TradingMode, MarginMode]] = [
@@ -192,7 +192,7 @@ class Binance(Exchange):
if maintenance_amt is None:
raise OperationalException(
"Parameter maintenance_amt is required by Binance.liquidation_price"
f"for {self.trading_mode.value}"
f"for {self.trading_mode}"
)
if self.trading_mode == TradingMode.FUTURES:
File diff suppressed because it is too large Load Diff
+2 -2
View File
@@ -1,9 +1,9 @@
"""Bingx exchange subclass"""
import logging
from typing import Dict
from freqtrade.exchange import Exchange
from freqtrade.exchange.exchange_types import FtHas
logger = logging.getLogger(__name__)
@@ -15,7 +15,7 @@ class Bingx(Exchange):
with this exchange.
"""
_ft_has: Dict = {
_ft_has: FtHas = {
"ohlcv_candle_limit": 1000,
"stoploss_on_exchange": True,
"stoploss_order_types": {"limit": "limit", "market": "market"},
+2 -2
View File
@@ -1,9 +1,9 @@
"""Bitmart exchange subclass"""
import logging
from typing import Dict
from freqtrade.exchange import Exchange
from freqtrade.exchange.exchange_types import FtHas
logger = logging.getLogger(__name__)
@@ -15,7 +15,7 @@ class Bitmart(Exchange):
with this exchange.
"""
_ft_has: Dict = {
_ft_has: FtHas = {
"stoploss_on_exchange": False, # Bitmart API does not support stoploss orders
"ohlcv_candle_limit": 200,
"trades_has_history": False, # Endpoint doesn't seem to support pagination
+2 -2
View File
@@ -1,11 +1,11 @@
"""Bitvavo exchange subclass."""
import logging
from typing import Dict
from ccxt import DECIMAL_PLACES
from freqtrade.exchange import Exchange
from freqtrade.exchange.exchange_types import FtHas
logger = logging.getLogger(__name__)
@@ -21,7 +21,7 @@ class Bitvavo(Exchange):
may still not work as expected.
"""
_ft_has: Dict = {
_ft_has: FtHas = {
"ohlcv_candle_limit": 1440,
}
+12 -7
View File
@@ -11,6 +11,7 @@ from freqtrade.enums import CandleType, MarginMode, PriceType, TradingMode
from freqtrade.exceptions import DDosProtection, ExchangeError, OperationalException, TemporaryError
from freqtrade.exchange import Exchange
from freqtrade.exchange.common import retrier
from freqtrade.exchange.exchange_types import FtHas
from freqtrade.util.datetime_helpers import dt_now, dt_ts
@@ -29,14 +30,14 @@ class Bybit(Exchange):
unified_account = False
_ft_has: Dict = {
_ft_has: FtHas = {
"ohlcv_candle_limit": 1000,
"ohlcv_has_history": True,
"order_time_in_force": ["GTC", "FOK", "IOC", "PO"],
"ws.enabled": True,
"ws_enabled": True,
"trades_has_history": False, # Endpoint doesn't support pagination
}
_ft_has_futures: Dict = {
_ft_has_futures: FtHas = {
"ohlcv_has_history": True,
"mark_ohlcv_timeframe": "4h",
"funding_fee_timeframe": "8h",
@@ -89,10 +90,8 @@ class Bybit(Exchange):
# Returns a tuple of bools, first for margin, second for Account
if is_unified and len(is_unified) > 1 and is_unified[1]:
self.unified_account = True
logger.info("Bybit: Unified account.")
raise OperationalException(
"Bybit: Unified account is not supported. "
"Please use a standard (sub)account."
logger.info(
"Bybit: Unified account. Assuming dedicated subaccount for this bot."
)
else:
self.unified_account = False
@@ -239,7 +238,13 @@ class Bybit(Exchange):
return orders
def fetch_order(self, order_id: str, pair: str, params: Optional[Dict] = None) -> Dict:
if self.exchange_has("fetchOrder"):
# Set acknowledged to True to avoid ccxt exception
params = {"acknowledged": True}
order = super().fetch_order(order_id, pair, params)
if not order:
order = self.fetch_order_emulated(order_id, pair, {})
if (
order.get("status") == "canceled"
and order.get("filled") == 0.0
+2 -2
View File
@@ -1,9 +1,9 @@
"""CoinbasePro exchange subclass"""
import logging
from typing import Dict
from freqtrade.exchange import Exchange
from freqtrade.exchange.exchange_types import FtHas
logger = logging.getLogger(__name__)
@@ -19,6 +19,6 @@ class Coinbasepro(Exchange):
may still not work as expected.
"""
_ft_has: Dict = {
_ft_has: FtHas = {
"ohlcv_candle_limit": 300,
}
+5
View File
@@ -54,6 +54,7 @@ SUPPORTED_EXCHANGES = [
"binance",
"bingx",
"bitmart",
"bybit",
"gate",
"htx",
"kraken",
@@ -163,6 +164,10 @@ F = TypeVar("F", bound=Callable[..., Any])
def retrier(_func: F) -> F: ...
@overload
def retrier(_func: F, *, retries=API_RETRY_COUNT) -> F: ...
@overload
def retrier(*, retries=API_RETRY_COUNT) -> Callable[[F], F]: ...
+2 -2
View File
@@ -1,9 +1,9 @@
"""Crypto.com exchange subclass"""
import logging
from typing import Dict
from freqtrade.exchange import Exchange
from freqtrade.exchange.exchange_types import FtHas
logger = logging.getLogger(__name__)
@@ -14,6 +14,6 @@ class Cryptocom(Exchange):
Contains adjustments needed for Freqtrade to work with this exchange.
"""
_ft_has: Dict = {
_ft_has: FtHas = {
"ohlcv_candle_limit": 300,
}
+37 -74
View File
@@ -67,6 +67,15 @@ from freqtrade.exchange.common import (
retrier,
retrier_async,
)
from freqtrade.exchange.exchange_types import (
CcxtBalances,
CcxtPosition,
FtHas,
OHLCVResponse,
OrderBook,
Ticker,
Tickers,
)
from freqtrade.exchange.exchange_utils import (
ROUND,
ROUND_DOWN,
@@ -88,14 +97,6 @@ from freqtrade.exchange.exchange_utils_timeframe import (
timeframe_to_seconds,
)
from freqtrade.exchange.exchange_ws import ExchangeWS
from freqtrade.exchange.types import (
CcxtBalances,
CcxtPosition,
OHLCVResponse,
OrderBook,
Ticker,
Tickers,
)
from freqtrade.misc import (
chunks,
deep_merge_dicts,
@@ -103,7 +104,6 @@ from freqtrade.misc import (
file_load_json,
safe_value_fallback2,
)
from freqtrade.plugins.pairlist.pairlist_helpers import expand_pairlist
from freqtrade.util import dt_from_ts, dt_now
from freqtrade.util.datetime_helpers import dt_humanize_delta, dt_ts, format_ms_time
from freqtrade.util.periodic_cache import PeriodicCache
@@ -122,10 +122,11 @@ class Exchange:
# Dict to specify which options each exchange implements
# This defines defaults, which can be selectively overridden by subclasses using _ft_has
# or by specifying them in the configuration.
_ft_has_default: Dict = {
_ft_has_default: FtHas = {
"stoploss_on_exchange": False,
"stop_price_param": "stopLossPrice", # Used for stoploss_on_exchange request
"stop_price_prop": "stopLossPrice", # Used for stoploss_on_exchange response parsing
"stoploss_order_types": {},
"order_time_in_force": ["GTC"],
"ohlcv_params": {},
"ohlcv_candle_limit": 500,
@@ -154,10 +155,10 @@ class Exchange:
"marketOrderRequiresPrice": False,
"exchange_has_overrides": {}, # Dictionary overriding ccxt's "has".
# Expected to be in the format {"fetchOHLCV": True} or {"fetchOHLCV": False}
"ws.enabled": False, # Set to true for exchanges with tested websocket support
"ws_enabled": False, # Set to true for exchanges with tested websocket support
}
_ft_has: Dict = {}
_ft_has_futures: Dict = {}
_ft_has: FtHas = {}
_ft_has_futures: FtHas = {}
_supported_trading_mode_margin_pairs: List[Tuple[TradingMode, MarginMode]] = [
# TradingMode.SPOT always supported and not required in this list
@@ -261,7 +262,7 @@ class Exchange:
exchange_conf.get("ccxt_async_config", {}), ccxt_async_config
)
self._api_async = self._init_ccxt(exchange_conf, False, ccxt_async_config)
self._has_watch_ohlcv = self.exchange_has("watchOHLCV") and self._ft_has["ws.enabled"]
self._has_watch_ohlcv = self.exchange_has("watchOHLCV") and self._ft_has["ws_enabled"]
if (
self._config["runmode"] in TRADE_MODES
and exchange_conf.get("enable_ws", True)
@@ -329,8 +330,6 @@ class Exchange:
# Check if all pairs are available
self.validate_stakecurrency(config["stake_currency"])
if not config["exchange"].get("skip_pair_validation"):
self.validate_pairs(config["exchange"]["pair_whitelist"])
self.validate_ordertypes(config.get("order_types", {}))
self.validate_order_time_in_force(config.get("order_time_in_force", {}))
self.validate_trading_mode_and_margin_mode(self.trading_mode, self.margin_mode)
@@ -466,7 +465,7 @@ class Exchange:
"""
return int(
self._ft_has.get("ohlcv_candle_limit_per_timeframe", {}).get(
timeframe, self._ft_has.get("ohlcv_candle_limit")
timeframe, str(self._ft_has.get("ohlcv_candle_limit"))
)
)
@@ -621,11 +620,21 @@ class Exchange:
if self._exchange_ws:
self._exchange_ws.reset_connections()
async def _api_reload_markets(self, reload: bool = False) -> Dict[str, Any]:
try:
return await self._api_async.load_markets(reload=reload, params={})
except ccxt.DDoSProtection as e:
raise DDosProtection(e) from e
except (ccxt.OperationFailed, ccxt.ExchangeError) as e:
raise TemporaryError(
f"Error in reload_markets due to {e.__class__.__name__}. Message: {e}"
) from e
except ccxt.BaseError as e:
raise TemporaryError(e) from e
def _load_async_markets(self, reload: bool = False) -> Dict[str, Any]:
try:
markets = self.loop.run_until_complete(
self._api_async.load_markets(reload=reload, params={})
)
markets = self.loop.run_until_complete(self._api_reload_markets(reload=reload))
if isinstance(markets, Exception):
raise markets
@@ -649,8 +658,10 @@ class Exchange:
return None
logger.debug("Performing scheduled market reload..")
try:
# on initial load, we retry 3 times to ensure we get the markets
retries: int = 3 if force else 0
# Reload async markets, then assign them to sync api
self._markets = self._load_async_markets(reload=True)
self._markets = retrier(self._load_async_markets, retries=retries)(reload=True)
self._api.set_markets(self._api_async.markets, self._api_async.currencies)
# Assign options array, as it contains some temporary information from the exchange.
self._api.options = self._api_async.options
@@ -688,54 +699,6 @@ class Exchange:
f"Available currencies are: {', '.join(quote_currencies)}"
)
def validate_pairs(self, pairs: List[str]) -> None:
"""
Checks if all given pairs are tradable on the current exchange.
:param pairs: list of pairs
:raise: OperationalException if one pair is not available
:return: None
"""
if not self.markets:
logger.warning("Unable to validate pairs (assuming they are correct).")
return
extended_pairs = expand_pairlist(pairs, list(self.markets), keep_invalid=True)
invalid_pairs = []
for pair in extended_pairs:
# Note: ccxt has BaseCurrency/QuoteCurrency format for pairs
if self.markets and pair not in self.markets:
raise OperationalException(
f"Pair {pair} is not available on {self.name} {self.trading_mode.value}. "
f"Please remove {pair} from your whitelist."
)
# From ccxt Documentation:
# markets.info: An associative array of non-common market properties,
# including fees, rates, limits and other general market information.
# The internal info array is different for each particular market,
# its contents depend on the exchange.
# It can also be a string or similar ... so we need to verify that first.
elif isinstance(self.markets[pair].get("info"), dict) and self.markets[pair].get(
"info", {}
).get("prohibitedIn", False):
# Warn users about restricted pairs in whitelist.
# We cannot determine reliably if Users are affected.
logger.warning(
f"Pair {pair} is restricted for some users on this exchange."
f"Please check if you are impacted by this restriction "
f"on the exchange and eventually remove {pair} from your whitelist."
)
if (
self._config["stake_currency"]
and self.get_pair_quote_currency(pair) != self._config["stake_currency"]
):
invalid_pairs.append(pair)
if invalid_pairs:
raise OperationalException(
f"Stake-currency '{self._config['stake_currency']}' not compatible with "
f"pair-whitelist. Please remove the following pairs: {invalid_pairs}"
)
def get_valid_pair_combination(self, curr_1: str, curr_2: str) -> str:
"""
Get valid pair combination of curr_1 and curr_2 by trying both combinations.
@@ -888,7 +851,7 @@ class Exchange:
):
mm_value = margin_mode and margin_mode.value
raise OperationalException(
f"Freqtrade does not support {mm_value} {trading_mode.value} on {self.name}"
f"Freqtrade does not support {mm_value} {trading_mode} on {self.name}"
)
def get_option(self, param: str, default: Optional[Any] = None) -> Any:
@@ -2260,7 +2223,7 @@ class Exchange:
candle_type: CandleType,
is_new_pair: bool = False,
until_ms: Optional[int] = None,
) -> List:
) -> DataFrame:
"""
Get candle history using asyncio and returns the list of candles.
Handles all async work for this.
@@ -2270,7 +2233,7 @@ class Exchange:
:param since_ms: Timestamp in milliseconds to get history from
:param until_ms: Timestamp in milliseconds to get history up to
:param candle_type: '', mark, index, premiumIndex, or funding_rate
:return: List with candle (OHLCV) data
:return: Dataframe with candle (OHLCV) data
"""
pair, _, _, data, _ = self.loop.run_until_complete(
self._async_get_historic_ohlcv(
@@ -2283,7 +2246,7 @@ class Exchange:
)
)
logger.info(f"Downloaded data for {pair} with length {len(data)}.")
return data
return ohlcv_to_dataframe(data, timeframe, pair, fill_missing=False, drop_incomplete=True)
async def _async_get_historic_ohlcv(
self,
@@ -3631,7 +3594,7 @@ class Exchange:
Wherein, "+" or "-" depends on whether the contract goes long or short:
"-" for long, and "+" for short.
okex: https://www.okex.com/support/hc/en-us/articles/
okex: https://www.okx.com/support/hc/en-us/articles/
360053909592-VI-Introduction-to-the-isolated-mode-of-Single-Multi-currency-Portfolio-margin
:param pair: Pair to calculate liquidation price for
+98
View File
@@ -0,0 +1,98 @@
from typing import Dict, List, Optional, Tuple, TypedDict
from freqtrade.enums import CandleType
class FtHas(TypedDict, total=False):
order_time_in_force: List[str]
exchange_has_overrides: Dict[str, bool]
marketOrderRequiresPrice: bool
# Stoploss on exchange
stoploss_on_exchange: bool
stop_price_param: str
stop_price_prop: str
stop_price_type_field: str
stop_price_type_value_mapping: Dict
stoploss_order_types: Dict[str, str]
# ohlcv
ohlcv_params: Dict
ohlcv_candle_limit: int
ohlcv_has_history: bool
ohlcv_partial_candle: bool
ohlcv_require_since: bool
ohlcv_volume_currency: str
ohlcv_candle_limit_per_timeframe: Dict[str, int]
# Tickers
tickers_have_quoteVolume: bool
tickers_have_percentage: bool
tickers_have_bid_ask: bool
tickers_have_price: bool
# Trades
trades_limit: int
trades_pagination: str
trades_pagination_arg: str
trades_has_history: bool
trades_pagination_overlap: bool
# Orderbook
l2_limit_range: Optional[List[int]]
l2_limit_range_required: bool
# Futures
ccxt_futures_name: str # usually swap
mark_ohlcv_price: str
mark_ohlcv_timeframe: str
funding_fee_timeframe: str
floor_leverage: bool
needs_trading_fees: bool
order_props_in_contracts: List[str]
# Websocket control
ws_enabled: bool
class Ticker(TypedDict):
symbol: str
ask: Optional[float]
askVolume: Optional[float]
bid: Optional[float]
bidVolume: Optional[float]
last: Optional[float]
quoteVolume: Optional[float]
baseVolume: Optional[float]
percentage: Optional[float]
# Several more - only listing required.
Tickers = Dict[str, Ticker]
class OrderBook(TypedDict):
symbol: str
bids: List[Tuple[float, float]]
asks: List[Tuple[float, float]]
timestamp: Optional[int]
datetime: Optional[str]
nonce: Optional[int]
class CcxtBalance(TypedDict):
free: float
used: float
total: float
CcxtBalances = Dict[str, CcxtBalance]
class CcxtPosition(TypedDict):
symbol: str
side: str
contracts: float
leverage: float
collateral: Optional[float]
initialMargin: Optional[float]
liquidationPrice: Optional[float]
# pair, timeframe, candleType, OHLCV, drop last?,
OHLCVResponse = Tuple[str, str, CandleType, List, bool]
+1 -1
View File
@@ -26,7 +26,7 @@ from freqtrade.exchange.common import (
SUPPORTED_EXCHANGES,
)
from freqtrade.exchange.exchange_utils_timeframe import timeframe_to_minutes, timeframe_to_prev_date
from freqtrade.types import ValidExchangesType
from freqtrade.ft_types import ValidExchangesType
from freqtrade.util import FtPrecise
+1 -1
View File
@@ -11,7 +11,7 @@ import ccxt
from freqtrade.constants import Config, PairWithTimeframe
from freqtrade.enums.candletype import CandleType
from freqtrade.exchange.exchange import timeframe_to_seconds
from freqtrade.exchange.types import OHLCVResponse
from freqtrade.exchange.exchange_types import OHLCVResponse
from freqtrade.util import dt_ts, format_ms_time
+3 -2
View File
@@ -7,6 +7,7 @@ from typing import Any, Dict, List, Optional, Tuple
from freqtrade.constants import BuySell
from freqtrade.enums import MarginMode, PriceType, TradingMode
from freqtrade.exchange import Exchange
from freqtrade.exchange.exchange_types import FtHas
from freqtrade.misc import safe_value_fallback2
@@ -23,7 +24,7 @@ class Gate(Exchange):
may still not work as expected.
"""
_ft_has: Dict = {
_ft_has: FtHas = {
"ohlcv_candle_limit": 1000,
"order_time_in_force": ["GTC", "IOC"],
"stoploss_on_exchange": True,
@@ -34,7 +35,7 @@ class Gate(Exchange):
"trades_has_history": False, # Endpoint would support this - but ccxt doesn't.
}
_ft_has_futures: Dict = {
_ft_has_futures: FtHas = {
"needs_trading_fees": True,
"marketOrderRequiresPrice": False,
"stop_price_type_field": "price_type",
+2 -2
View File
@@ -1,7 +1,7 @@
import logging
from typing import Dict
from freqtrade.exchange import Exchange
from freqtrade.exchange.exchange_types import FtHas
logger = logging.getLogger(__name__)
@@ -17,6 +17,6 @@ class Hitbtc(Exchange):
may still not work as expected.
"""
_ft_has: Dict = {
_ft_has: FtHas = {
"ohlcv_candle_limit": 1000,
}
+2 -1
View File
@@ -5,6 +5,7 @@ from typing import Dict
from freqtrade.constants import BuySell
from freqtrade.exchange import Exchange
from freqtrade.exchange.exchange_types import FtHas
logger = logging.getLogger(__name__)
@@ -16,7 +17,7 @@ class Htx(Exchange):
with this exchange.
"""
_ft_has: Dict = {
_ft_has: FtHas = {
"stoploss_on_exchange": True,
"stop_price_param": "stopPrice",
"stop_price_prop": "stopPrice",
+13 -1
View File
@@ -5,7 +5,9 @@ from typing import Dict
from ccxt import SIGNIFICANT_DIGITS
from freqtrade.enums import TradingMode
from freqtrade.exchange import Exchange
from freqtrade.exchange.exchange_types import FtHas
logger = logging.getLogger(__name__)
@@ -16,7 +18,7 @@ class Hyperliquid(Exchange):
Contains adjustments needed for Freqtrade to work with this exchange.
"""
_ft_has: Dict = {
_ft_has: FtHas = {
# Only the most recent 5000 candles are available according to the
# exchange's API documentation.
"ohlcv_has_history": False,
@@ -25,6 +27,16 @@ class Hyperliquid(Exchange):
"exchange_has_overrides": {"fetchTrades": False},
}
@property
def _ccxt_config(self) -> Dict:
# Parameters to add directly to ccxt sync/async initialization.
# ccxt defaults to swap mode.
config = {}
if self.trading_mode == TradingMode.SPOT:
config.update({"options": {"defaultType": "spot"}})
config.update(super()._ccxt_config)
return config
@property
def precision_mode_price(self) -> int:
"""
+2 -2
View File
@@ -1,9 +1,9 @@
"""Idex exchange subclass"""
import logging
from typing import Dict
from freqtrade.exchange import Exchange
from freqtrade.exchange.exchange_types import FtHas
logger = logging.getLogger(__name__)
@@ -15,6 +15,6 @@ class Idex(Exchange):
with this exchange.
"""
_ft_has: Dict = {
_ft_has: FtHas = {
"ohlcv_candle_limit": 1000,
}
+3 -2
View File
@@ -12,7 +12,7 @@ from freqtrade.enums import MarginMode, TradingMode
from freqtrade.exceptions import DDosProtection, OperationalException, TemporaryError
from freqtrade.exchange import Exchange
from freqtrade.exchange.common import retrier
from freqtrade.exchange.types import CcxtBalances, Tickers
from freqtrade.exchange.exchange_types import CcxtBalances, FtHas, Tickers
logger = logging.getLogger(__name__)
@@ -20,7 +20,7 @@ logger = logging.getLogger(__name__)
class Kraken(Exchange):
_params: Dict = {"trading_agreement": "agree"}
_ft_has: Dict = {
_ft_has: FtHas = {
"stoploss_on_exchange": True,
"stop_price_param": "stopLossPrice",
"stop_price_prop": "stopLossPrice",
@@ -78,6 +78,7 @@ class Kraken(Exchange):
# x["side"], x["amount"],
)
for x in orders
if x["remaining"] is not None and (x["side"] == "sell" or x["price"] is not None)
]
for bal in balances:
if not isinstance(balances[bal], dict):
+2 -1
View File
@@ -5,6 +5,7 @@ from typing import Dict
from freqtrade.constants import BuySell
from freqtrade.exchange import Exchange
from freqtrade.exchange.exchange_types import FtHas
logger = logging.getLogger(__name__)
@@ -20,7 +21,7 @@ class Kucoin(Exchange):
may still not work as expected.
"""
_ft_has: Dict = {
_ft_has: FtHas = {
"stoploss_on_exchange": True,
"stop_price_param": "stopPrice",
"stop_price_prop": "stopPrice",
+29 -7
View File
@@ -13,7 +13,8 @@ from freqtrade.exceptions import (
TemporaryError,
)
from freqtrade.exchange import Exchange, date_minus_candles
from freqtrade.exchange.common import retrier
from freqtrade.exchange.common import API_RETRY_COUNT, retrier
from freqtrade.exchange.exchange_types import FtHas
from freqtrade.misc import safe_value_fallback2
from freqtrade.util import dt_now, dt_ts
@@ -27,16 +28,16 @@ class Okx(Exchange):
Contains adjustments needed for Freqtrade to work with this exchange.
"""
_ft_has: Dict = {
_ft_has: FtHas = {
"ohlcv_candle_limit": 100, # Warning, special case with data prior to X months
"mark_ohlcv_timeframe": "4h",
"funding_fee_timeframe": "8h",
"stoploss_order_types": {"limit": "limit"},
"stoploss_on_exchange": True,
"trades_has_history": False, # Endpoint doesn't have a "since" parameter
"ws.enabled": True,
"ws_enabled": True,
}
_ft_has_futures: Dict = {
_ft_has_futures: FtHas = {
"tickers_have_quoteVolume": False,
"stop_price_type_field": "slTriggerPxType",
"stop_price_type_value_mapping": {
@@ -44,7 +45,7 @@ class Okx(Exchange):
PriceType.MARK: "index",
PriceType.INDEX: "mark",
},
"ws.enabled": True,
"ws_enabled": True,
}
_supported_trading_mode_margin_pairs: List[Tuple[TradingMode, MarginMode]] = [
@@ -207,6 +208,7 @@ class Okx(Exchange):
order["type"] = "stoploss"
return order
@retrier(retries=API_RETRY_COUNT)
def fetch_stoploss_order(self, order_id: str, pair: str, params: Optional[Dict] = None) -> Dict:
if self._config["dry_run"]:
return self.fetch_dry_run_order(order_id)
@@ -216,8 +218,20 @@ class Okx(Exchange):
order_reg = self._api.fetch_order(order_id, pair, params=params1)
self._log_exchange_response("fetch_stoploss_order", order_reg)
return self._convert_stop_order(pair, order_id, order_reg)
except ccxt.OrderNotFound:
except (ccxt.OrderNotFound, ccxt.InvalidOrder):
pass
except ccxt.DDoSProtection as e:
raise DDosProtection(e) from e
except (ccxt.OperationFailed, ccxt.ExchangeError) as e:
raise TemporaryError(
f"Could not get order due to {e.__class__.__name__}. Message: {e}"
) from e
except ccxt.BaseError as e:
raise OperationalException(e) from e
return self._fetch_stop_order_fallback(order_id, pair)
def _fetch_stop_order_fallback(self, order_id: str, pair: str) -> Dict:
params2 = {"stop": True, "ordType": "conditional"}
for method in (
self._api.fetch_open_orders,
@@ -230,8 +244,16 @@ class Okx(Exchange):
if orders_f:
order = orders_f[0]
return self._convert_stop_order(pair, order_id, order)
except ccxt.BaseError:
except (ccxt.OrderNotFound, ccxt.InvalidOrder):
pass
except ccxt.DDoSProtection as e:
raise DDosProtection(e) from e
except (ccxt.OperationFailed, ccxt.ExchangeError) as e:
raise TemporaryError(
f"Could not get order due to {e.__class__.__name__}. Message: {e}"
) from e
except ccxt.BaseError as e:
raise OperationalException(e) from e
raise RetryableOrderError(f"StoplossOrder not found (pair: {pair} id: {order_id}).")
def get_order_id_conditional(self, order: Dict[str, Any]) -> str:
-51
View File
@@ -1,51 +0,0 @@
from typing import Dict, List, Optional, Tuple, TypedDict
from freqtrade.enums import CandleType
class Ticker(TypedDict):
symbol: str
ask: Optional[float]
askVolume: Optional[float]
bid: Optional[float]
bidVolume: Optional[float]
last: Optional[float]
quoteVolume: Optional[float]
baseVolume: Optional[float]
percentage: Optional[float]
# Several more - only listing required.
Tickers = Dict[str, Ticker]
class OrderBook(TypedDict):
symbol: str
bids: List[Tuple[float, float]]
asks: List[Tuple[float, float]]
timestamp: Optional[int]
datetime: Optional[str]
nonce: Optional[int]
class CcxtBalance(TypedDict):
free: float
used: float
total: float
CcxtBalances = Dict[str, CcxtBalance]
class CcxtPosition(TypedDict):
symbol: str
side: str
contracts: float
leverage: float
collateral: Optional[float]
initialMargin: Optional[float]
liquidationPrice: Optional[float]
# pair, timeframe, candleType, OHLCV, drop last?,
OHLCVResponse = Tuple[str, str, CandleType, List, bool]
@@ -86,9 +86,6 @@ class BasePyTorchRegressor(BasePyTorchModel):
dk.feature_pipeline = self.define_data_pipeline(threads=dk.thread_count)
dk.label_pipeline = self.define_label_pipeline(threads=dk.thread_count)
dd["train_labels"], _, _ = dk.label_pipeline.fit_transform(dd["train_labels"])
dd["test_labels"], _, _ = dk.label_pipeline.transform(dd["test_labels"])
(dd["train_features"], dd["train_labels"], dd["train_weights"]) = (
dk.feature_pipeline.fit_transform(
dd["train_features"], dd["train_labels"], dd["train_weights"]
@@ -141,7 +141,7 @@ class PyTorchTransformerRegressor(BasePyTorchRegressor):
pred_df = pd.DataFrame(yb.detach().numpy(), columns=dk.label_list)
pred_df, _, _ = dk.label_pipeline.inverse_transform(pred_df)
if self.freqai_info.get("DI_threshold", 0) > 0:
if self.ft_params.get("DI_threshold", 0) > 0:
dk.DI_values = dk.feature_pipeline["di"].di_values
else:
dk.DI_values = np.zeros(outliers.shape[0])
+17 -4
View File
@@ -22,6 +22,7 @@ from freqtrade.edge import Edge
from freqtrade.enums import (
ExitCheckTuple,
ExitType,
MarginMode,
RPCMessageType,
SignalDirection,
State,
@@ -61,7 +62,7 @@ from freqtrade.rpc.rpc_types import (
)
from freqtrade.strategy.interface import IStrategy
from freqtrade.strategy.strategy_wrapper import strategy_safe_wrapper
from freqtrade.util import MeasureTime
from freqtrade.util import FtPrecise, MeasureTime
from freqtrade.util.migrations.binance_mig import migrate_binance_futures_names
from freqtrade.wallets import Wallets
@@ -108,6 +109,7 @@ class FreqtradeBot(LoggingMixin):
PairLocks.timeframe = self.config["timeframe"]
self.trading_mode: TradingMode = self.config.get("trading_mode", TradingMode.SPOT)
self.margin_mode: MarginMode = self.config.get("margin_mode", MarginMode.NONE)
self.last_process: Optional[datetime] = None
# RPC runs in separate threads, can start handling external commands just after
@@ -782,7 +784,14 @@ class FreqtradeBot(LoggingMixin):
if stake_amount is not None and stake_amount < 0.0:
# We should decrease our position
amount = self.exchange.amount_to_contract_precision(
trade.pair, abs(float(stake_amount * trade.amount / trade.stake_amount))
trade.pair,
abs(
float(
FtPrecise(stake_amount)
* FtPrecise(trade.amount)
/ FtPrecise(trade.stake_amount)
)
),
)
if amount == 0.0:
@@ -978,7 +987,7 @@ class FreqtradeBot(LoggingMixin):
base_currency=base_currency,
stake_currency=self.config["stake_currency"],
stake_amount=stake_amount,
amount=amount,
amount=0,
is_open=True,
amount_requested=amount_requested,
fee_open=fee,
@@ -2216,7 +2225,11 @@ class FreqtradeBot(LoggingMixin):
# TODO: should shorting/leverage be supported by Edge,
# then this will need to be fixed.
trade.adjust_stop_loss(trade.open_rate, self.strategy.stoploss, initial=True)
if order.ft_order_side == trade.entry_side or (trade.amount > 0 and trade.is_open):
if (
order.ft_order_side == trade.entry_side
or (trade.amount > 0 and trade.is_open)
or self.margin_mode == MarginMode.CROSS
):
# Must also run for partial exits
# TODO: Margin will need to use interest_rate as well.
# interest_rate = self.exchange.get_interest_rate()
@@ -1,8 +1,8 @@
# flake8: noqa: F401
from freqtrade.types.backtest_result_type import (
from freqtrade.ft_types.backtest_result_type import (
BacktestHistoryEntryType,
BacktestMetadataType,
BacktestResultType,
get_BacktestResultType_default,
)
from freqtrade.types.valid_exchanges_type import ValidExchangesType
from freqtrade.ft_types.valid_exchanges_type import ValidExchangesType
@@ -1,7 +1,7 @@
import logging
import time
from pathlib import Path
from typing import Any, Dict, List
from typing import Any, Dict, List, Union
import pandas as pd
from rich.text import Text
@@ -19,7 +19,9 @@ logger = logging.getLogger(__name__)
class LookaheadAnalysisSubFunctions:
@staticmethod
def text_table_lookahead_analysis_instances(
config: Dict[str, Any], lookahead_instances: List[LookaheadAnalysis]
config: Dict[str, Any],
lookahead_instances: List[LookaheadAnalysis],
caption: Union[str, None] = None,
):
headers = [
"filename",
@@ -65,7 +67,9 @@ class LookaheadAnalysisSubFunctions:
]
)
print_rich_table(data, headers, summary="Lookahead Analysis")
print_rich_table(
data, headers, summary="Lookahead Analysis", table_kwargs={"caption": caption}
)
return data
@staticmethod
@@ -239,8 +243,24 @@ class LookaheadAnalysisSubFunctions:
# report the results
if lookaheadAnalysis_instances:
caption: Union[str, None] = None
if any(
[
any(
[
indicator.startswith("&")
for indicator in inst.current_analysis.false_indicators
]
)
for inst in lookaheadAnalysis_instances
]
):
caption = (
"Any indicators in 'biased_indicators' which are used within "
"set_freqai_targets() can be ignored."
)
LookaheadAnalysisSubFunctions.text_table_lookahead_analysis_instances(
config, lookaheadAnalysis_instances
config, lookaheadAnalysis_instances, caption=caption
)
if config.get("lookahead_analysis_exportfilename") is not None:
LookaheadAnalysisSubFunctions.export_to_csv(config, lookaheadAnalysis_instances)
+15 -9
View File
@@ -36,6 +36,7 @@ from freqtrade.exchange import (
timeframe_to_seconds,
)
from freqtrade.exchange.exchange import Exchange
from freqtrade.ft_types import BacktestResultType, get_BacktestResultType_default
from freqtrade.mixins import LoggingMixin
from freqtrade.optimize.backtest_caching import get_strategy_run_id
from freqtrade.optimize.bt_progress import BTProgress
@@ -61,7 +62,6 @@ from freqtrade.plugins.protectionmanager import ProtectionManager
from freqtrade.resolvers import ExchangeResolver, StrategyResolver
from freqtrade.strategy.interface import IStrategy
from freqtrade.strategy.strategy_wrapper import strategy_safe_wrapper
from freqtrade.types import BacktestResultType, get_BacktestResultType_default
from freqtrade.util import FtPrecise
from freqtrade.util.migrations import migrate_data
from freqtrade.wallets import Wallets
@@ -122,6 +122,7 @@ class Backtesting:
self.processed_dfs: Dict[str, Dict] = {}
self.rejected_dict: Dict[str, List] = {}
self.rejected_df: Dict[str, Dict] = {}
self.exited_dfs: Dict[str, Dict] = {}
self._exchange_name = self.config["exchange"]["name"]
if not exchange:
@@ -1098,7 +1099,7 @@ class Backtesting:
open_rate_requested=propose_rate,
open_date=current_time,
stake_amount=stake_amount,
amount=amount,
amount=0,
amount_requested=amount,
fee_open=self.fee,
fee_close=self.fee,
@@ -1165,12 +1166,10 @@ class Backtesting:
self._exit_trade(
trade, exit_row, exit_row[OPEN_IDX], trade.amount, ExitType.FORCE_EXIT.value
)
trade.orders[-1].close_bt_order(exit_row[DATE_IDX].to_pydatetime(), trade)
trade.close_date = exit_row[DATE_IDX].to_pydatetime()
trade.exit_reason = ExitType.FORCE_EXIT.value
trade.close(exit_row[OPEN_IDX], show_msg=False)
LocalTrade.close_bt_trade(trade)
self._process_exit_order(
trade.orders[-1], trade, exit_row[DATE_IDX].to_pydatetime(), exit_row, pair
)
def trade_slot_available(self, open_trade_count: int) -> bool:
# Always allow trades when max_open_trades is enabled.
@@ -1566,11 +1565,14 @@ class Backtesting:
and self.dataprovider.runmode == RunMode.BACKTEST
):
self.processed_dfs[strategy_name] = generate_trade_signal_candles(
preprocessed_tmp, results
preprocessed_tmp, results, "open_date"
)
self.rejected_df[strategy_name] = generate_rejected_signals(
preprocessed_tmp, self.rejected_dict
)
self.exited_dfs[strategy_name] = generate_trade_signal_candles(
preprocessed_tmp, results, "close_date"
)
return min_date, max_date
@@ -1646,7 +1648,11 @@ class Backtesting:
and self.dataprovider.runmode == RunMode.BACKTEST
):
store_backtest_analysis_results(
self.config["exportfilename"], self.processed_dfs, self.rejected_df, dt_appendix
self.config["exportfilename"],
self.processed_dfs,
self.rejected_df,
self.exited_dfs,
dt_appendix,
)
# Results may be mixed up now. Sort them so they follow --strategy-list order.
@@ -2,8 +2,8 @@ import logging
from typing import Any, Dict, List, Literal, Union
from freqtrade.constants import UNLIMITED_STAKE_AMOUNT, Config
from freqtrade.ft_types import BacktestResultType
from freqtrade.optimize.optimize_reports.optimize_reports import generate_periodic_breakdown_stats
from freqtrade.types import BacktestResultType
from freqtrade.util import decimals_per_coin, fmt_coin, print_rich_table
@@ -263,12 +263,32 @@ def text_table_add_metrics(strat_results: Dict) -> None:
else []
)
trading_mode = (
(
[
(
"Trading Mode",
(
""
if not strat_results.get("margin_mode")
or strat_results.get("trading_mode", "spot") == "spot"
else f"{strat_results['margin_mode'].capitalize()} "
)
+ f"{strat_results['trading_mode'].capitalize()}",
)
]
)
if "trading_mode" in strat_results
else []
)
# Newly added fields should be ignored if they are missing in strat_results. hyperopt-show
# command stores these results and newer version of freqtrade must be able to handle old
# results with missing new fields.
metrics = [
("Backtesting from", strat_results["backtest_start"]),
("Backtesting to", strat_results["backtest_end"]),
*trading_mode,
("Max open trades", strat_results["max_open_trades"]),
("", ""), # Empty line to improve readability
(
@@ -5,9 +5,9 @@ from typing import Dict, Optional
from pandas import DataFrame
from freqtrade.constants import LAST_BT_RESULT_FN
from freqtrade.ft_types import BacktestResultType
from freqtrade.misc import file_dump_joblib, file_dump_json
from freqtrade.optimize.backtest_caching import get_backtest_metadata_filename
from freqtrade.types import BacktestResultType
logger = logging.getLogger(__name__)
@@ -90,7 +90,12 @@ def _store_backtest_analysis_data(
def store_backtest_analysis_results(
recordfilename: Path, candles: Dict[str, Dict], trades: Dict[str, Dict], dtappendix: str
recordfilename: Path,
candles: Dict[str, Dict],
trades: Dict[str, Dict],
exited: Dict[str, Dict],
dtappendix: str,
) -> None:
_store_backtest_analysis_data(recordfilename, candles, dtappendix, "signals")
_store_backtest_analysis_data(recordfilename, trades, dtappendix, "rejected")
_store_backtest_analysis_data(recordfilename, exited, dtappendix, "exited")
@@ -17,7 +17,7 @@ from freqtrade.data.metrics import (
calculate_sharpe,
calculate_sortino,
)
from freqtrade.types import BacktestResultType
from freqtrade.ft_types import BacktestResultType
from freqtrade.util import decimals_per_coin, fmt_coin
@@ -25,8 +25,8 @@ logger = logging.getLogger(__name__)
def generate_trade_signal_candles(
preprocessed_df: Dict[str, DataFrame], bt_results: Dict[str, Any]
) -> DataFrame:
preprocessed_df: Dict[str, DataFrame], bt_results: Dict[str, Any], date_col: str
) -> Dict[str, DataFrame]:
signal_candles_only = {}
for pair in preprocessed_df.keys():
signal_candles_only_df = DataFrame()
@@ -36,8 +36,8 @@ def generate_trade_signal_candles(
pairresults = resdf.loc[(resdf["pair"] == pair)]
if pairdf.shape[0] > 0:
for t, v in pairresults.open_date.items():
allinds = pairdf.loc[(pairdf["date"] < v)]
for t, v in pairresults.iterrows():
allinds = pairdf.loc[(pairdf["date"] < v[date_col])]
signal_inds = allinds.iloc[[-1]]
signal_candles_only_df = concat(
[signal_candles_only_df.infer_objects(), signal_inds.infer_objects()]
@@ -504,6 +504,8 @@ def generate_strategy_stats(
"exit_profit_only": config["exit_profit_only"],
"exit_profit_offset": config["exit_profit_offset"],
"ignore_roi_if_entry_signal": config["ignore_roi_if_entry_signal"],
"trading_mode": config["trading_mode"],
"margin_mode": config["margin_mode"],
**periodic_breakdown,
**daily_stats,
**trade_stats,
+5 -8
View File
@@ -341,8 +341,8 @@ class Order(ModelBase):
order_id=str(order["id"]),
ft_order_side=side,
ft_pair=pair,
ft_amount=amount if amount else order["amount"],
ft_price=price if price else order["price"],
ft_amount=amount or order.get("amount", None) or 0.0,
ft_price=price or order.get("price", None),
)
o.update_from_ccxt_object(order)
@@ -623,7 +623,7 @@ class LocalTrade:
self.orders = []
if self.trading_mode == TradingMode.MARGIN and self.interest_rate is None:
raise OperationalException(
f"{self.trading_mode.value} trading requires param interest_rate on trades"
f"{self.trading_mode} trading requires param interest_rate on trades"
)
def __repr__(self):
@@ -1079,7 +1079,7 @@ class LocalTrade:
return float(self._calc_base_close(amount1, rate, self.fee_close)) + funding_fees
else:
raise OperationalException(
f"{self.trading_mode.value} trading is not yet available using freqtrade"
f"{self.trading_mode} trading is not yet available using freqtrade"
)
def calc_profit(
@@ -1161,10 +1161,7 @@ class LocalTrade:
else:
open_trade_value = self._calc_open_trade_value(amount, open_rate)
short_close_zero = self.is_short and close_trade_value == 0.0
long_close_zero = not self.is_short and open_trade_value == 0.0
if short_close_zero or long_close_zero:
if open_trade_value == 0.0:
return 0.0
else:
if self.is_short:
+1 -1
View File
@@ -11,7 +11,7 @@ from pandas import DataFrame
from freqtrade.constants import ListPairsWithTimeframes
from freqtrade.exceptions import OperationalException
from freqtrade.exchange.types import Tickers
from freqtrade.exchange.exchange_types import Tickers
from freqtrade.misc import plural
from freqtrade.plugins.pairlist.IPairList import IPairList, PairlistParameter, SupportsBacktesting
from freqtrade.util import PeriodicCache, dt_floor_day, dt_now, dt_ts
@@ -5,7 +5,7 @@ Full trade slots pair list filter
import logging
from typing import List
from freqtrade.exchange.types import Tickers
from freqtrade.exchange.exchange_types import Tickers
from freqtrade.persistence import Trade
from freqtrade.plugins.pairlist.IPairList import IPairList, SupportsBacktesting
+7 -1
View File
@@ -11,7 +11,7 @@ from typing import Any, Dict, List, Literal, Optional, TypedDict, Union
from freqtrade.constants import Config
from freqtrade.exceptions import OperationalException
from freqtrade.exchange import Exchange, market_is_active
from freqtrade.exchange.types import Ticker, Tickers
from freqtrade.exchange.exchange_types import Ticker, Tickers
from freqtrade.mixins import LoggingMixin
@@ -39,6 +39,11 @@ class __OptionPairlistParameter(__PairlistParameterBase):
options: List[str]
class __ListPairListParamenter(__PairlistParameterBase):
type: Literal["list"]
default: Union[List[str], None]
class __BoolPairlistParameter(__PairlistParameterBase):
type: Literal["boolean"]
default: Union[bool, None]
@@ -49,6 +54,7 @@ PairlistParameter = Union[
__StringPairlistParameter,
__OptionPairlistParameter,
__BoolPairlistParameter,
__ListPairListParamenter,
]
+47 -11
View File
@@ -10,7 +10,7 @@ from typing import Dict, List
from cachetools import TTLCache
from freqtrade.exceptions import OperationalException
from freqtrade.exchange.types import Tickers
from freqtrade.exchange.exchange_types import Tickers
from freqtrade.plugins.pairlist.IPairList import IPairList, PairlistParameter, SupportsBacktesting
from freqtrade.util.coin_gecko import FtCoinGeckoApi
@@ -35,6 +35,7 @@ class MarketCapPairList(IPairList):
self._number_assets = self._pairlistconfig["number_assets"]
self._max_rank = self._pairlistconfig.get("max_rank", 30)
self._refresh_period = self._pairlistconfig.get("refresh_period", 86400)
self._categories = self._pairlistconfig.get("categories", [])
self._marketcap_cache: TTLCache = TTLCache(maxsize=1, ttl=self._refresh_period)
self._def_candletype = self._config["candle_type_def"]
@@ -45,6 +46,17 @@ class MarketCapPairList(IPairList):
is_demo=_coingecko_config.get("is_demo", True),
)
if self._categories:
categories = self._coingecko.get_coins_categories_list()
category_ids = [cat["category_id"] for cat in categories]
for category in self._categories:
if category not in category_ids:
raise OperationalException(
f"Category {category} not in coingecko category list. "
f"You can choose from {category_ids}"
)
if self._max_rank > 250:
raise OperationalException("This filter only support marketcap rank up to 250.")
@@ -85,6 +97,15 @@ class MarketCapPairList(IPairList):
"description": "Max rank of assets",
"help": "Maximum rank of assets to use from the pairlist",
},
"categories": {
"type": "list",
"default": [],
"description": "Coin Categories",
"help": (
"The Category of the coin e.g layer-1 default [] "
"(https://www.coingecko.com/en/categories)"
),
},
"refresh_period": {
"type": "number",
"default": 86400,
@@ -132,15 +153,29 @@ class MarketCapPairList(IPairList):
"""
marketcap_list = self._marketcap_cache.get("marketcap")
default_kwargs = {
"vs_currency": "usd",
"order": "market_cap_desc",
"per_page": "250",
"page": "1",
"sparkline": "false",
"locale": "en",
}
if marketcap_list is None:
data = self._coingecko.get_coins_markets(
vs_currency="usd",
order="market_cap_desc",
per_page="250",
page="1",
sparkline="false",
locale="en",
)
data = []
if not self._categories:
data = self._coingecko.get_coins_markets(**default_kwargs)
else:
for category in self._categories:
category_data = self._coingecko.get_coins_markets(
**default_kwargs, **({"category": category} if category else {})
)
data += category_data
data.sort(key=lambda d: float(d.get("market_cap") or 0.0), reverse=True)
if data:
marketcap_list = [row["symbol"] for row in data]
self._marketcap_cache["marketcap"] = marketcap_list
@@ -157,7 +192,7 @@ class MarketCapPairList(IPairList):
for mc_pair in top_marketcap:
test_pair = f"{mc_pair.upper()}/{pair_format}"
if test_pair in pairlist:
if test_pair in pairlist and test_pair not in filtered_pairlist:
filtered_pairlist.append(test_pair)
if len(filtered_pairlist) == self._number_assets:
break
@@ -165,4 +200,5 @@ class MarketCapPairList(IPairList):
if len(filtered_pairlist) > 0:
return filtered_pairlist
return pairlist
# If no pairs are found, return the original pairlist
return []
+1 -1
View File
@@ -6,7 +6,7 @@ import logging
from typing import Dict, List
from freqtrade.exceptions import OperationalException
from freqtrade.exchange.types import Tickers
from freqtrade.exchange.exchange_types import Tickers
from freqtrade.plugins.pairlist.IPairList import IPairList, PairlistParameter, SupportsBacktesting
@@ -16,7 +16,7 @@ from pandas import DataFrame
from freqtrade.constants import ListPairsWithTimeframes, PairWithTimeframe
from freqtrade.exceptions import OperationalException
from freqtrade.exchange import timeframe_to_minutes, timeframe_to_prev_date
from freqtrade.exchange.types import Ticker, Tickers
from freqtrade.exchange.exchange_types import Ticker, Tickers
from freqtrade.plugins.pairlist.IPairList import IPairList, PairlistParameter, SupportsBacktesting
from freqtrade.util import dt_now, format_ms_time
@@ -7,7 +7,7 @@ from typing import Dict, List
import pandas as pd
from freqtrade.exchange.types import Tickers
from freqtrade.exchange.exchange_types import Tickers
from freqtrade.persistence import Trade
from freqtrade.plugins.pairlist.IPairList import IPairList, PairlistParameter, SupportsBacktesting
@@ -7,7 +7,7 @@ from typing import Optional
from freqtrade.exceptions import OperationalException
from freqtrade.exchange import ROUND_UP
from freqtrade.exchange.types import Ticker
from freqtrade.exchange.exchange_types import Ticker
from freqtrade.plugins.pairlist.IPairList import IPairList, SupportsBacktesting
+1 -1
View File
@@ -6,7 +6,7 @@ import logging
from typing import Dict, Optional
from freqtrade.exceptions import OperationalException
from freqtrade.exchange.types import Ticker
from freqtrade.exchange.exchange_types import Ticker
from freqtrade.plugins.pairlist.IPairList import IPairList, PairlistParameter, SupportsBacktesting
@@ -8,7 +8,7 @@ import logging
from typing import Dict, List, Optional
from freqtrade.exceptions import OperationalException
from freqtrade.exchange.types import Tickers
from freqtrade.exchange.exchange_types import Tickers
from freqtrade.plugins.pairlist.IPairList import IPairList, PairlistParameter, SupportsBacktesting
+1 -1
View File
@@ -15,7 +15,7 @@ from cachetools import TTLCache
from freqtrade import __version__
from freqtrade.configuration.load_config import CONFIG_PARSE_MODE
from freqtrade.exceptions import OperationalException
from freqtrade.exchange.types import Tickers
from freqtrade.exchange.exchange_types import Tickers
from freqtrade.plugins.pairlist.IPairList import IPairList, PairlistParameter, SupportsBacktesting
from freqtrade.plugins.pairlist.pairlist_helpers import expand_pairlist
+1 -1
View File
@@ -8,7 +8,7 @@ from typing import Dict, List, Literal
from freqtrade.enums import RunMode
from freqtrade.exchange import timeframe_to_seconds
from freqtrade.exchange.types import Tickers
from freqtrade.exchange.exchange_types import Tickers
from freqtrade.plugins.pairlist.IPairList import IPairList, PairlistParameter, SupportsBacktesting
from freqtrade.util.periodic_cache import PeriodicCache
+1 -1
View File
@@ -6,7 +6,7 @@ import logging
from typing import Dict, Optional
from freqtrade.exceptions import OperationalException
from freqtrade.exchange.types import Ticker
from freqtrade.exchange.exchange_types import Ticker
from freqtrade.plugins.pairlist.IPairList import IPairList, PairlistParameter, SupportsBacktesting
+8 -7
View File
@@ -8,7 +8,7 @@ import logging
from copy import deepcopy
from typing import Dict, List
from freqtrade.exchange.types import Tickers
from freqtrade.exchange.exchange_types import Tickers
from freqtrade.plugins.pairlist.IPairList import IPairList, PairlistParameter, SupportsBacktesting
@@ -61,14 +61,15 @@ class StaticPairList(IPairList):
:param tickers: Tickers (from exchange.get_tickers). May be cached.
:return: List of pairs
"""
wl = self.verify_whitelist(
self._config["exchange"]["pair_whitelist"], logger.info, keep_invalid=True
)
if self._allow_inactive:
return self.verify_whitelist(
self._config["exchange"]["pair_whitelist"], logger.info, keep_invalid=True
)
return wl
else:
return self._whitelist_for_active_markets(
self.verify_whitelist(self._config["exchange"]["pair_whitelist"], logger.info)
)
# Avoid implicit filtering of "verify_whitelist" to keep
# proper warnings in the log
return self._whitelist_for_active_markets(wl)
def filter_pairlist(self, pairlist: List[str], tickers: Tickers) -> List[str]:
"""
@@ -13,7 +13,7 @@ from pandas import DataFrame
from freqtrade.constants import ListPairsWithTimeframes
from freqtrade.exceptions import OperationalException
from freqtrade.exchange.types import Tickers
from freqtrade.exchange.exchange_types import Tickers
from freqtrade.misc import plural
from freqtrade.plugins.pairlist.IPairList import IPairList, PairlistParameter, SupportsBacktesting
from freqtrade.util import dt_floor_day, dt_now, dt_ts
+1 -1
View File
@@ -13,7 +13,7 @@ from cachetools import TTLCache
from freqtrade.constants import ListPairsWithTimeframes
from freqtrade.exceptions import OperationalException
from freqtrade.exchange import timeframe_to_minutes, timeframe_to_prev_date
from freqtrade.exchange.types import Tickers
from freqtrade.exchange.exchange_types import Tickers
from freqtrade.plugins.pairlist.IPairList import IPairList, PairlistParameter, SupportsBacktesting
from freqtrade.util import dt_now, format_ms_time
@@ -28,6 +28,7 @@ def expand_pairlist(
except re.error as err:
raise ValueError(f"Wildcard error in {pair_wc}, {err}")
# Remove wildcard pairs that didn't have a match.
result = [element for element in result if re.fullmatch(r"^[A-Za-z0-9:/-]+$", element)]
else:
@@ -11,7 +11,7 @@ from pandas import DataFrame
from freqtrade.constants import ListPairsWithTimeframes
from freqtrade.exceptions import OperationalException
from freqtrade.exchange.types import Tickers
from freqtrade.exchange.exchange_types import Tickers
from freqtrade.misc import plural
from freqtrade.plugins.pairlist.IPairList import IPairList, PairlistParameter, SupportsBacktesting
from freqtrade.util import dt_floor_day, dt_now, dt_ts
+1 -1
View File
@@ -13,7 +13,7 @@ from freqtrade.data.dataprovider import DataProvider
from freqtrade.enums import CandleType
from freqtrade.enums.runmode import RunMode
from freqtrade.exceptions import OperationalException
from freqtrade.exchange.types import Tickers
from freqtrade.exchange.exchange_types import Tickers
from freqtrade.mixins import LoggingMixin
from freqtrade.plugins.pairlist.IPairList import IPairList, SupportsBacktesting
from freqtrade.plugins.pairlist.pairlist_helpers import expand_pairlist
+1 -1
View File
@@ -21,6 +21,7 @@ from freqtrade.data.btanalysis import (
from freqtrade.enums import BacktestState
from freqtrade.exceptions import ConfigurationError, DependencyException, OperationalException
from freqtrade.exchange.common import remove_exchange_credentials
from freqtrade.ft_types import get_BacktestResultType_default
from freqtrade.misc import deep_merge_dicts, is_file_in_dir
from freqtrade.rpc.api_server.api_schemas import (
BacktestHistoryEntry,
@@ -32,7 +33,6 @@ from freqtrade.rpc.api_server.api_schemas import (
from freqtrade.rpc.api_server.deps import get_config
from freqtrade.rpc.api_server.webserver_bgwork import ApiBG
from freqtrade.rpc.rpc import RPCException
from freqtrade.types import get_BacktestResultType_default
logger = logging.getLogger(__name__)
+1 -1
View File
@@ -5,7 +5,7 @@ from pydantic import AwareDatetime, BaseModel, RootModel, SerializeAsAny
from freqtrade.constants import IntOrInf
from freqtrade.enums import MarginMode, OrderTypeValues, SignalDirection, TradingMode
from freqtrade.types import ValidExchangesType
from freqtrade.ft_types import ValidExchangesType
class ExchangeModePayloadMixin(BaseModel):
+1 -1
View File
@@ -31,7 +31,7 @@ from freqtrade.enums import (
)
from freqtrade.exceptions import ExchangeError, PricingError
from freqtrade.exchange import timeframe_to_minutes, timeframe_to_msecs
from freqtrade.exchange.types import Tickers
from freqtrade.exchange.exchange_types import Tickers
from freqtrade.loggers import bufferHandler
from freqtrade.persistence import KeyStoreKeys, KeyValueStore, PairLocks, Trade
from freqtrade.persistence.models import PairLock
+1 -7
View File
@@ -1274,7 +1274,7 @@ class Telegram(RPCHandler):
InlineKeyboardButton(text=trade[1], callback_data=f"force_exit__{trade[0]}")
for trade in trades
]
buttons_aligned = self._layout_inline_keyboard_onecol(trade_buttons)
buttons_aligned = self._layout_inline_keyboard(trade_buttons, cols=1)
buttons_aligned.append(
[InlineKeyboardButton(text="Cancel", callback_data="force_exit__cancel")]
@@ -1348,12 +1348,6 @@ class Telegram(RPCHandler):
) -> List[List[InlineKeyboardButton]]:
return [buttons[i : i + cols] for i in range(0, len(buttons), cols)]
@staticmethod
def _layout_inline_keyboard_onecol(
buttons: List[InlineKeyboardButton], cols=1
) -> List[List[InlineKeyboardButton]]:
return [buttons[i : i + cols] for i in range(0, len(buttons), cols)]
@authorized_only
async def _force_enter(
self, update: Update, context: CallbackContext, order_side: SignalDirection
+11 -4
View File
@@ -1,13 +1,20 @@
from typing import Callable, List, Union
from typing import Callable, List, Optional, Union
from rich.console import ConsoleRenderable, Group, RichCast
from rich.progress import Progress
class CustomProgress(Progress):
def __init__(self, *args, cust_objs=[], cust_callables: List[Callable] = [], **kwargs) -> None:
self._cust_objs = cust_objs
self._cust_callables = cust_callables
def __init__(
self,
*args,
cust_objs: Optional[List[ConsoleRenderable]] = None,
cust_callables: Optional[List[Callable[[], ConsoleRenderable]]] = None,
**kwargs,
) -> None:
self._cust_objs = cust_objs or []
self._cust_callables = cust_callables or []
super().__init__(*args, **kwargs)
def get_renderable(self) -> Union[ConsoleRenderable, RichCast, str]:
+13 -3
View File
@@ -99,11 +99,21 @@ class Wallets:
used_stake = 0.0
if self._config.get("trading_mode", "spot") != TradingMode.FUTURES:
current_stake = self.start_cap + tot_profit - tot_in_trades
total_stake = current_stake
for trade in open_trades:
curr = self._exchange.get_pair_base_currency(trade.pair)
_wallets[curr] = Wallet(curr, trade.amount, 0, trade.amount)
used_stake += sum(
o.stake_amount for o in trade.open_orders if o.ft_order_side == trade.entry_side
)
pending = sum(
o.amount
for o in trade.open_orders
if o.amount and o.ft_order_side == trade.exit_side
)
_wallets[curr] = Wallet(curr, trade.amount - pending, pending, trade.amount)
current_stake = self.start_cap + tot_profit - tot_in_trades
total_stake = current_stake + used_stake
else:
tot_in_trades = 0
for position in open_trades:
+1 -1
View File
@@ -1,7 +1,7 @@
from freqtrade_client.ft_rest_client import FtRestClient
__version__ = "2024.8"
__version__ = "2024.9"
if "dev" in __version__:
from pathlib import Path
+4 -1
View File
@@ -1,5 +1,5 @@
site_name: Freqtrade
site_url: !ENV [READTHEDOCS_CANONICAL_URL, 'https://www.freqtrade.io/en/latest/']
site_url: !ENV [READTHEDOCS_CANONICAL_URL, 'https://www.freqtrade.io/en/']
site_description: Freqtrade is a free and open source crypto trading bot written in Python, designed to support all major exchanges and be controlled via Telegram or builtin Web UI
repo_url: https://github.com/freqtrade/freqtrade
edit_uri: edit/develop/docs/
@@ -116,6 +116,9 @@ extra:
version:
provider: mike
alias: true
analytics:
provider: google
property: G-VH170LG9M5
plugins:
- search:
enabled: true
+6 -3
View File
@@ -128,7 +128,7 @@ target-version = "py38"
# Exclude UP036 as it's causing the "exit if < 3.9" to fail.
extend-select = [
"C90", # mccabe
# "B", # bugbear
"B", # bugbear
# "N", # pep8-naming
"F", # pyflakes
"E", # pycodestyle
@@ -155,10 +155,11 @@ extend-ignore = [
"E272", # Multiple spaces before keyword
"E221", # Multiple spaces before operator
"B007", # Loop control variable not used
"B904", # BugBear - except raise from
"S603", # `subprocess` call: check for execution of untrusted input
"S607", # Starting a process with a partial executable path
"S608", # Possible SQL injection vector through string-based query construction
"NPY002", # Numpy legacy random generator
"NPY002", # Numpy legacy random generator
]
[tool.ruff.lint.mccabe]
@@ -166,7 +167,9 @@ max-complexity = 12
[tool.ruff.lint.per-file-ignores]
"freqtrade/freqai/**/*.py" = [
"S311" # Standard pseudo-random generators are not suitable for cryptographic purposes
"S311", # Standard pseudo-random generators are not suitable for cryptographic purposes
"B006", # Bugbear - mutable default argument
"B008", # bugbear - Do not perform function calls in argument defaults
]
"tests/**/*.py" = [
"S101", # allow assert in tests
+4 -4
View File
@@ -7,10 +7,10 @@
-r docs/requirements-docs.txt
coveralls==4.0.1
ruff==0.6.2
ruff==0.6.7
mypy==1.11.2
pre-commit==3.8.0
pytest==8.3.2
pytest==8.3.3
pytest-asyncio==0.24.0
pytest-cov==5.0.0
pytest-mock==3.14.0
@@ -27,6 +27,6 @@ nbconvert==7.16.4
# mypy types
types-cachetools==5.5.0.20240820
types-filelock==3.2.7
types-requests==2.32.0.20240712
types-requests==2.32.0.20240914
types-tabulate==0.9.0.20240106
types-python-dateutil==2.9.0.20240821
types-python-dateutil==2.9.0.20240906
+1 -1
View File
@@ -3,7 +3,7 @@
# Required for freqai-rl
torch==2.2.2; sys_platform == 'darwin' and platform_machine == 'x86_64'
torch==2.4.0; sys_platform != 'darwin' or platform_machine != 'x86_64'
torch==2.4.1; sys_platform != 'darwin' or platform_machine != 'x86_64'
gymnasium==0.29.1
stable_baselines3==2.3.2
sb3_contrib>=2.2.1
+2 -2
View File
@@ -3,9 +3,9 @@
-r requirements-plot.txt
# Required for freqai
scikit-learn==1.5.1
scikit-learn==1.5.2
joblib==1.4.2
catboost==1.2.5; 'arm' not in platform_machine
catboost==1.2.7; 'arm' not in platform_machine
# Pin Matplotlib - it's depended on by catboost
# Temporary downgrade of matplotlib due to https://github.com/matplotlib/matplotlib/issues/28551
matplotlib==3.9.2
+2 -2
View File
@@ -4,6 +4,6 @@
# Required for hyperopt
scipy==1.14.1; python_version >= "3.10"
scipy==1.13.1; python_version < "3.10"
scikit-learn==1.5.1
scikit-learn==1.5.2
ft-scikit-optimize==0.9.2
filelock==3.15.4
filelock==3.16.1
+1 -1
View File
@@ -1,4 +1,4 @@
# Include all requirements to run the bot.
-r requirements.txt
plotly==5.23.0
plotly==5.24.1

Some files were not shown because too many files have changed in this diff Show More