• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Strategy analyser EOD data are one day delayed

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

    Strategy analyser EOD data are one day delayed

    Hello, I would like to use strategy analyser for EOD data, but data set is different against chart. E.g. today 2018-08-30 before US market is open I can see in chart of any stocks e.g. AAPL yesterday OHLC - from 2018-08-29.
    But Strategy Analyser use dataset only until 2018-08-28 and not until 29th. Why? Is there any reason to delay EOD data for SA?

    #2
    Additionally I would say that method OnBarUpdate() is not called for latest bar, but latest only for bar -1 day.

    Comment


      #3
      Hello, Unlimited.

      Thank you for the post, and welcome to the NinjaTrader forum.

      What data feed are you connected to? I am able to run the MA Crossover strategy on the Kinetick EOD connection up to the 29th (yesterday). This was tested on the MSFT stock with the default session template.

      Could you please also post a screenshot of how your Strategy Analyzer is configured?

      I look forward to assisting further.
      Chris L.NinjaTrader Customer Service

      Comment


        #4
        Hello Chris,
        thank you for fast response. The parameters of test are follow:
        - I am connected on Kinetic EOD
        - Tested ticker is SO
        - SA settings see attachement, nothing special teher I would say.
        How did you recognize that your MA strategy was calculated up to 29th included?

        I have tested it like this:
        Code:
        protected override void OnBarUpdate()
        {
             if (BarsInProgress != 0) 
                  return;
        
             if (CurrentBars[0] < 1)
                  return;
        
             if (CurrentBar < BarsRequiredToTrade)
                  return;
        			
             Print("BarTime="+Time[0].ToString("dd/MM/yy"));
        And the latest output is:
        ...
        BarTime=27. 08. 18
        BarTime=28. 08. 18

        but the yesterday bar from 29.08.2018 is missing.

        Regards,
        Petr (Unlimited)
        Attached Files

        Comment


          #5
          Hello Unlimited,

          Thank you for the reply.

          The OnBarUpdate for the August 29th bar will not be called until the close of today's bar because the SA is not including the data for today, so the OnBarUpdate has not processed for yesterday. You will see the 29th printed when today's bar closes.

          Please let me know if I can assist further.
          Chris L.NinjaTrader Customer Service

          Comment


            #6
            Hello Chris again,

            I am sorry, I do not understand you at all. It is not only about SA. If I apply strategy in the chart then yesterday is not taken to account? Why?

            I understand that today data are not there, that is ok, we do not know close of today. But why strategy can't works with yesterday close as far as I am able to see it on the chart?

            If I can't use OnBarUpdate() method to get yesterday OHLC bar data, which method should I call instead?

            Thank you in advance for your advice.

            Regards,
            Petr.

            Comment


              #7
              Hello Petr,

              Thank you for the reply.

              The OnBarUpdate for a script will be called at the beginning of the next bar if the Calculate mode is set to OnBarClose. With the Kinetick EOD connection, we do not have a bar for today, yet. Since the bar for today has not technically opened for the EOD connection yet, we do not have an OnBarUpdate event for the 29th yet. There is no alternative method to OnBarUpdate. You will see the print for the 29th when today's bar closes, and you will not see the Print for today at that time either.

              Please let me know if I can assist further.
              Chris L.NinjaTrader Customer Service

              Comment


                #8
                Hi Chris,

                and what about Calculate.OnEachTick instead of Calculate.OnBarClose? Will solve my problem, do not think so?

                Because I have found related thread:
                https://ninjatrader.com/support/foru...ad.php?t=84696

                Regards,
                Petr.

                Comment


                  #9
                  Hello Petr,

                  Thanks for the reply.

                  You will see the 29th print when using Calculate.OnEachTick. Make sure to turn on Tick Replay to make this work.

                  Please let me know if I can assist further.
                  Chris L.NinjaTrader Customer Service

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by kokobeef, Today, 12:32 PM
                  2 responses
                  5 views
                  0 likes
                  Last Post kokobeef  
                  Started by StevenNelson, Today, 12:23 PM
                  0 responses
                  6 views
                  0 likes
                  Last Post StevenNelson  
                  Started by Jackrpo, Today, 11:14 AM
                  2 responses
                  9 views
                  0 likes
                  Last Post Jackrpo
                  by Jackrpo
                   
                  Started by DariusDeck, Yesterday, 04:22 PM
                  7 responses
                  49 views
                  0 likes
                  Last Post NinjaTrader_ChristopherJ  
                  Started by laszlonagy, Today, 09:28 AM
                  2 responses
                  10 views
                  0 likes
                  Last Post laszlonagy  
                  Working...
                  X