Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Better practices to include checking the ^VIX for my strategy

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Better practices to include checking the ^VIX for my strategy

    Hello,

    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?

    #2
    Hello Don22Trader1,

    If you need the vix data you would have to include it as a secondary series like you have done.

    The order of your conditions for BarsInProgress don't matter, only 1 BarsInProgress calls OnBarUpdate at a time so whatever logic is surrounded by a BarsInProgress condition will be executed only if the correct BarsInProgress called OnBarUpdate.

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by abelsheila, Yesterday, 07:38 PM
    0 responses
    5 views
    0 likes
    Last Post abelsheila  
    Started by nailz420, Yesterday, 09:14 AM
    1 response
    38 views
    0 likes
    Last Post NinjaTrader_ChristopherJ  
    Started by NinjaTrader_Brett, 05-12-2025, 03:19 PM
    0 responses
    265 views
    0 likes
    Last Post NinjaTrader_Brett  
    Started by domjabs, 05-12-2025, 01:55 PM
    2 responses
    56 views
    0 likes
    Last Post domjabs
    by domjabs
     
    Started by Morning Cup Of Trades, 05-12-2025, 11:50 AM
    1 response
    59 views
    0 likes
    Last Post NinjaTrader_ChristopherJ  
    Working...
    X