Ok, as promised, I'll open up a bit about this strategy I'm attempting :-)
BTW: kudos to Jared who consolidated (more like completely overhauled) what I had originally put together!

Feast your eyes on this: http://www.tradingtheodds.com/2015/01/volatility-risk-premium-strategy-and-the-preliminary-outperformer-is/

My focus is on that green line. Essentially, we alternate going long on VIX (long VXX) when a certain metric is below "1" and going short on VIX (long XIV) when that metric is above "1".

The metric is defined as:


where VX1 | VX2 is the constant 30-day contract price of VIX futures as interpolated between VX1 and VX2 (some black magic here)
where HV2 is the historical volatility of the S&P 500 index as calculated by:

STDEV(LN(closeGSPC[0] / closeGSPC[1]), LN(closeGSPC[1] / closeGSPC[2])) * sqrt(252) * 100

where closeGSPC[0] is the close of GSPC today, closeGSPC[1] is the close of GSPC yesterday, closeGSPC[2] is the close of GSPC two days ago.

So this algorithm is intended to run well after the close of market, maybe even the morning of the next day before market opens, in order to ensure GSPC has been updated with the most up to date information.

Attached is the project so far. The To-Do list:

1.) Rework the calculation of VX1 and VX2. This involves:
---Replacing the current VIX source (which is currently reporting an aggregate of futures) with rolling volatility data that is brought in from an external source (dropbox, etc.)
---Replace the current VIX source with YAHOO/INDEX_VIX and replace the metric benchmark with "0" rather than "1" (this would give us the orange line in the graph above)