Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

processing top day data

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

    processing top day data

    Hello,

    Right now it is 5:20 PM EST and I am trying to run a backtest over the last year that includes the end date of the backtest of today's date (i.e. 6/12/2014). I have checked in the Historical Data Manager that I have correct data for today's trade date. However, when I set a breakpoint in my OnBarUpdate() method the last bar that I see come through is for 6/11. Is there some way I can have today's data processed in this backtest?

    Thanks!

    #2
    Hello upshot,

    Thanks for your post.

    Are you running this in the Strategy Analyzer?

    If you select the Chart tab in the backtest results, do you see today's data?

    Is your print inside of any branching commands (if statements)?
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Yes, I am running this in the Strategy Analyzer.

      Yes, when I select the Chart tab in the backtest results I do see today's data.

      No, there is no branching on my if statement. My OnBarUpdate method looks like this:

      protected override void OnBarUpdate()
      {

      Print(Time[0]);
      }

      I have the to / from set to 6/12/2013 - 6/12/2014. Output looks like this:

      .
      .
      .
      6/9/2014 1:00:00 PM
      6/10/2014 1:00:00 PM
      6/11/2014 1:00:00 PM
      Attached Files
      Last edited by upshot; 06-12-2014, 03:42 PM.

      Comment


        #4
        Hi upshot,

        Can I get the output from the Output window as well as a screenshot of the chart view?

        To send a screenshot press Alt + PRINT SCREEN to take a screen shot of the selected window. Then go to Start--> Accessories--> Paint, and press CTRL + V to paste the image. Lastly, save as a jpeg file and send the file as an attachment.

        For detailed instructions please visit the following link
        http://take-a-screenshot.org/
        Chelsea B.NinjaTrader Customer Service

        Comment


          #5
          Ok done. I attached the screenshot to my lst post (couldn't figure out how to attach it to this reply). Captured also in the image is the output window.

          Comment


            #6
            Hi upshot,

            I am not seeing any attachments with your first post.

            To add an attachment to a reply, click the Post Reply button at the top not the quick reply button within the post.

            Then click the paper clip icon to add a file.
            Chelsea B.NinjaTrader Customer Service

            Comment


              #7
              ok, here's the attachment. fyi, i should have been more clear...i attached the pic to the second post of mine.
              Attached Files

              Comment


                #8
                Hi Upshot,

                Thank you for the screenshot.

                I see that you are using a daily interval. It is expected that with a daily interval today's bar would not have a print because today's bar has not closed. After the end of the session you should get prints for that bar.
                Chelsea B.NinjaTrader Customer Service

                Comment


                  #9
                  Chelsea, thank you for taking a look at this.

                  The opening line of my original post is "Right now it is 5:20 PM EST". I am attaching a screencap to this post I'm making now in which you can see that the symbol I'm using (SFUN) is set to "US Equities RTH" session which has EST times of 9:30AM - 4:00 PM. In light of these facts I'm unsure how to interpret your reply because it is untrue that at 5:20 PM EST "today's bar has not closed". As of my initial post it was indeed "after the end of the session", so I "should get prints for that bar".
                  Attached Files

                  Comment


                    #10
                    Hi upshot,

                    When using a daily bar, the chosen session template is ignored. This is because Daily bars come fully formed from the data provider and you are not able to overwrite this.

                    Likely you have the RTH session template selected, but you are actually getting a ETH daily bar.

                    Who are you connected to for data?

                    If you open a 1440 Minute chart to the same instrument using the RTH template, does the chart look exactly the same?
                    Chelsea B.NinjaTrader Customer Service

                    Comment


                      #11
                      To answer your question, I connect to Kinetick for free daily EOD data. I no longer subscribe to minute data so I can't create a 1440 Minute chart.

                      I'm unsure how to interpret "the chosen session template is ignored" and "you are actually getting a ETH daily bar". It seems to me the important facts are:

                      1) It was 5:20 PM EST yesterday when I tried to run my strategy which is indeed after the market is closed
                      2) I had the 6/12 bar in my NT system as evidenced by the chart having this bar displayed
                      3) When running my strategy through Strategy Analyzer, 6/12 data was not being processed

                      Can you tell me why #3 is true? It's still not making sense to me why #3 is true or what time EST do I have to wait until in order to process top day daily data?

                      Thanks!

                      Comment


                        #12
                        Hello upshot,

                        Thanks for your reply.

                        With the Kinetick EOD daily bars actually close much later than the session close because this is not a real time data feed.

                        Also, the size of daily bars from Kinetick EOD will not change no matter what session template you apply.

                        However, I overlooked that you were using an equity and not a future in your screenshot. That was my mistake.

                        I would like you to try this:

                        After 4:15 PM today Eastern, open a chart with the SFUN instrument.
                        Right-click the chart and select Reload All Historical Data.
                        Then try the backtest again. Let me know if that does not correct the issue.
                        Chelsea B.NinjaTrader Customer Service

                        Comment


                          #13
                          Probably no need to wait until 4:15PM EST today as I still am unable to run Strategy Analyzer on 6/12 data. Below is a copy/paste of a test strategy. To run it I set values as shown in the attached screen cap and I'm running it on symbol SFUN. The way the source code is below I get no printout result. But if I uncomment out the line of code that currently has comments, I do get 'SFUN' printing to the console. It seems something is not working right on my box but I do not know what that might be. Any ideas?

                          public class MyTest : Strategy
                          {

                          protected override void Initialize()
                          {
                          CalculateOnBarClose = true;
                          }

                          protected override void OnBarUpdate()
                          {

                          DateTime dt = new DateTime(2014, 6, 12);
                          //dt = new DateTime(2014, 6, 11);

                          if (Time[0] < dt)
                          return;

                          Print(Instrument.FullName);

                          }

                          }
                          Attached Files

                          Comment


                            #14
                            Hi upshot,

                            I'd like to schedule a call with you to take a look at things.

                            Please send an email to support [at] ninjatrader [dot] com.

                            In the email please add a link to this forum thread.
                            Chelsea B.NinjaTrader Customer Service

                            Comment


                              #15
                              Hello All,

                              The issue here is that OnBarUpdate() does not trigger until a new bar begins to form.
                              This means that on a daily bar, OnBarUpdate() will trigger at the start of the new session.
                              Chelsea B.NinjaTrader Customer Service

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by gemify, 11-11-2022, 11:52 AM
                              6 responses
                              803 views
                              2 likes
                              Last Post ultls
                              by ultls
                               
                              Started by ScottWalsh, Today, 04:52 PM
                              0 responses
                              3 views
                              0 likes
                              Last Post ScottWalsh  
                              Started by ScottWalsh, Today, 04:29 PM
                              0 responses
                              7 views
                              0 likes
                              Last Post ScottWalsh  
                              Started by rtwave, 04-12-2024, 09:30 AM
                              2 responses
                              22 views
                              0 likes
                              Last Post rtwave
                              by rtwave
                               
                              Started by tsantospinto, 04-12-2024, 07:04 PM
                              5 responses
                              70 views
                              0 likes
                              Last Post tsantospinto  
                              Working...
                              X