Skip to content

Continuous futures series with R

6 messages · Brian G. Peterson, Mark Breman, Whit Armstrong

#
Mark Breman wrote:
Mark,

I think the biggest issue is that the roll can happen on any number of 
different criteria.  Volume Cross, Midpoint Roll, Date (expiration-n) 
Roll, some other method, etc.  Also, any data provider that you're 
already paying for data (Bloomberg, Reuters, CQG, QAI, etc.) will 
already have one or more continuous series methods available, making the 
potential R code even less useful, and probably specific to one data 
provider. 

Another problem would be instrument/contract descriptors through time, 
though this seems minor, R does not yet have an instrument model for 
reference data, though we're working on that.

Can you be a little more explicit about what you are trying to do?  data 
source/provider, roll method, etc?

Regards,

    - Brian
#
if you have high quality data (i.e. no missing vol and oi data), then
the problem isn't difficult.

I'm not sure what the case is with IB, but quite a few futures data
providers have very spotty data then you have to write a lot of code
to deal with the bad data.

typical problems that I've seen from our data provider are:
1) future contracts that do not overlap in time
2) OI data that is missing for some or all contracts
3) OI data that is represented as the total OI for all contracts (but
appended to each contract)
4) contracts that were trading but not the active contract that have
data on holidays (but the active contract doesn't have this date).
This is a problem b/c to create the scratch space for the continuous
series the easiest way to calc the total rows is
unique(unlist(lapply(x,dates))), so you wind up with extra dates b/c
of the bad data.

I have a package for this that's not quite complete.  I'll post it to
github shortly.

-Whit
On Fri, Jul 31, 2009 at 7:45 AM, Mark Breman<breman.mark at gmail.com> wrote:
#
the roll code will eventually be moved to c++.

for now it just implements one roll policy, which is keep the current
contract active until expiration.

http://github.com/armstrtw/RCommodity/tree/master

-Whit
On Fri, Jul 31, 2009 at 9:09 AM, Mark Breman<breman.mark at gmail.com> wrote: