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 CarlTrading, 03-31-2026, 09:41 PM
              1 response
              156 views
              1 like
              Last Post NinjaTrader_ChelseaB  
              Started by CarlTrading, 04-01-2026, 02:41 AM
              0 responses
              90 views
              1 like
              Last Post CarlTrading  
              Started by CaptainJack, 03-31-2026, 11:44 PM
              0 responses
              138 views
              2 likes
              Last Post CaptainJack  
              Started by CarlTrading, 03-30-2026, 11:51 AM
              0 responses
              130 views
              1 like
              Last Post CarlTrading  
              Started by CarlTrading, 03-30-2026, 11:48 AM
              0 responses
              107 views
              0 likes
              Last Post CarlTrading  
              Working...
              X