等级: 标准版
- 注册:
- 2023-2-16
- 曾用名:
|
start_date, end_date这两个参数应该怎么填
我用history_bars取出datetime作为一个start_date,context.now作为end_date
比如:20240108150000.0
start_t = pd.to_datetime(pd.Series([20240108150000.0]).astype(np.int64).astype(str),format='%Y%m%d%H%M%S')[0]
end_t = context.now //2024.01.09 09:31:00
newData = history_bars_date(order_book_id=self.name,start_date = start_t,end_date = end_t,frequency='self',fields=['datetime','open','high','low','close','volume','total_turnover'], skip_suspended=True, include_now=True, adjusted_price=False)
print([start_t,current_time,len(newData)])
为什么打印出来的结果是(回测周期是1分钟):
[Timestamp('2024-01-08 15:00:00'), datetime.datetime(2024, 1, 9, 9, 31), 3796]
为什么len(newData)=3796,什么地方出的错,谢谢
|
|