This commit is contained in:
zhangkun9038@dingtalk.com 2025-05-27 22:38:52 +08:00
commit 8bab30cd31
7 changed files with 16691 additions and 2 deletions

8302
cctx/async_support/okx.py Normal file

File diff suppressed because it is too large Load Diff

8302
ccxt/async_support/okx.py Normal file

File diff suppressed because it is too large Load Diff

48
config_examples/live.json Normal file
View File

@ -0,0 +1,48 @@
{
"exchange": {
"name": "okx",
"key": "314e75b0-1113-47e8-ad01-1fca7e3c0496",
"secret": "9C8B170390F46EA6FB87592AD46F5A34",
"password": "nekFoylf:Om0",
"enable_ws": false,
"ccxt_config": {
"enableRateLimit": true,
"rateLimit": 500,
"options": {
"defaultType": "spot"
}
},
"ccxt_async_config": {
"enableRateLimit": true,
"rateLimit": 3000,
"timeout": 20000
},
"pair_whitelist": ["BTC/USDT", "ETH/USDT", "SOL/USDT", "DOT/USDT", "OKB/USDT", "TON/USDT"],
"pair_blacklist": []
},
"pairlists": [
{
"method": "StaticPairList"
}
],
"order_types": {
"entry": "market",
"exit": "market",
"stoploss": "limit",
"stoploss_on_exchange": false
},
"order_time_in_force": {
"entry": "gtc",
"exit": "gtc"
},
"entry_pricing": {
"price_side": "other",
"use_order_book": false,
"price_last_balance": 0.0
},
"exit_pricing": {
"price_side": "other",
"use_order_book": false
},
"fee": 0.0008
}

16
tools/dryrunloop.service Normal file
View File

@ -0,0 +1,16 @@
[Unit]
Description=Run dryrunloop.sh script daily
After=network.target
[Service]
Type=oneshot
ExecStart=/bin/bash /home/ubuntu/freqtrade/tools/dryrunloop.sh
WorkingDirectory=/home/ubuntu/freqtrade/tools
User=ubuntu
Group=ubuntu
# Ensure the script exits cleanly
SuccessExitStatus=0
[Install]
WantedBy=multi-user.target

10
tools/dryrunloop.sh Executable file
View File

@ -0,0 +1,10 @@
#!/bin/bash
# 动态获取昨天和明天的日期
START_DATE=$(date -d "yesterday" +"%Y%m%d")
END_DATE=$(date -d "tomorrow" +"%Y%m%d")
./download.sh --timerange $START_DATE-$END_DATE
# 执行 hyperopt 和 dryrun
./hyperopt.sh $START_DATE $END_DATE
./dryrun.sh

9
tools/dryrunloop.timer Normal file
View File

@ -0,0 +1,9 @@
[Unit]
Description=Run dryrunloop.sh daily at 8:05 AM
[Timer]
OnCalendar=*-*-* 08:05:00
Persistent=true
[Install]
WantedBy=timers.target

View File

@ -73,17 +73,19 @@ GIT_COMMIT_SHORT=$(git rev-parse HEAD | cut -c 1-8)
echo "docker-compose run -d --rm --name freqtrade-dryrun-${GIT_COMMIT_SHORT} -p 8080:8080 freqtrade trade \
--logfile /freqtrade/user_data/logs/freqtrade.log \
--db-url sqlite:////freqtrade/user_data/tradesv3.sqlite \
--freqaimodel LightGBMRegressor \
--freqaimodel LightGBMRegressorMultiTarget \
--fee 0.0008
--config /freqtrade/config_examples/$CONFIG_FILE \
--config /freqtrade/config_examples/live.json \
--strategy $STRATEGY_NAME \
--strategy-path /freqtrade/templates"
docker-compose run -d --rm --name freqtrade-dryrun-${GIT_COMMIT_SHORT} -p 8080:8080 freqtrade trade \
--logfile /freqtrade/user_data/logs/freqtrade.log \
--db-url sqlite:////freqtrade/user_data/tradesv3.sqlite \
--freqaimodel LightGBMRegressor \
--freqaimodel LightGBMRegressorMultiTarget \
--fee 0.0008 \
--config /freqtrade/config_examples/$CONFIG_FILE \
--config /freqtrade/config_examples/live.json \
--strategy $STRATEGY_NAME \
--strategy-path /freqtrade/templates