趋势函数独立出来, 95分以上不退出
This commit is contained in:
parent
857e00bc19
commit
7aa9ebe55b
@ -127,7 +127,7 @@ class FreqaiPrimer(IStrategy):
|
|||||||
# 调试:打印指标值(最后 5 行)
|
# 调试:打印指标值(最后 5 行)
|
||||||
print(f"Pair: {metadata['pair']}, Last 5 rows:")
|
print(f"Pair: {metadata['pair']}, Last 5 rows:")
|
||||||
print(dataframe[['date', 'close', 'bb_lower_3m', 'rsi_3m', 'rsi_15m', 'rsi_1h', 'trend_1h',
|
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',
|
'trend_3m', 'trend_15m', 'market_score', 'market_state',
|
||||||
'bullish_engulfing', 'volume', 'volume_ma']].tail(5))
|
'bullish_engulfing', 'volume', 'volume_ma']].tail(5))
|
||||||
|
|
||||||
return dataframe
|
return dataframe
|
||||||
@ -305,7 +305,8 @@ class FreqaiPrimer(IStrategy):
|
|||||||
)
|
)
|
||||||
|
|
||||||
# 强劲趋势条件:1h趋势向上 + 熊牛得分>70
|
# 强劲趋势条件:1h趋势向上 + 熊牛得分>70
|
||||||
strong_trend = (dataframe['trend_1h_ema'] == 1) & (dataframe['market_score'] > 70)
|
# 使用EMA交叉来判断趋势,而不是不存在的trend_1h_ema列
|
||||||
|
strong_trend = (dataframe['ema_50_1h'] > dataframe['ema_200_1h']) & (dataframe['market_score'] > 70)
|
||||||
|
|
||||||
# 一般趋势条件:熊牛得分50-70
|
# 一般趋势条件:熊牛得分50-70
|
||||||
normal_trend = (dataframe['market_score'] >= 50) & (dataframe['market_score'] <= 70)
|
normal_trend = (dataframe['market_score'] >= 50) & (dataframe['market_score'] <= 70)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user