Calendar Spread Generator I wrote in R (open source!)

Joined
6/6/08
Messages
1,194
Points
58
Hey guys...WIP here that I put together on my downtime. (It's actually better than the one I wrote at my last gig).

Anyhow, what happens is this: it's currently written to work using the futures months notation (F, G, H, J, K, M, N, Q, U, V, X, Z) but it takes in a csv with the product name, traded months, how many front months you want (though it's written generally enough to roll any type of futures contract, though that functionality isn't implemented yet), and how many months ahead for each front month you want.

So it takes the input file, and generates the output file.

futuresRolling.csv is the input
futuresRolling.R is the code
futuresRollingResults.csv is the output

Hopefully someone gets some use out of it =)

Other than that, constructive criticism is always good.
 

Attachments

Back
Top