重新下载不扣分,或者就改这一句。
前面track_back_market_temp(context)函数里,
这一句 elif market_height > 0.90: # 这里前面笔误写成0.80了
def track_back_market_temp(context):# 数据回滚两年判断市场温度
long_index300 = list(attribute_history('000300.XSHG', 220 * 3, '1d', ('close'), df=False)['close'])
g.market_temperature = 'cold'
for back_day in range(220, len(long_index300)):
index300 = long_index300[back_day - 220:back_day]
market_height = (mean(index300[-5:]) - min(index300)) / (max(index300) - min(index300))
if market_height < 0.20:
g.market_temperature = "cold"
elif market_height > 0.90: # 这里前面笔误写成0.80了
g.market_temperature = "hot"
elif max(index300[-60:]) / min(index300) > 1.20:
g.market_temperature = "warm"
2025-09-28