@通感 小市值的交易时间是周二,ETF是每天下午13点10分,时间过了就不会交易了,可以下周等等看,要么就是改一下代码最后面的每个策略的交易时间:
def after_code_changed(context):
unschedule_all()
if g.portfolio_value_proportion[0] > 0:
run_daily(prepare_small_cap_strategy, "9:05")
if g.check_defense and g.defense_signal is None:
check_defense_trigger(context)
if g.DBL_control:
run_daily(check_macd_divergence, "9:31")
run_weekly(strategy_1_sell, 2, "09:40")
run_weekly(strategy_1_buy, 2, "09:45")
run_daily(sell_small_cap_stocks, time="10:00")
# ATR止损价日常更新
if g.enable_atr_stop_loss:
run_daily(update_atr_stop_prices, "10:30")
run_daily(update_atr_stop_prices, "14:00")
if g.huanshou_check:
run_daily(check_small_cap_turnover, "10:30")
run_daily(check_small_cap_limit_up, "14:00")
if g.check_defense:
run_daily(check_defense_trigger, "14:50")
run_daily(close_account, "14:50")
# 策略2 ETF反弹策略
if g.strategy_ETF_2000_proportion > 0:
run_daily(capital_balance_2, "14:45")
run_daily(strategy_2_sell, "14:49")
run_daily(strategy_2_buy, "14:50")
# 策略3 五福闹新春 v3.5(与五福35.py 相同)
if g.portfolio_value_proportion[2] > 0:
if "morning_routine" not in globals() or "afternoon_routine" not in globals():
log.error("【五福35】缺少 morning_routine/afternoon_routine,请保留文件头部五福内嵌段。")
else:
log.set_level("system", "error")
log.set_level("strategy", "info")
run_daily(morning_routine, time="09:00")
# 【修改点】:不再区分纯净模式,强制在 13:10 执行
run_daily(afternoon_routine, time="13:10")
run_daily(reset_daily_flags, time="15:10")
run_daily(minute_level_stop_loss, time="every_bar")
run_daily(minute_level_pct_stop_loss, time="every_bar")
# 策略4 白马策略
if g.portfolio_value_proportion[3] > 0:
run_monthly(prepare_blue_chip_before_open, 1, time="9:30")
run_monthly(adjust_blue_chip_position, 1, time="10:40")
run_daily(make_record, "15:01")
run_daily(print_summary, "15:02")
2026-04-24