Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Can timezone used in time filters?

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

    Can timezone used in time filters?

    Hi fellow traders,

    I need to use a time filter in my strategy. However, the local machine is not set to the timezone of the instrument's exchange. I can use the local time and calculate the time difference carefully, but when it comes to daylight saving time, it is very painful that Europe, America, and Australia all have different dates of switch. I wonder if there is a way of using Exchange's timezone so that the code can be set and forget.

    Any input will be appreciated.

    #2
    Hello leizhenhua,

    Thanks for your reply.

    The only way to do this would be to set your PC time zone/clock to the exchanges time zone.

    Comment


      #3
      Originally posted by leizhenhua View Post
      Hi fellow traders,

      I need to use a time filter in my strategy. However, the local machine is not set to the timezone of the instrument's exchange. I can use the local time and calculate the time difference carefully, but when it comes to daylight saving time, it is very painful that Europe, America, and Australia all have different dates of switch. I wonder if there is a way of using Exchange's timezone so that the code can be set and forget.

      Any input will be appreciated.
      Convert all times, Time[0] et.c.,

      ref: https://msdn.microsoft.com/en-us/lib...(v=vs.90).aspx

      Comment


        #4
        I was going to mention that(change pc clock to local exchange), but in the case of multiple exchanges he's back in the same boat.

        Comment


          #5
          Thanks everyone for your input. It seems practically it'll have to be manually coded for different exchanges then.

          Comment


            #6
            Originally posted by leizhenhua View Post
            Thanks everyone for your input. It seems practically it'll have to be manually coded for different exchanges then.
            Does this help?

            Comment


              #7
              Originally posted by sledge View Post
              Thank you Sledge. I have tried custom session template, created one single session for Forex from 5pm Sun to 5pm Fri, set ExitOnClose=True, hoping the position only gets closed on Friday 5pm, not the other days. Unfortunately position still gets closed each day at 5pm. NinjaTrader team acknowledged this bug and working on it. No ETA, unsurprisingly.

              At this stage I reckon I have to deal with it myself and code it into my strategy.

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by Geovanny Suaza, 02-11-2026, 06:32 PM
              0 responses
              648 views
              0 likes
              Last Post Geovanny Suaza  
              Started by Geovanny Suaza, 02-11-2026, 05:51 PM
              0 responses
              369 views
              1 like
              Last Post Geovanny Suaza  
              Started by Mindset, 02-09-2026, 11:44 AM
              0 responses
              108 views
              0 likes
              Last Post Mindset
              by Mindset
               
              Started by Geovanny Suaza, 02-02-2026, 12:30 PM
              0 responses
              572 views
              1 like
              Last Post Geovanny Suaza  
              Started by RFrosty, 01-28-2026, 06:49 PM
              0 responses
              573 views
              1 like
              Last Post RFrosty
              by RFrosty
               
              Working...
              X