SmartQuant Discussion

add Open Interest to UserProvider
Page 1 of 1

Author:  truebilly [ Tue Jan 03, 2012 6:06 am ]
Post subject:  add Open Interest to UserProvider

hi, in building a custom market data provider, I could not find a way to send Open Interest data to OQ. Neither EmitNewBar nor EmitNewTrade has an OpenInt parameter. Also, in data import-CSV or Text files feature, only bar data contains OpenInt field, that makes it difficult to keep track of the change in Open Interest with every trade.

My suggestion is to add OpenInt parameter to EmitNewTrade/EmitNewBar, and to add an OpenInt field to Trade class, so the change in open interst could be recorded on every trade. Thanks!

Author:  Dr. Anton Fokin [ Tue Jan 03, 2012 3:30 pm ]
Post subject:  Re: add Open Interest to UserProvider


a Trade object doesn't have OpenInt field, but it's possible to add it to EmitNewBar function.


Author:  truebilly [ Wed Jan 04, 2012 10:16 am ]
Post subject:  Re: add Open Interest to UserProvider

Thanks for the reply, Anton.

It's true that Trade object doesn't contain OpenInt field, but we know that in futures trading, Open Interest changes with every trade, right? So it would be reasonable to add the OpenInt field to Trade class, especially for high-frequency trading. Moreover, in CompressBars method, Bar.OpenInt could be generated from Trade.OpenInt just like O/H/L/C from trade.Price.

To sum up, the advantages of storing OpenInt in Trades:

1. Precise tracking Open Interest changes in high-frequecy trading.
2. If we can only store OpenInt in Bar objects, when we use CompressBars method to generate a BarSeries with durations different from the existing ones, it's difficult to get the new BarSeries's OpenInt values. But if we store OpenInt in Trades, it's easy to generate Bar.OpenInt from Trade.OpenInt.
3. If we can only use EmitBars to send OpenInt, when multiple BarSeries are added to a strategy, we need to generate different BarSeries and emit multiple bars in custom providers.

I understand that doing this needs much more consideration since Trade class is a basis for many other classes. So it's just a little wish :D

Author:  BlueSky [ Wed Jan 04, 2012 5:06 pm ]
Post subject:  Re: add Open Interest to UserProvider

open interest represents the total outstanding contracts open from one session to the next, so adding it to trade data makes no sense - it is always reported with a day's lag.

Page 1 of 1 All times are UTC + 3 hours
Powered by phpBB® Forum Software © phpBB Group