Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

Better practices to include checking the ^VIX for my strategy

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

  • NinjaTrader_Jesse
    replied
    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.

    Leave a comment:


  • 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?

Latest Posts

Collapse

Topics Statistics Last Post
Started by morrnel, 05-12-2024, 06:07 PM
8 responses
144 views
1 like
Last Post nobchi
by nobchi
 
Started by nobchi, Today, 01:05 AM
0 responses
2 views
0 likes
Last Post nobchi
by nobchi
 
Started by Skifree, 06-17-2024, 06:35 PM
3 responses
18 views
0 likes
Last Post Skifree
by Skifree
 
Started by sy2023, 09-15-2023, 08:51 PM
2 responses
234 views
0 likes
Last Post Crusade12  
Started by kiss987, 05-16-2018, 02:19 AM
14 responses
2,871 views
0 likes
Last Post bobperez  
Working...
X