November 18th, 2004, 11:57 am
If it's the actual gettign the data in that's your main question, then adamcox is right on the money. If you're more concerned with the rolling mechanism, that's a little harder. A few months back (at my old firm), I did some work in Java to do this exact sort of thing. It could get pretty complicated, one thing that definitely helped was working using an OO pattern rather than structued.So for example, we'd turn the data into TimeSeries objects - each futures contract would be a TimeSeries object. We then created a GenericTimeSeriesCreator, which would 'sew' all the series together based on another object you provided - a FuturesRollProvider object. The RollProvider simply told the creator which future contract to use when, and what adjustments to make (if we wanted to use continuation contracts). To start with we just had a LastTradeDateRollProvider, but we were able to create several subclasses of the RollProvider with different functionality (eg we would roll n business days before the back 1 contract volume exceeded the front contract, etc etc). In Java, using this approach is pretty striaghtforward, in VBA, it's not as easy, but certainly do-able (you'd have to use interfaces rather than inheritance). It really depends how sophisticated you want to get, and how good your VBA is.