Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Order tab and time zone.

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

    Order tab and time zone.

    I think there might be a bug in time column on order tab in control center. Local time set to MT on charts however order execution time still shows CT. Or am I missing a setting?

    #2
    What time setting do strategies use? The one we set via tools options or CT always? I have configured times not to trade in settings.

    Comment


      #3
      Hello rocketstock,

      NinjaTrader uses the time zone that is setup at Control Center-->Tools-->Options-->General-->Time zone.

      Could it be you changed the Time zone setting, but you did not restart NinjaTrader?

      If you restart NinjaTrader and then perform a test order while connected to the Simulated Data Feed, does it show time as per the time zone selected?

      Comment


        #4
        Thanks I'll try that in the meanwhile this is the setting I have. I want to avoid holding a position so that initial and maintenance margin don't kick in.

        For long and short - only enter if time is before 2:29 MT or after 4:03 PM MT

        Times[Default input][0].TimeOfDay < new TimeSpan(14, 29, 0)
        Times[Default input][0].TimeOfDay > new TimeSpan(16, 3, 0)


        For close - close everything before 2:30 MT if any position are open account. Close all long and short between 2:29 and 2:30 MT

        Times[Default input][0].TimeOfDay >= new TimeSpan(14, 29, 0)
        Times[Default input][0].TimeOfDay <= new TimeSpan(14, 30, 0)
        Position.MarketPosition != MarketPosition.Flat

        Would these be correct to avoid any initial and maintenance margin?
        Last edited by rocketstock; 02-06-2022, 03:41 PM.

        Comment


          #5
          Hi rocket, Please confirm with your broker the exact times. The logic for the time filter is correct. You can also test to make sure the filter works by running the strategy over the Playback connection. There is also a built-in setting for the strategy called ExitOnSessionClose and ExitOnSessionClose seconds that will automatically close any open positions.

          Kind regards,
          -ChrisL

          Comment


            #6
            Thanks Chris. I will do that.

            Meanwhile I tried putting another time logic that wont compile the script. This is for not trading after Friday after market close 1:58 pm MT. Would you able to help?

            All conditions below need to meet to open position.

            Times[0][0].TimeOfDay.DayOfWeek != DayOfWeek.Friday
            Times[Default input][0].TimeOfDay < new TimeSpan(13, 58, 0)


            Comment


              #7
              Hi rocket, there is a full example of setting up a time filter here:



              The correct syntax for the snipped you posted is:
              if(Times[0][0].DayOfWeek != DayOfWeek.Friday
              && Times[0][0].TimeOfDay < new TimeSpan(13, 58, 0))
              {

              }

              Kind regards,
              -ChrisL

              Comment


                #8
                Hi Chris sorry forgot to mention. that was from strategy builder. I didnt code it. I'll try and make it look like yours in strategy builder. Thanks.

                Comment


                  #9
                  worked i needed to use date series in strategy builder instead of time.

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by argusthome, 03-08-2026, 10:06 AM
                  0 responses
                  88 views
                  0 likes
                  Last Post argusthome  
                  Started by NabilKhattabi, 03-06-2026, 11:18 AM
                  0 responses
                  48 views
                  0 likes
                  Last Post NabilKhattabi  
                  Started by Deep42, 03-06-2026, 12:28 AM
                  0 responses
                  30 views
                  0 likes
                  Last Post Deep42
                  by Deep42
                   
                  Started by TheRealMorford, 03-05-2026, 06:15 PM
                  0 responses
                  34 views
                  0 likes
                  Last Post TheRealMorford  
                  Started by Mindset, 02-28-2026, 06:16 AM
                  0 responses
                  68 views
                  0 likes
                  Last Post Mindset
                  by Mindset
                   
                  Working...
                  X