This commit is contained in:
zhangkun9038@dingtalk.com 2025-05-14 00:46:36 +00:00
parent eb5e3dac23
commit 8d071d1ef6
5 changed files with 53 additions and 7 deletions

7
.gitignore vendored
View File

@ -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/

0
.gitignore.lock Normal file
View File

View File

@ -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

4
tools/download.sh Executable file
View File

@ -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

47
tools/gitpush.sh Executable file
View File

@ -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 "已恢复 .gitignoreresult/ 重新纳入版本控制"
fi
echo "Git push 完成"