Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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.
    BrandonNinjaTrader Customer Service

    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 cmtjoancolmenero, 04-29-2024, 03:40 PM
              22 responses
              69 views
              0 likes
              Last Post cmtjoancolmenero  
              Started by reynoldsn, Yesterday, 04:40 PM
              2 responses
              12 views
              0 likes
              Last Post reynoldsn  
              Started by i2ogu3, Yesterday, 11:31 PM
              2 responses
              18 views
              0 likes
              Last Post i2ogu3
              by i2ogu3
               
              Started by llanqui, Today, 11:13 AM
              5 responses
              8 views
              0 likes
              Last Post NinjaTrader_Jesse  
              Started by llanqui, 04-28-2024, 10:32 AM
              10 responses
              39 views
              0 likes
              Last Post llanqui
              by llanqui
               
              Working...
              X