fix issue
This commit is contained in:
parent
971fc5bbde
commit
146d01af39
@ -27,6 +27,12 @@ class FreqaiPrimer(IStrategy):
|
||||
# 用于跟踪市场状态的数据框缓存
|
||||
_dataframe_cache = None
|
||||
|
||||
def __init__(self):
|
||||
"""初始化策略参数,调用父类初始化方法"""
|
||||
super().__init__() # 调用父类的初始化方法
|
||||
# 存储从配置文件加载的默认值
|
||||
self._trailing_stop_positive_default = 0.005
|
||||
|
||||
@property
|
||||
def trailing_stop_positive(self):
|
||||
"""根据市场状态动态调整跟踪止盈参数"""
|
||||
@ -37,7 +43,12 @@ class FreqaiPrimer(IStrategy):
|
||||
return 0.01 # 强劲牛市中放宽跟踪止盈
|
||||
elif current_state == 'weak_bull':
|
||||
return 0.007
|
||||
return 0.005 # 默认值
|
||||
return self._trailing_stop_positive_default # 返回默认值
|
||||
|
||||
@trailing_stop_positive.setter
|
||||
def trailing_stop_positive(self, value):
|
||||
"""设置trailing_stop_positive的默认值"""
|
||||
self._trailing_stop_positive_default = value
|
||||
|
||||
timeframe = "3m" # 主时间框架为 3 分钟
|
||||
can_short = False # 禁用做空
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user