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

Use of te VIX close in a script

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

    Use of te VIX close in a script

    I want to use the VIX close within a script. I was told to use the Add() indicator to bring it in (initialize it).

    I have a several question on how to do this:
    1. I wrote: Add("VIX 12-13", PeriodType.Day, MarketDataType.current.Close);
    However, this does not look write to me.
    2. How will the script differentiate between this close and the Market "close" I am in?
    Looks to me I ought to define the VIX close uniquely somehow.
    3. the calculation I want to do is as follows (not correct per C#):
    round((((settle-(((VIX*currentClose)*SQRT((1/252)))*0.382)))/0.25),0)*0.25
    Where "VIX" is the VIX Close and the "currentClose" is the current Market I am doing the calculation for (ES in this case).

    I could not find anything about "currentClose" in the Ninja User Manual.
    Any help is appreciated.

    #2
    Hello randl,

    Thank you for your post.

    The Add() would actually look like the following:
    Code:
    Add("VIX 12-13", PeriodType.Day, 1);
    You will need to use Closes to differentiate between the two bar series closes:
    I recommend reviewing the material covered at the following link for multiple time frame and instruments at the following link: http://www.ninjatrader.com/support/h...nstruments.htm

    I am not sure what settle is but the rest of the calculation would look like this:
    Code:
    double randl = Math.Round(((((Closes[1][0]*Closes[0][0])*Math.Sqrt(1/252))*0.382)/0.25)*0.25);
    Please let me know if I may be of further assistance.

    Comment


      #3
      Originally posted by randl View Post
      I want to use the VIX close within a script. I was told to use the Add() indicator to bring it in (initialize it).

      I have a several question on how to do this:
      1. I wrote: Add("VIX 12-13", PeriodType.Day, MarketDataType.current.Close);
      However, this does not look write to me.

      Any help is appreciated.
      Where are you subscribed to VIX futures?! My broker won't offer it with ZenFire. Very hard to come by.

      Mine is identified as an index in NT, ^VIX ... mapped to TDA $VIX.X..

      So I simply use:
      Code:
      	Add("^VIX",    PeriodType.Minute, 1);

      Comment


        #4
        Sledge, Thanks for the reply. I get the IQfeed. It brings all the sentiment indexes with the basic feed.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by alifarahani, Today, 09:40 AM
        6 responses
        39 views
        0 likes
        Last Post alifarahani  
        Started by Waxavi, Today, 02:10 AM
        1 response
        18 views
        0 likes
        Last Post NinjaTrader_LuisH  
        Started by Kaledus, Today, 01:29 PM
        5 responses
        15 views
        0 likes
        Last Post NinjaTrader_Jesse  
        Started by Waxavi, Today, 02:00 AM
        1 response
        12 views
        0 likes
        Last Post NinjaTrader_LuisH  
        Started by gentlebenthebear, Today, 01:30 AM
        3 responses
        17 views
        0 likes
        Last Post NinjaTrader_Jesse  
        Working...
        X