live.sh 移除 json配置文件里的 protection

This commit is contained in:
zhangkun9038@dingtalk.com 2025-09-11 00:09:06 +00:00
parent dcb91f3bed
commit 707b860cdc
2 changed files with 19 additions and 7 deletions

View File

@ -304,10 +304,10 @@ class FreqaiPrimer(IStrategy):
# 1h={'牛' if dataframe['trend_1h_ema'].iloc[-1] == 1 else '熊'}")
# 调试:打印指标值(最后 5 行),验证时间对齐
print(f"Pair: {metadata['pair']}, Last 5 rows after reindexing:")
print(dataframe[['date', 'close', 'bb_lower_3m', 'rsi_3m', 'rsi_15m', 'rsi_1h', 'trend_1h',
'trend_3m', 'trend_15m', 'trend_1h_ema', 'market_score', 'market_state',
'bullish_engulfing', 'volume', 'volume_ma']].tail(5))
#print(f"Pair: {metadata['pair']}, Last 5 rows after reindexing:")
#print(dataframe[['date', 'close', 'bb_lower_3m', 'rsi_3m', 'rsi_15m', 'rsi_1h', 'trend_1h',
# 'trend_3m', 'trend_15m', 'trend_1h_ema', 'market_score', 'market_state',
# 'bullish_engulfing', 'volume', 'volume_ma']].tail(5))
# 打印最终数据框的列名以验证
#logger.info(f"[{metadata['pair']}] 最终数据框列名: {list(dataframe.columns)}")
@ -587,9 +587,9 @@ class FreqaiPrimer(IStrategy):
if dynamic_roi_threshold < 0:
exit_ratio = 1.0
logger.info(f"[{pair}] 动态止盈: 持仓时间={trade_age_minutes:.1f}分钟, 当前利润={current_profit:.2%}, "
f"动态ROI阈值={dynamic_roi_threshold:.4f}, 利润比值={profit_ratio:.2f}, "
f"市场状态={current_state}, entry_tag={entry_tag}, 退出比例={exit_ratio:.0%}")
#logger.info(f"[{pair}] 动态止盈: 持仓时间={trade_age_minutes:.1f}分钟, 当前利润={current_profit:.2%}, "
# f"动态ROI阈值={dynamic_roi_threshold:.4f}, 利润比值={profit_ratio:.2f}, "
# f"市场状态={current_state}, entry_tag={entry_tag}, 退出比例={exit_ratio:.0%}")
return exit_ratio

View File

@ -236,6 +236,18 @@ merged_pairs=$(merge_and_deduplicate_pairs "$db_pairs" "$remote_pairs")
# 4. 更新配置文件
update_live_json_pair_whitelist "../config_examples/live.json" "$merged_pairs"
# 编辑 ../freqtrade/templates/${PARAMS_NAME}.json 文件,删除包含 "protection": {}, 的行
echo "正在编辑 ../freqtrade/templates/${PARAMS_NAME}.json 文件,删除 'protection': {} 行..." >&2
sed -i '/"protection": {},/d' "../freqtrade/templates/${PARAMS_NAME}.json"
if [ $? -eq 0 ]; then
echo "✅ 成功编辑 ../freqtrade/templates/${PARAMS_NAME}.json 文件" >&2
else
echo "❌ 编辑 ../freqtrade/templates/${PARAMS_NAME}.json 文件失败" >&2
exit 1
fi
### 启动容器 ###
GIT_COMMIT_SHORT=$(git rev-parse HEAD | cut -c 1-8)