rainx / inside-zipline

深入了解zipline回测框架
399 stars 136 forks source link

zipline如何支持同时多个trading calendar呢? #2

Open geraybos opened 7 years ago

geraybos commented 7 years ago

比如说原来股指期货早15分钟开盘,晚15分钟收盘

应该是支持的,但是不知道怎么用

Karen Rubin Jun 17, 2016 Hi Everyone, We continue to work away on adding futures support to Quantopian. Last week we merged a big change to Zipline that enables support for multiple trading calendars. This is critical to allow for futures trading outside of NYSE market hours. We've also made great progress at ingesting futures data.

The next steps for the project are to work on building out the calendars for the CBOE, CME and ICE exchanges. Part of this will be solving problems around allowing algorithms to trade both equities and futures at the same time, and dealing with time management throughout the system.

We will be launching an alpha after this next phase is complete. You can sign up for it here, and also learn a little bit more (such as which contracts we plan to support).

rainx commented 7 years ago

如果真对单一的产品,比如都是股指期货,只是在某个日期之前或者之后的开盘收盘时间不一样,那么只用一个TradingCalendar即可,可以编写特定的逻辑,让这个TradingCalendar真对不同的日期,返回不同的当日的交易时间.. 比如 2016年2月1日之前的开收盘时间是10点到15点, 之后是 9点到15点,这种逻辑只要一个定制的TradingCalendar即可..

rainx commented 7 years ago

如果是真对不同的产品,比如同时支持股票和股指期货,如果是分别两次回测中,并且用两个独立的data bundle ,貌似比较容易,但是如果将股票和期货的数据放倒同一个data bundle 中,然后运行在同一个回测中, 貌似我还没有在当前的开源版本代码里看到比较可行的方式..也许还存在在某个分支中吧..