Merge branch 'freqtrade:develop' into develop

This commit is contained in:
Simon Waiblinger 2024-05-30 10:10:03 +02:00 committed by GitHub
commit 42d0f342b2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
37 changed files with 265 additions and 1154 deletions

View File

@ -565,12 +565,12 @@ jobs:
sudo systemctl restart docker sudo systemctl restart docker
docker version -f '{{.Server.Experimental}}' docker version -f '{{.Server.Experimental}}'
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx - name: Set up Docker Buildx
id: buildx id: buildx
uses: crazy-max/ghaction-docker-buildx@v3.3.1 uses: docker/setup-buildx-action@v1
with:
buildx-version: latest
qemu-version: latest
- name: Available platforms - name: Available platforms
run: echo ${{ steps.buildx.outputs.platforms }} run: echo ${{ steps.buildx.outputs.platforms }}

View File

@ -26,9 +26,6 @@ jobs:
- name: Run auto-update - name: Run auto-update
run: pre-commit autoupdate run: pre-commit autoupdate
- name: Run pre-commit
run: pre-commit run --all-files
- uses: peter-evans/create-pull-request@v6 - uses: peter-evans/create-pull-request@v6
with: with:
token: ${{ secrets.REPO_SCOPED_TOKEN }} token: ${{ secrets.REPO_SCOPED_TOKEN }}

View File

@ -16,7 +16,7 @@ repos:
additional_dependencies: additional_dependencies:
- types-cachetools==5.3.0.7 - types-cachetools==5.3.0.7
- types-filelock==3.2.7 - types-filelock==3.2.7
- types-requests==2.31.0.20240406 - types-requests==2.32.0.20240523
- types-tabulate==0.9.0.20240106 - types-tabulate==0.9.0.20240106
- types-python-dateutil==2.9.0.20240316 - types-python-dateutil==2.9.0.20240316
- SQLAlchemy==2.0.30 - SQLAlchemy==2.0.30
@ -31,7 +31,7 @@ repos:
- repo: https://github.com/charliermarsh/ruff-pre-commit - repo: https://github.com/charliermarsh/ruff-pre-commit
# Ruff version. # Ruff version.
rev: 'v0.4.4' rev: 'v0.4.5'
hooks: hooks:
- id: ruff - id: ruff
@ -56,7 +56,7 @@ repos:
)$ )$
- repo: https://github.com/codespell-project/codespell - repo: https://github.com/codespell-project/codespell
rev: v2.2.6 rev: v2.3.0
hooks: hooks:
- id: codespell - id: codespell
additional_dependencies: additional_dependencies:

View File

@ -29,6 +29,7 @@ Please read the [exchange specific notes](docs/exchanges.md) to learn about even
- [X] [Binance](https://www.binance.com/) - [X] [Binance](https://www.binance.com/)
- [X] [Bitmart](https://bitmart.com/) - [X] [Bitmart](https://bitmart.com/)
- [X] [BingX](https://bingx.com/invite/0EM9RX)
- [X] [Gate.io](https://www.gate.io/ref/6266643) - [X] [Gate.io](https://www.gate.io/ref/6266643)
- [X] [HTX](https://www.htx.com/) (Former Huobi) - [X] [HTX](https://www.htx.com/) (Former Huobi)
- [X] [Kraken](https://kraken.com/) - [X] [Kraken](https://kraken.com/)

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -35,7 +35,7 @@ COPY build_helpers/* /tmp/
COPY --chown=ftuser:ftuser requirements.txt /freqtrade/ COPY --chown=ftuser:ftuser requirements.txt /freqtrade/
USER ftuser USER ftuser
RUN pip install --user --no-cache-dir numpy \ RUN pip install --user --no-cache-dir numpy \
&& pip install --user --no-index --find-links /tmp/ pyarrow TA-Lib==0.4.28 \ && pip install --user --no-index --find-links /tmp/ pyarrow TA-Lib \
&& pip install --user --no-cache-dir -r requirements.txt && pip install --user --no-cache-dir -r requirements.txt
# Copy dependencies to runtime-image # Copy dependencies to runtime-image

View File

@ -127,6 +127,13 @@ These settings will be checked on startup, and freqtrade will show an error if t
Freqtrade will not attempt to change these settings. Freqtrade will not attempt to change these settings.
## Bingx
BingX supports [time_in_force](configuration.md#understand-order_time_in_force) with settings "GTC" (good till cancelled), "IOC" (immediate-or-cancel) and "PO" (Post only) settings.
!!! Tip "Stoploss on Exchange"
Bingx supports `stoploss_on_exchange` and can use both stop-limit and stop-market orders. It provides great advantages, so we recommend to benefit from it by enabling stoploss on exchange.
## Kraken ## Kraken
Kraken supports [time_in_force](configuration.md#understand-order_time_in_force) with settings "GTC" (good till cancelled), "IOC" (immediate-or-cancel) and "PO" (Post only) settings. Kraken supports [time_in_force](configuration.md#understand-order_time_in_force) with settings "GTC" (good till cancelled), "IOC" (immediate-or-cancel) and "PO" (Post only) settings.

View File

@ -224,7 +224,7 @@ where $W_i$ is the weight of data point $i$ in a total set of $n$ data points. B
## Building the data pipeline ## Building the data pipeline
By default, FreqAI builds a dynamic pipeline based on user congfiguration settings. The default settings are robust and designed to work with a variety of methods. These two steps are a `MinMaxScaler(-1,1)` and a `VarianceThreshold` which removes any column that has 0 variance. Users can activate other steps with more configuration parameters. For example if users add `use_SVM_to_remove_outliers: true` to the `freqai` config, then FreqAI will automatically add the [`SVMOutlierExtractor`](#identifying-outliers-using-a-support-vector-machine-svm) to the pipeline. Likewise, users can add `principal_component_analysis: true` to the `freqai` config to activate PCA. The [DissimilarityIndex](#identifying-outliers-with-the-dissimilarity-index-di) is activated with `DI_threshold: 1`. Finally, noise can also be added to the data with `noise_standard_deviation: 0.1`. Finally, users can add [DBSCAN](#identifying-outliers-with-dbscan) outlier removal with `use_DBSCAN_to_remove_outliers: true`. By default, FreqAI builds a dynamic pipeline based on user configuration settings. The default settings are robust and designed to work with a variety of methods. These two steps are a `MinMaxScaler(-1,1)` and a `VarianceThreshold` which removes any column that has 0 variance. Users can activate other steps with more configuration parameters. For example if users add `use_SVM_to_remove_outliers: true` to the `freqai` config, then FreqAI will automatically add the [`SVMOutlierExtractor`](#identifying-outliers-using-a-support-vector-machine-svm) to the pipeline. Likewise, users can add `principal_component_analysis: true` to the `freqai` config to activate PCA. The [DissimilarityIndex](#identifying-outliers-with-the-dissimilarity-index-di) is activated with `DI_threshold: 1`. Finally, noise can also be added to the data with `noise_standard_deviation: 0.1`. Finally, users can add [DBSCAN](#identifying-outliers-with-dbscan) outlier removal with `use_DBSCAN_to_remove_outliers: true`.
!!! note "More information available" !!! note "More information available"
Please review the [parameter table](freqai-parameter-table.md) for more information on these parameters. Please review the [parameter table](freqai-parameter-table.md) for more information on these parameters.

View File

@ -41,6 +41,7 @@ Please read the [exchange specific notes](exchanges.md) to learn about eventual,
- [X] [Binance](https://www.binance.com/) - [X] [Binance](https://www.binance.com/)
- [X] [Bitmart](https://bitmart.com/) - [X] [Bitmart](https://bitmart.com/)
- [X] [BingX](https://bingx.com/invite/0EM9RX)
- [X] [Gate.io](https://www.gate.io/ref/6266643) - [X] [Gate.io](https://www.gate.io/ref/6266643)
- [X] [HTX](https://www.htx.com/) (Former Huobi) - [X] [HTX](https://www.htx.com/) (Former Huobi)
- [X] [Kraken](https://kraken.com/) - [X] [Kraken](https://kraken.com/)

View File

@ -1,6 +1,6 @@
markdown==3.6 markdown==3.6
mkdocs==1.6.0 mkdocs==1.6.0
mkdocs-material==9.5.23 mkdocs-material==9.5.24
mdx_truly_sane_lists==1.3 mdx_truly_sane_lists==1.3
pymdown-extensions==10.8.1 pymdown-extensions==10.8.1
jinja2==3.1.4 jinja2==3.1.4

View File

@ -161,7 +161,7 @@ freqtrade-client --config rest_config.json <command> [optional parameters]
| `delete_lock <lock_id>` | Deletes (disables) the lock by id. | `delete_lock <lock_id>` | Deletes (disables) the lock by id.
| `locks add <pair>, <until>, [side], [reason]` | Locks a pair until "until". (Until will be rounded up to the nearest timeframe). | `locks add <pair>, <until>, [side], [reason]` | Locks a pair until "until". (Until will be rounded up to the nearest timeframe).
| `profit` | Display a summary of your profit/loss from close trades and some stats about your performance. | `profit` | Display a summary of your profit/loss from close trades and some stats about your performance.
| `forceexit <trade_id>` | Instantly exits the given trade (Ignoring `minimum_roi`). | `forceexit <trade_id> [order_type] [amount]` | Instantly exits the given trade (ignoring `minimum_roi`), using the given order type ("market" or "limit", uses your config setting if not specified), and the chosen amount (full sell if not specified).
| `forceexit all` | Instantly exits all open trades (Ignoring `minimum_roi`). | `forceexit all` | Instantly exits all open trades (Ignoring `minimum_roi`).
| `forceenter <pair> [rate]` | Instantly enters the given pair. Rate is optional. (`force_entry_enable` must be set to True) | `forceenter <pair> [rate]` | Instantly enters the given pair. Rate is optional. (`force_entry_enable` must be set to True)
| `forceenter <pair> <side> [rate]` | Instantly longs or shorts the given pair. Rate is optional. (`force_entry_enable` must be set to True) | `forceenter <pair> <side> [rate]` | Instantly longs or shorts the given pair. Rate is optional. (`force_entry_enable` must be set to True)

View File

@ -30,6 +30,7 @@ The Order-type will be ignored if only one mode is available.
|----------|-------------| |----------|-------------|
| Binance | limit | | Binance | limit |
| Binance Futures | market, limit | | Binance Futures | market, limit |
| Bingx | market, limit |
| HTX (former Huobi) | limit | | HTX (former Huobi) | limit |
| kraken | market, limit | | kraken | market, limit |
| Gate | limit | | Gate | limit |

View File

@ -1,6 +1,6 @@
"""Freqtrade bot""" """Freqtrade bot"""
__version__ = "2024.5-dev" __version__ = "2024.6-dev"
if "dev" in __version__: if "dev" in __version__:
from pathlib import Path from pathlib import Path

View File

@ -113,6 +113,7 @@ def ask_user_config() -> Dict[str, Any]:
"choices": [ "choices": [
"binance", "binance",
"binanceus", "binanceus",
"bingx",
"gate", "gate",
"htx", "htx",
"kraken", "kraken",
@ -128,7 +129,7 @@ def ask_user_config() -> Dict[str, Any]:
"message": "Do you want to trade Perpetual Swaps (perpetual futures)?", "message": "Do you want to trade Perpetual Swaps (perpetual futures)?",
"default": False, "default": False,
"filter": lambda val: "futures" if val else "spot", "filter": lambda val: "futures" if val else "spot",
"when": lambda x: x["exchange_name"] in ["binance", "gate", "okx"], "when": lambda x: x["exchange_name"] in ["binance", "gate", "okx", "bybit"],
}, },
{ {
"type": "autocomplete", "type": "autocomplete",

File diff suppressed because it is too large Load Diff

View File

@ -17,6 +17,7 @@ class Bingx(Exchange):
_ft_has: Dict = { _ft_has: Dict = {
"ohlcv_candle_limit": 1000, "ohlcv_candle_limit": 1000,
"stoploss_on_exchange": False, "stoploss_on_exchange": True,
"stoploss_order_types": {"limit": "limit", "market": "market"}, "stoploss_order_types": {"limit": "limit", "market": "market"},
"order_time_in_force": ["GTC", "IOC", "PO"],
} }

View File

@ -53,6 +53,7 @@ MAP_EXCHANGE_CHILDCLASS = {
SUPPORTED_EXCHANGES = [ SUPPORTED_EXCHANGES = [
"binance", "binance",
"bingx",
"bitmart", "bitmart",
"gate", "gate",
"htx", "htx",

View File

@ -960,7 +960,7 @@ class FreqaiDataKitchen:
""" """
Remove all special characters from feature strings (:) Remove all special characters from feature strings (:)
:param dataframe: the dataframe that just finished indicator population. (unfiltered) :param dataframe: the dataframe that just finished indicator population. (unfiltered)
:return: dataframe with cleaned featrue names :return: dataframe with cleaned feature names
""" """
spec_chars = [":"] spec_chars = [":"]

View File

@ -1,7 +1,7 @@
from freqtrade_client.ft_rest_client import FtRestClient from freqtrade_client.ft_rest_client import FtRestClient
__version__ = "2024.5-dev" __version__ = "2024.6-dev"
if "dev" in __version__: if "dev" in __version__:
from pathlib import Path from pathlib import Path

View File

@ -181,4 +181,4 @@ exclude = [
[tool.codespell] [tool.codespell]
ignore-words-list = "coo,fo,strat,zar,selectin" ignore-words-list = "coo,fo,strat,zar,selectin"
skip="*.svg,./user_data,./freqtrade/rpc/api_server/ui/installed" skip="*.svg,./user_data,freqtrade/rpc/api_server/ui/installed,freqtrade/exchange/*.json"

View File

@ -7,7 +7,7 @@
-r docs/requirements-docs.txt -r docs/requirements-docs.txt
coveralls==4.0.1 coveralls==4.0.1
ruff==0.4.4 ruff==0.4.5
mypy==1.10.0 mypy==1.10.0
pre-commit==3.7.1 pre-commit==3.7.1
pytest==8.2.1 pytest==8.2.1
@ -26,6 +26,6 @@ nbconvert==7.16.4
# mypy types # mypy types
types-cachetools==5.3.0.7 types-cachetools==5.3.0.7
types-filelock==3.2.7 types-filelock==3.2.7
types-requests==2.31.0.20240406 types-requests==2.32.0.20240523
types-tabulate==0.9.0.20240106 types-tabulate==0.9.0.20240106
types-python-dateutil==2.9.0.20240316 types-python-dateutil==2.9.0.20240316

View File

@ -3,7 +3,7 @@
-r requirements-plot.txt -r requirements-plot.txt
# Required for freqai # Required for freqai
scikit-learn==1.4.2 scikit-learn==1.5.0
joblib==1.4.2 joblib==1.4.2
catboost==1.2.5; 'arm' not in platform_machine catboost==1.2.5; 'arm' not in platform_machine
lightgbm==4.3.0 lightgbm==4.3.0

View File

@ -2,7 +2,7 @@
-r requirements.txt -r requirements.txt
# Required for hyperopt # Required for hyperopt
scipy==1.13.0 scipy==1.13.1
scikit-learn==1.4.2 scikit-learn==1.5.0
ft-scikit-optimize==0.9.2 ft-scikit-optimize==0.9.2
filelock==3.14.0 filelock==3.14.0

View File

@ -2,11 +2,11 @@ numpy==1.26.4
pandas==2.2.2 pandas==2.2.2
pandas-ta==0.3.14b pandas-ta==0.3.14b
ccxt==4.3.27 ccxt==4.3.35
cryptography==42.0.7 cryptography==42.0.7
aiohttp==3.9.5 aiohttp==3.9.5
SQLAlchemy==2.0.30 SQLAlchemy==2.0.30
python-telegram-bot==21.1.1 python-telegram-bot==21.2
# can't be hard-pinned due to telegram-bot pinning httpx with ~ # can't be hard-pinned due to telegram-bot pinning httpx with ~
httpx>=0.24.1 httpx>=0.24.1
humanize==4.9.0 humanize==4.9.0
@ -14,7 +14,7 @@ cachetools==5.3.3
requests==2.32.2 requests==2.32.2
urllib3==2.2.1 urllib3==2.2.1
jsonschema==4.22.0 jsonschema==4.22.0
TA-Lib==0.4.28 TA-Lib==0.4.29
technical==1.4.3 technical==1.4.3
tabulate==0.9.0 tabulate==0.9.0
pycoingecko==3.1.0 pycoingecko==3.1.0
@ -53,7 +53,7 @@ python-dateutil==2.9.0.post0
pytz==2024.1 pytz==2024.1
#Futures #Futures
schedule==1.2.1 schedule==1.2.2
#WS Messages #WS Messages
websockets==12.0 websockets==12.0

View File

@ -45,7 +45,25 @@ EXCHANGES = {
"workingTime": 1674493798550, "workingTime": 1674493798550,
"fills": [], "fills": [],
"selfTradePreventionMode": "NONE", "selfTradePreventionMode": "NONE",
} },
{
"symbol": "SOLUSDT",
"orderId": 3551312894,
"orderListId": -1,
"clientOrderId": "x-R4DD3S8297c73a11ccb9dc8f2811ba",
"transactTime": 1674493798550,
"price": "15.50000000",
"origQty": "1.10000000",
"executedQty": "1.10000000",
"cummulativeQuoteQty": "17.05",
"status": "FILLED",
"timeInForce": "GTC",
"type": "LIMIT",
"side": "BUY",
"workingTime": 1674493798550,
"fills": [],
"selfTradePreventionMode": "NONE",
},
], ],
}, },
"binanceus": { "binanceus": {
@ -288,6 +306,36 @@ EXCHANGES = {
"hasQuoteVolume": True, "hasQuoteVolume": True,
"timeframe": "1h", "timeframe": "1h",
"futures": False, "futures": False,
"sample_order": [
{
"symbol": "SOL-USDT",
"orderId": "1762393630149869568",
"transactTime": "1674493798550",
"price": "15.5",
"stopPrice": "0",
"origQty": "1.1",
"executedQty": "1.1",
"cummulativeQuoteQty": "17.05",
"status": "FILLED",
"type": "LIMIT",
"side": "BUY",
"clientOrderID": "",
},
{
"symbol": "SOL-USDT",
"orderId": "1762393630149869568",
"transactTime": "1674493798550",
"price": "15.5",
"stopPrice": "0",
"origQty": "1.1",
"executedQty": "1.1",
"cummulativeQuoteQty": "17.05",
"status": "FILLED",
"type": "MARKET",
"side": "BUY",
"clientOrderID": "",
},
],
}, },
} }

View File

@ -76,7 +76,8 @@ class TestCCXTExchange:
assert isinstance(po["timestamp"], int) assert isinstance(po["timestamp"], int)
assert isinstance(po["price"], float) assert isinstance(po["price"], float)
assert po["price"] == 15.5 assert po["price"] == 15.5
if po["average"] is not None: if po["status"] == "closed":
# Filled orders should have average assigned.
assert isinstance(po["average"], float) assert isinstance(po["average"], float)
assert po["average"] == 15.5 assert po["average"] == 15.5
assert po["symbol"] == pair assert po["symbol"] == pair