wondertrader / wtpy

wtpy是基于wondertrader为底层的针对python的子框架
MIT License
816 stars 231 forks source link

hft使用过程中发现两个问题 #142

Open puddingsmall opened 1 month ago

puddingsmall commented 1 month ago

问题1. on_session_end 中 context.user_save_data 不能写入到本地 image

问题2. 订阅的 K线和ticks, on_bar 和 on_tick 函数都能正常回调, 但在on_bar中使用context.stra_get_ticks 返回 None

wtpy = 0.9.8

puddingsmall commented 1 month ago

问题3. 发生主力切换时发现on_init 和 on_session_begin 获取的主力合约代码不一致 image

puddingsmall commented 1 month ago

问题4. 是个老问题,hft on_sesson_end有概率不触发,解决方案是增加订阅一个国债主力期货

puddingsmall commented 1 month ago

问题5. 严格来说不算是问题,但是需要注意,hft 8.59 报单会被过滤掉实际并没有报出去, 但如果是20.59报单,会报出去,然后返回一个撤单回报

puddingsmall commented 1 month ago

问题1 补充一下不止on_session_end, 所有非交易时间使用 user_save_data好像实际都不会写入本地, 2024.05.25 04:00:10 触发hft on_channel_lost 但实际也没有写入本地,这个很容易出问题有些信息会遗失