Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Data question

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

    Data question

    Hi,

    I am migrating a strategy from TradeStation to NinjaTrader and am trying to match up the executions to verify I have done the conversion correctly.

    I am getting very different executions (which doesn't surprise me) but then I noticed one of the reasons. TradeStation closes a 60 minute bar on the hour but NinjaTrader closes it on the half hour (for the ES).

    How (can) I force NinjaTrader to use bars that close on the hour (for a 60 minute bar)? I have already changed the template to the CME Index Futures ETH to no avail.

    Best Regards,
    Scott

    #2
    Hi Scott,

    This is based on the session start time. You would have to create your own session template that starts on the hour rather than the half hour.
    Ryan M.NinjaTrader Customer Service

    Comment


      #3
      Thanks Ryan, is there any trick to that or is the documentation pretty clear on that point (of course, I know the documentation is clear on every point)?

      Scott

      Comment


        #4
        It's pretty straightforward. I would look at the existing templates to see how they're constructed and see the following link if you're looking for additional help creating one.
        Ryan M.NinjaTrader Customer Service

        Comment


          #5
          Perfect, thanks so much!

          Comment


            #6
            I spoke too soon. I added a template that starts at 12 am and goes through 12 am the next day (Sunday 6pm - 12 am). All that worked as expected.

            However, I still get bars ending on the 1/2 hour instead of the hour. This is for the ES and the change from hour to 1/2 hour appears to happen after the 1730 (Eastern) close.

            Any suggestions.

            Best Regards,
            Scott
            Last edited by ScottB; 02-22-2011, 03:47 PM.

            Comment


              #7
              I'm not sure why you're seeing that. Tried with a few different session templates and it ended on the hour. The session template you listed is actually very close to the Default 24 / 7 built in.

              Did you apply this new session template to the chart? Right click > Data Series > make sure new session template is applied.

              If you're still seeing it end on half hour, can take a screenshot of your session template and i'll give it a try here.
              Ryan M.NinjaTrader Customer Service

              Comment


                #8
                I reloaded everything and now all is well. Who knows what I did wrong but alls well that ends well. Thanks for the help.

                Scott

                Comment


                  #9
                  Different strategy same issue - almost.

                  If I have a stratgey running on a 60 minute chart and then add a second data series that is daily. How do I line up the session template such that I get the close of the daily bar as well as the hourly bars lining up on the hour (see above - hourly bars lining up on the 1/2 hour)?

                  Best Regards,
                  Scott

                  Comment


                    #10
                    The time stamp of daily bars is based on the session template applied. For a multiseries script:

                    If the Bars object does not exist on the chart, the session template of the added Bars object will be the session template of the primary Bars object. If the primary Bars object is using the "<Use instrument settings>" session template then the additional Bars objects will use the default session templates as defined for their particular instrument in the Instrument Manager.
                    Ryan M.NinjaTrader Customer Service

                    Comment


                      #11
                      Thanks Ryan, one clarification - if the primary and the daily are both the same instrument using the instrument default session template, is it safe to assume if(BarsInProgress == 1)... with CalculateOnBarClose = true would get me the close of that day's bar if I use Closes[1][0] or would I need Closes[1][1]?

                      Comment


                        #12
                        It depends on whether you're accessing real time / historical and the relative time stamps between the two series. I find it's useful to print the time stamps of both series, so you can see how they relate.

                        if (BarsInProgress == 0)
                        Print("Primary Series: " + Time[0] + " Secondary Series: " + Times[1][0]);
                        Ryan M.NinjaTrader Customer Service

                        Comment


                          #13
                          Thank you Ryan, I will try that. Do you know off the top of your head if there is a template that ends on the hour but would still let me get the session closes regardless of when that particular bar ends?

                          For example I need a session template ends on the hour but would give me the 1615 ES close.

                          Thanks again.

                          Comment


                            #14
                            You can build a session template like this. The time stamp of bars is based on the start time of the session template + the interval used.

                            The end time of a session is the end time listed for that day.
                            Ryan M.NinjaTrader Customer Service

                            Comment


                              #15
                              That is perfect, thanks Ryan

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                              0 responses
                              630 views
                              0 likes
                              Last Post Geovanny Suaza  
                              Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                              0 responses
                              364 views
                              1 like
                              Last Post Geovanny Suaza  
                              Started by Mindset, 02-09-2026, 11:44 AM
                              0 responses
                              105 views
                              0 likes
                              Last Post Mindset
                              by Mindset
                               
                              Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                              0 responses
                              566 views
                              1 like
                              Last Post Geovanny Suaza  
                              Started by RFrosty, 01-28-2026, 06:49 PM
                              0 responses
                              568 views
                              1 like
                              Last Post RFrosty
                              by RFrosty
                               
                              Working...
                              X