Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

VIX daily chart using Kinetic connection

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

    VIX daily chart using Kinetic connection

    Hi all,

    I am running a couple of strategies using same structure.

    Add(PeriodType.Minute,1440);
    Add("^VIX",PeriodType.Day,1);

    Main chart is based on 1 minute data and there are two others sources needed to run strategies: 1440 min chart and VIX daily chart. The VIX data is checked as follow several times along the script:

    if (Closes[2][0] <= 20.00)
    {
    contratos = 1;
    compra = 70.0;
    ganancias = 110.0;
    stopGanancias= 90.0;
    stopLoss= 45.0;

    }

    else if ((Closes[2][0] > 30.00) && (Closes[2][0] <= 59.00))
    {
    contratos = 1;
    compra = 25.0;
    ganancias = 140.0;
    stopGanancias= 95.0;
    stopLoss= 10.0;

    }
    To load VIX data I use kinetic connection and update vix chart every day. Supposedly, once chart has been uptdated and last data loaded it should be used as data entrance ( Closes[2][0]) for next session. But I have noticed that strategies not always works with previous session VIX data. By the way, using strategy analyzer...Strategies got VIX data as should.
    My question is how should I chart VIX daily chart using kinetic connection to get last session VIX data?

    Regards,

    Fernando

    #2
    Hello Fernando,

    Thank you for your post.

    So you are receiving the current day's values in realtime when you wish to pull the prior day's?

    Can you provide a code example that details what you are seeing?

    Comment


      #3
      Hello Patrick,

      I am just using last session close price for VIX, so I just need VIX data in a daily basis. Depending on that value strategies loaded a different set of parameters. See script:

      if (Closes[2][0] <= 20.00)
      {
      contratos = 1;
      compra = 70.0;
      ganancias = 110.0;
      stopGanancias= 90.0;
      stopLoss= 45.0;

      }

      else if ((Closes[2][0] > 30.00) && (Closes[2][0] <= 59.00))
      {
      contratos = 1;
      compra = 25.0;
      ganancias = 140.0;
      stopGanancias= 95.0;
      stopLoss= 10.0;

      }
      Closes[2][0] is VIX last session price.

      Other charts needed use real time data provided by my broker. However because I only need last session price data for VIX and I did not want to pay for VIX real time data. I thought I could upload VIX chart right after VIX close session using kinetic end of day connection. Of course, it should be done every day. Dou you think it could work?

      Regards,

      Fernando

      Comment


        #4
        Hello Fernando,

        Thank you for your response.

        That would work the last closed session.

        Comment


          #5
          Hello Patrick,

          How should I do it:

          1-. Close and load VIX chart every day after end of session.
          2-. Update chart date data and then "update all historical data"??.

          I have tried both but strategies do not get the last close session VIX value. Any idea?

          Regards,

          FErnando

          Comment


            #6
            Hello Fernando,

            Thank you for your response.

            If you are using an End Of Day feed for the Daily data of your VIX (such as Kinetick EOD) then you would need to wait until after the session close to reload your historical data on the chart. You would also need to ensure the End Of Day feed is connected first in NinjaTrader.

            Closes[barsInProgress index][0] would not pull the most recent closed Daily bar on CalculateOnBarClose = true. It needs the next bar's close before it will see this bar as closed. This means you need to run CalculateOnBarClose = false.

            Comment


              #7
              Hello Patrick,


              Where should calculateOnbarClose = False run?. In strategies configuration or directly in Initialize in strategies script.

              Regards,

              Fernando

              Comment


                #8
                Hello Fernando,

                You can set CalculateOnBarClose in the UI or you can hard code the value in Initialize().
                For information on CalcualteOnBarClose please visit the following link: http://ninjatrader.com/support/helpG...onbarclose.htm

                Please let me know if you have any questions.

                Comment


                  #9
                  Hello Patrick,

                  What do you mean by UI and where is set??

                  Regards,

                  Fernando

                  Comment


                    #10
                    Hello azunal,

                    This is set in the Strategy parameters when enabling or testing the strategy. The UI refers to the User Interface.

                    Comment

                    Latest Posts

                    Collapse

                    Topics Statistics Last Post
                    Started by Skifree, Today, 03:41 AM
                    3 responses
                    12 views
                    0 likes
                    Last Post Skifree
                    by Skifree
                     
                    Started by traderqz, Yesterday, 09:06 AM
                    5 responses
                    32 views
                    0 likes
                    Last Post NinjaTrader_Jesse  
                    Started by guillembm, Today, 11:25 AM
                    1 response
                    5 views
                    0 likes
                    Last Post NinjaTrader_Jesse  
                    Started by owensd, 04-21-2024, 11:34 PM
                    9 responses
                    34 views
                    0 likes
                    Last Post NinjaTrader_Gaby  
                    Started by trilliantrader, 04-10-2024, 09:33 PM
                    7 responses
                    25 views
                    0 likes
                    Last Post NinjaTrader_BrandonH  
                    Working...
                    X