diff --git a/.gitignore b/.gitignore index 5a54def1..e1bce99a 100644 --- a/.gitignore +++ b/.gitignore @@ -124,10 +124,5 @@ data/ !result/ output.log output_filted.log -result/backtest-result-2025-05-12_09-59-10_config.json -result/backtest-result-2025-05-12_09-59-10.json -result/backtest-result-2025-05-12_09-59-10.meta.json -result/backtest-result-2025-05-12_09-59-10_TheForceV7.py -result/output_filted.log --r + result/ diff --git a/.gitignore.lock b/.gitignore.lock new file mode 100644 index 00000000..e69de29b diff --git a/tools/backtest.sh b/tools/backtest.sh index ee3c5c0e..bbb9b790 100755 --- a/tools/backtest.sh +++ b/tools/backtest.sh @@ -19,7 +19,7 @@ freqtrade backtesting \ --timerange ${START_DATE}-${END_DATE} \ --breakdown week month \ --export trades \ - --fee 0.0008 \ + --fee 0.0016 \ --cache none >output.log 2>&1 sed -i 's/\x1B\[[0-9;]*m//g' output.log python3 filter.py diff --git a/tools/download.sh b/tools/download.sh new file mode 100755 index 00000000..d616b178 --- /dev/null +++ b/tools/download.sh @@ -0,0 +1,4 @@ +#!/bin/bash + +docker-compose run --rm freqtrade download-data --config /freqtrade/config_examples/basic.json --pairs BTC/USDT OKB/USDT OKB/BTC XRP/USDT --timeframe 5m 15m 30m 1h 4h 6h 12h 1d + diff --git a/tools/gitpush.sh b/tools/gitpush.sh new file mode 100755 index 00000000..7c6971a1 --- /dev/null +++ b/tools/gitpush.sh @@ -0,0 +1,47 @@ +#!/bin/bash + +#!/bin/bash + +# 默认提交信息 +commit_msg="update" + +# 解析命令行参数 -m 指定提交信息 +while getopts m: option; do + case "${option}" in + m) commit_msg=${OPTARG} ;; + esac +done + +cd .. + +# 检查 result/ 是否已经在 .gitignore 中 +IGNORED=$(grep -c "^result/" .gitignore) + +# 创建标志文件路径 +LOCK_FILE=".gitignore.lock" + +# 如果 result/ 不在 .gitignore 中,则临时加入,并记录 +if [ "$IGNORED" -eq 0 ]; then + echo "result/" >>.gitignore + echo "已临时将 result/ 添加到 .gitignore" + touch $LOCK_FILE +else + echo "result/ 已经在 .gitignore 中,跳过处理" +fi + +# 停止当前可能存在的交易进程(可选) +# pkill -f "freqtrade trade" || true + +# 执行 Git 操作 +git add . +git commit --no-verify -m "$commit_msg" +git push + +# 如果之前临时加入了 result/ 到 .gitignore,则现在恢复 +if [ -f "$LOCK_FILE" ]; then + sed -i '/^result\//d' .gitignore + rm -f $LOCK_FILE + echo "已恢复 .gitignore,result/ 重新纳入版本控制" +fi + +echo "Git push 完成"