去掉看底牌代码
Some checks are pending
Update Docker Hub Description / dockerHubDescription (push) Waiting to run
Some checks are pending
Update Docker Hub Description / dockerHubDescription (push) Waiting to run
This commit is contained in:
parent
a6ef1ce401
commit
6e4e54b9c8
@ -69,4 +69,4 @@ services:
|
||||
--config /freqtrade/templates/FreqaiExampleStrategy.json
|
||||
--strategy-path /freqtrade/templates
|
||||
--strategy FreqaiExampleStrategy
|
||||
--timerange 20240920-20250420
|
||||
--timerange 20250320-20250420
|
||||
|
||||
@ -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
|
||||
)
|
||||
|
||||
# 动态设置参数
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user