From 29c236a6a5eec0ef1c4ecc08a0cce377b4084203 Mon Sep 17 00:00:00 2001 From: "zhangkun9038@dingtalk.com" Date: Wed, 28 May 2025 10:48:02 +0000 Subject: [PATCH] =?UTF-8?q?=E6=8A=8Aokx=E7=9B=B8=E5=85=B3=E9=85=8D?= =?UTF-8?q?=E7=BD=AE=E6=8A=BD=E7=A6=BB=E5=87=BA=E6=9D=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config_examples/freqaiprimer.json | 42 ----------------------------- config_examples/okx.json | 44 +++++++++++++++++++++++++++++++ tools/backtest.sh | 2 ++ tools/download.sh | 2 +- tools/dryrun.sh | 2 ++ tools/hyperopt.sh | 1 + 6 files changed, 50 insertions(+), 43 deletions(-) create mode 100644 config_examples/okx.json diff --git a/config_examples/freqaiprimer.json b/config_examples/freqaiprimer.json index 609c5437..7b51be59 100644 --- a/config_examples/freqaiprimer.json +++ b/config_examples/freqaiprimer.json @@ -23,48 +23,6 @@ "trailing_stop_positive_offset": 0.05, "trailing_only_offset_is_reached": true }, - "exchange": { - "name": "okx", - "key": "eca767d4-fda5-4a1b-bb28-49ae18093307", - "secret": "8CA3628A556ED137977DB298D37BC7F3", - "enable_ws": false, - "ccxt_config": { - "enableRateLimit": true, - "rateLimit": 500, - "options": { - "defaultType": "spot" - } - }, - "ccxt_async_config": { - "enableRateLimit": true, - "rateLimit": 500, - "timeout": 20000 - }, - "pair_whitelist": [ - "BTC/USDT", - "ETH/USDT", - "TON/USDT", - "OKB/USDT", - "DOT/USDT", - "SOL/USDT" - ], - "pair_blacklist": [] - }, - "entry_pricing": { - "price_side": "same", - "use_order_book": true, - "order_book_top": 1, - "price_last_balance": 0.0, - "check_depth_of_market": { - "enabled": false, - "bids_to_ask_delta": 1 - } - }, - "exit_pricing": { - "price_side": "other", - "use_order_book": true, - "order_book_top": 1 - }, "pairlists": [ { "method": "StaticPairList" diff --git a/config_examples/okx.json b/config_examples/okx.json new file mode 100644 index 00000000..30379283 --- /dev/null +++ b/config_examples/okx.json @@ -0,0 +1,44 @@ +{ + "exchange": { + "name": "okx", + "key": "eca767d4-fda5-4a1b-bb28-49ae18093307", + "secret": "8CA3628A556ED137977DB298D37BC7F3", + "enable_ws": false, + "ccxt_config": { + "enableRateLimit": true, + "rateLimit": 500, + "options": { + "defaultType": "spot" + } + }, + "ccxt_async_config": { + "enableRateLimit": true, + "rateLimit": 500, + "timeout": 20000 + }, + "pair_whitelist": [ + "BTC/USDT", + "ETH/USDT", + "TON/USDT", + "OKB/USDT", + "DOT/USDT", + "SOL/USDT" + ], + "pair_blacklist": [] + }, + "entry_pricing": { + "price_side": "same", + "use_order_book": true, + "order_book_top": 1, + "price_last_balance": 0.0, + "check_depth_of_market": { + "enabled": false, + "bids_to_ask_delta": 1 + } + }, + "exit_pricing": { + "price_side": "other", + "use_order_book": true, + "order_book_top": 1 + } +} diff --git a/tools/backtest.sh b/tools/backtest.sh index 41d6571e..40b92fb4 100755 --- a/tools/backtest.sh +++ b/tools/backtest.sh @@ -39,6 +39,7 @@ echo "docker-compose run --rm freqtrade backtesting \ --logfile /freqtrade/user_data/logs/freqtrade.log \ --freqaimodel LightGBMRegressorMultiTarget \ --config /freqtrade/config_examples/$CONFIG_FILE \ + --config /freqtrade/config_examples/okx.json \ --enable-protections \ --strategy-path /freqtrade/templates \ --strategy $STRATEGY_NAME \ @@ -51,6 +52,7 @@ docker-compose run --rm freqtrade backtesting \ --logfile /freqtrade/user_data/logs/freqtrade.log \ --freqaimodel LightGBMRegressorMultiTarget \ --config /freqtrade/config_examples/$CONFIG_FILE \ + --config /freqtrade/config_examples/okx.json \ --enable-protections \ --strategy-path /freqtrade/templates \ --strategy $STRATEGY_NAME \ diff --git a/tools/download.sh b/tools/download.sh index f79e545a..c7461d1f 100755 --- a/tools/download.sh +++ b/tools/download.sh @@ -87,7 +87,7 @@ timeframe_array_str=$(printf " '%s'" "${timeframe_array[@]}") echo "Initial pairs value: $pairs" # Initialize the base command -cmd="docker-compose run --rm freqtrade download-data --config /freqtrade/config_examples/basic.json --pairs $pairs --timeframe$timeframe_array_str" +cmd="docker-compose run --rm freqtrade download-data --config /freqtrade/config_examples/basic.json --config okx.json --pairs $pairs --timeframe$timeframe_array_str" # Add timerange or days if provided if [[ -n "$timerange" ]]; then diff --git a/tools/dryrun.sh b/tools/dryrun.sh index 9d251d7e..b531dc58 100755 --- a/tools/dryrun.sh +++ b/tools/dryrun.sh @@ -75,6 +75,7 @@ echo "docker-compose run -d --rm --name freqtrade-dryrun-${GIT_COMMIT_SHORT} -p --db-url sqlite:////freqtrade/user_data/tradesv3.sqlite \ --freqaimodel LightGBMRegressorMultiTarget \ --config /freqtrade/config_examples/$CONFIG_FILE \ + --config /freqtrade/config_examples/okx.json \ --strategy $STRATEGY_NAME \ --fee 0.0008 \ --strategy-path /freqtrade/templates" @@ -84,6 +85,7 @@ docker-compose run -d --rm --name freqtrade-dryrun-${GIT_COMMIT_SHORT} -p 8080:8 --db-url sqlite:////freqtrade/user_data/tradesv3.sqlite \ --freqaimodel LightGBMRegressorMultiTarget \ --config /freqtrade/config_examples/$CONFIG_FILE \ + --config /freqtrade/config_examples/okx.json \ --strategy $STRATEGY_NAME \ --fee 0.0008 \ --strategy-path /freqtrade/templates diff --git a/tools/hyperopt.sh b/tools/hyperopt.sh index 5fac959b..bf175531 100755 --- a/tools/hyperopt.sh +++ b/tools/hyperopt.sh @@ -49,6 +49,7 @@ docker-compose run --rm freqtrade hyperopt \ --freqaimodel LightGBMRegressor \ --strategy $STRATEGY_NAME \ --config /freqtrade/config_examples/$CONFIG_FILE \ + --config /freqtrade/config_examples/okx.json \ --eps \ --strategy-path /freqtrade/templates \ --timerange ${START_DATE}-${END_DATE} \