Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Ninja Trader clock

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

    Ninja Trader clock

    Hello, Ninja Trader clock not matching computer clock. NT one minute ahead of Computer clock. Computer clock matches correct time.. See image below. How do I make them match? Thanks.




    Click image for larger version

Name:	Clock.jpg
Views:	634
Size:	258.4 KB
ID:	1239442



    #2
    Hello,

    Thank you for your post.


    This is expected as the bars in NinjaTrader are time stamped for when the bar will close.

    For example with 1 minute bars as outlined in your screenshot it would be time stamped at 13:11 as this is when the bar closes and contains all the information from 13:10 to 13:10:59.


    I have also included a link to our NinjaTrader Help Guide on bar timestamps:
    Please let us know if we may be of any further assistance.

    Comment


      #3
      The problem arises when I have a time set for the order to be sent. the orders are being sent one minute before the time coded. Say if I have the condition like so: the orders were sent at 18:59.

      Code:
          
                  Calculate         = Calculate.OnEachTick;            
                  TimeOfEntry    = DateTime.Parse("19:00", System.Globalization.CultureInfo.InvariantCulture);
                  TrailPeriod    = 1;
                  TimeofEntrylmt = DateTime.Parse("19:15", System.Globalization.CultureInfo.InvariantCulture);
                  if ((CrossAbove(Close, Bollinger1.Upper, 1))
                       && (Times[0][0].TimeOfDay >= TimeOfEntry.TimeOfDay)
                       && (Times[0][0].TimeOfDay < TimeofEntrylmt.TimeOfDay))
                  {
                      EnterLong(10000, @"BBLE");
                  }​
      Last edited by designer01; 03-10-2023, 06:12 PM.

      Comment


        #4
        Hi designer01, to enter exactly at the minute you would need either offset 1 minute behind for the entry or you would need to run the strategy OnEachTick and enter of the very first tick of the 19:00 bar. We have a related example on how to do this here:



        Kind regards,
        -ChrisL​
        Last edited by NinjaTrader_ChrisL; 03-13-2023, 02:49 PM.

        Comment


          #5
          Hello, I am running the strategy OnEachTick. So maybe I need to set the entry time at 19:01 so it does not send the order at 18:59?
          The link provided is not working.

          Comment


            #6
            Hi, sorry I missed the OnEachTick setting you posted. Please confirm your conditions by using Print e.g.

            if ((CrossAbove(Close, Bollinger1.Upper, 1))
            && (Times[0][0].TimeOfDay >= TimeOfEntry.TimeOfDay)
            && (Times[0][0].TimeOfDay < TimeofEntrylmt.TimeOfDay))
            {
            Print(Times[0][0].TimeOfDay);
            Print(TimeOfEntry.TimeOfDay);
            Print(TimeofEntrylmt.TimeOfDay);
            EnterLong(10000, @"BBLE");
            }​

            I fixed the link to the example in my post above as well. ​

            Comment


              #7
              Hi ChrisL thank you. I am running the strategy OnEachTick and offset 1 minute behind for the entry. Seems to work ok.

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by argusthome, 03-08-2026, 10:06 AM
              0 responses
              65 views
              0 likes
              Last Post argusthome  
              Started by NabilKhattabi, 03-06-2026, 11:18 AM
              0 responses
              41 views
              0 likes
              Last Post NabilKhattabi  
              Started by Deep42, 03-06-2026, 12:28 AM
              0 responses
              23 views
              0 likes
              Last Post Deep42
              by Deep42
               
              Started by TheRealMorford, 03-05-2026, 06:15 PM
              0 responses
              26 views
              0 likes
              Last Post TheRealMorford  
              Started by Mindset, 02-28-2026, 06:16 AM
              0 responses
              52 views
              0 likes
              Last Post Mindset
              by Mindset
               
              Working...
              X