download.sh update

This commit is contained in:
zhangkun9038@dingtalk.com 2025-11-07 07:02:21 +08:00
parent 76126d4d81
commit f3a599c09c

View File

@ -1,7 +1,7 @@
#!/bin/bash
# Global default pairs list
default_pairs="BTC/USDT TON/USDT DOT/USDT XRP/USDT OKB/USDT SOL/USDT DOGE/USDT RIO/USDT LTC/USDT SUI/USDT PEPE/USDT TRB/USDT FIL/USDT UNI/USDT KAITO/USDT"
default_pairs="BTC/USDT TON/USDT DOT/USDT XRP/USDT OKB/USDT SOL/USDT DOGE/USDT WCT/USDT TRUMP/USDT SUI/USDT PEPE/USDT TRB/USDT MASK/USDT UNI/USDT KAITO/USDT"
# Function to extract the value of a parameter
get_param_value() {
@ -81,7 +81,8 @@ if [[ "$@" == *"--local-pairlist"* ]]; then
use_local_pairlist=true
fi
# Use default values if parameters are not provided
# Priority: --pairs > --local-pairlist > API > default
# If --pairs is provided, use it (highest priority)
if [[ -z "$pairs" ]]; then
if [[ "$use_local_pairlist" == true ]]; then
# 使用代码中定义的默认交易对列表
@ -133,7 +134,7 @@ print(' '.join(pairs) if pairs else '')
fi
if [[ -z "$timeframe" ]]; then
timeframe="3m,15m,30m,1h,4h,6h,12h,1d"
timeframe="3m,5m,15m,30m,1h,4h,6h,12h,1d"
fi
# Convert timeframe string to array
@ -141,13 +142,16 @@ IFS=',' read -r -a timeframe_array <<<"$timeframe"
timeframe_array_str=$(printf " '%s'" "${timeframe_array[@]}")
# Initialize the base command
cmd="docker-compose run --rm freqtrade download-data --config /freqtrade/config_examples/basic.json --pairs $pairs --timeframe$timeframe_array_str --days 50 --prepend"
cmd="docker-compose run --rm freqtrade download-data --config /freqtrade/config_examples/basic.json --pairs $pairs --timeframe$timeframe_array_str --prepend"
# Add timerange or days if provided
if [[ -n "$timerange" ]]; then
cmd+=" --timerange='$timerange'"
elif [[ -n "$days" ]]; then
cmd+=" --days=$days"
else
# Default to 50 days if neither timerange nor days is specified
cmd+=" --days 50"
fi
# Execute the command