[R-SIG-Finance] Generating a front month only Time Series for Futures Prices

gussinsky sduve at hotmail.com
Thu May 3 22:07:11 CEST 2012


Hey Garrett, 

thank you for this, I had a read through this page in the book you
referenced. And looking at Agricultural Commodities this makes a lot of
sense. And if you look at Wheat and Corn on the CBOT, I think you only have
5 deliveries per year, hence the massive gaps when each contract rolls off.
So here the interpolation makes sense, and I think one could approach this
trade as a box.

But lets consider for example heating oil again, here you have monthly
deliveries, and the seasonality is far less nowadays, in Europe even less
due to the increased Diesel consumption on the roads. 

But lets consider this:

"Trading in a current month shall cease on the last business day of the
month preceding the delivery month."

This is the expiry rule for Heating Oil on the Nymex. I think this is
codeable without minefields isn't it. It would be terrific if anyone could
point me in the right direction on how to approach this.

I think it wont be possible to download this with one simple function. I
suspect one would have to store individual files for the respective expiry
contracts, and perhaps index the file names. And then perhaps through a loop
function could read out the corresponding 1:n values for each month, store
them in an array, and then run the next month with the same rule, and store
them again, etc....In the end one needs to connect all those arrays into one
big time series.

And here is my problem, I dont know how to code this, I know what I want....

Many thanks for the advice so far....


Best


Gussinsky


PS: Garrett, it is your Pair Trading code that brought this up my mind again
:-)

--
View this message in context: http://r.789695.n4.nabble.com/Generating-a-front-month-only-Time-Series-for-Futures-Prices-tp4606794p4606979.html
Sent from the Rmetrics mailing list archive at Nabble.com.



More information about the R-SIG-Finance mailing list