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

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 sidlercom80, 10-28-2023, 08:49 AM
                  172 responses
                  2,279 views
                  0 likes
                  Last Post sidlercom80  
                  Started by Irukandji, Yesterday, 02:53 AM
                  2 responses
                  17 views
                  0 likes
                  Last Post Irukandji  
                  Started by adeelshahzad, Today, 03:54 AM
                  0 responses
                  4 views
                  0 likes
                  Last Post adeelshahzad  
                  Started by Barry Milan, Yesterday, 10:35 PM
                  3 responses
                  13 views
                  0 likes
                  Last Post NinjaTrader_Manfred  
                  Started by WeyldFalcon, 12-10-2020, 06:48 PM
                  14 responses
                  1,431 views
                  0 likes
                  Last Post Handclap0241  
                  Working...
                  X