I would like to know what are good practices when checking a daily bar chart of the ^VIX whilst trading the ES.
The data series in use are these:
-Primary data series : 30 Minute ES
-Secondary data series : 1 Tick ES (mainly for intra bar fills in back tests.)
I would like to include another data series, which is the ^VIX Daily Bar Chart. Within this data series I would like to create a bool that is set to true when its monthly EMA is greater than its yearly EMA, to imply greater volatility in the market.
Should I include the ^VIX as a tertiary data series within this strategy? I had an idea of writing some logic like this to make the bool true to allow for trading:
-----------------------------------------------------------------------------------
else if (State == State.Configure)
{
//primary data series is the 30 Minute
AddDataSeries(Data.BarsPeriodType.Tick, 1);
AddDataSeries("^VIX", Data.BarsPeriodType.Day, 1);
}
OnBarUpdate()
{
if (BarsInProgress == 2)
{
if (^VIXEMAMonthly > ^VIXEMAYearly)
{
highVolatility == true;
}
else if (^VIXEMAMonthly <= ^VIXEMAYearly)
{
highVolatility == false;
}
}
if (highVolatility == true)
{
//Rest of trading logic
}
}
-----------------------------------------------------------------------------------
Even though BIP 2 is a larger and different data series than the first two, would it be ok to check in this BIP first before all other BIPs and trading logic?
Comment