让gemini给我优化了一版rl+1

This commit is contained in:
zhangkun9038@dingtalk.com 2026-02-18 10:21:26 +08:00
parent d8a6b374a5
commit f671f16574
2 changed files with 6 additions and 3 deletions

View File

@ -1,7 +1,7 @@
---
services:
freqtrade:
image: freqtradeorg/freqtrade:develop_freqai_withredis
image: freqtrade:rl
# image: freqtradeorg/freqtrade:develop
# Use plotting image
# image: freqtradeorg/freqtrade:develop_plot

View File

@ -78,8 +78,11 @@ class FreqaiPrimer(IStrategy):
dataframe["%-volume_change"] = dataframe["volume"].pct_change().fillna(0)
dataframe["%-price_volume_corr"] = dataframe["close"].rolling(10).corr(dataframe["volume"]).fillna(0)
# 3. 价格偏离特征
dataframe["%-bb_position"] = (dataframe["close"] - dataframe["bb_lower_1h"]) / (dataframe["bb_upper_1h"] - dataframe["bb_lower_1h"])
# 3. 价格偏离特征 - 直接计算布林带而不依赖外部列
bbands = ta.bbands(dataframe['close'], length=20, std=2)
dataframe["%-bb_upper"] = bbands['BBU_20_2.0']
dataframe["%-bb_lower"] = bbands['BBL_20_2.0']
dataframe["%-bb_position"] = (dataframe["close"] - dataframe["%-bb_lower"]) / (dataframe["%-bb_upper"] - dataframe["%-bb_lower"])
dataframe["%-hl_ratio"] = (dataframe["high"] - dataframe["low"]) / dataframe["close"]
# 4. VWAP 特征 (简化版)