去掉看底牌代码
Some checks are pending
Update Docker Hub Description / dockerHubDescription (push) Waiting to run

This commit is contained in:
zhangkun9038@dingtalk.com 2025-04-28 11:34:17 +08:00
parent a6ef1ce401
commit 6e4e54b9c8
2 changed files with 5 additions and 3 deletions

View File

@ -69,4 +69,4 @@ services:
--config /freqtrade/templates/FreqaiExampleStrategy.json
--strategy-path /freqtrade/templates
--strategy FreqaiExampleStrategy
--timerange 20240920-20250420
--timerange 20250320-20250420

View File

@ -112,7 +112,8 @@ class FreqaiExampleStrategy(IStrategy):
dataframe["%-volatility"] = dataframe["close"].pct_change().rolling(20).std()
# 单一回归目标
dataframe["&-buy_rsi"] = ta.RSI(dataframe, timeperiod=14).shift(-label_period)
# 移除对未来的数据依赖
dataframe["&-buy_rsi"] = ta.RSI(dataframe, timeperiod=14)
# 数据清理
for col in ["&-buy_rsi", "%-volatility"]:
@ -142,8 +143,9 @@ class FreqaiExampleStrategy(IStrategy):
# 生成 up_or_down 信号(非 FreqAI 目标)
label_period = self.freqai_info["feature_parameters"]["label_period_candles"]
# 使用历史数据生成 up_or_down 信号
dataframe["up_or_down"] = np.where(
dataframe["close"].shift(-label_period) > dataframe["close"], 1, 0
dataframe["close"] > dataframe["close"].shift(label_period), 1, 0
)
# 动态设置参数