Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Can't use time filter in different time zone

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

    Can't use time filter in different time zone

    My timezone is not (GMT-05:00), but (GMT+08:00). When I try to use:

    if
    ((ToTime(Time[0]) >= 230000) && (ToTime(Time[0]) <= 40000))


    which is equivalent to start trading 30 min after session open and stop 1 hour before session close, my strategy stop working after midnight.


    I tried to run SampleTimeFilter, but get zero trades as well.

    #2
    tjendra,

    A time filter does not care about time zones. It just looks at absolute time and as such trying to cross multiple days will not work for you like that. Your current condition would never be true. You can't be greater than 230000 and less than 40000 at the same time.

    You will need to come up with your own way to check times along with dates to allow you to go across midnight.
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      If I change my Windows time to be the same timezone as the US, does that solve all the timezone problems?

      Comment


        #4
        This would for sure simplify checks for you for US based products.

        Comment


          #5
          Hi Bertrand, when I change my window time to EST, all my charts go blank even though I adjust all the session opening and closing time to EST accordingly and reload historical data. Even the daily chart only show 1 bar. Why is that?
          Attached Files
          Last edited by tjendra; 03-26-2009, 06:37 AM.

          Comment


            #6
            You need to reload your historical data. Tools->Historical Data->Reload. Restart NT after your PC clock change too.
            Josh P.NinjaTrader Customer Service

            Comment


              #7
              When I use Tools->Historical Data->Reload, it seem like I have to choose individual instrument to reload? I have over 100 instrument where I need to reload, can I do it all at once? Also, I did the reload on 1 instrument, and it also didn't work. It still show a blank chart. Even for new instruments which I never view in a chart before.

              I tried to load a 24 hours chart of SPY to check (see attached), the data values are wrong, the session opening and closing hours are wrong as well. And I tried to reload Historical data countless times. This happened after I change my Windows time to EST.
              Attached Files
              Last edited by tjendra; 03-27-2009, 12:45 AM.

              Comment


                #8
                It looks like you are on the March contract. Can you please rollover to the June contract and see if it corrects your issue.

                Please follow the instructions below to rollover the expiration date of a futures contracts.
                • From within the NinjaTrader Control Center window select the menu Tools > Instrument Manager
                • Highlight the contract you wish to rollover in the left side of the Instrument Manager window
                • Press the ">" button (the instrument will disappear from the list)
                • Press the "<" button and the instrument should re-appear with the front month expiration date
                Click here for a video and further instructions
                Vince B.NinjaTrader Customer Service

                Comment


                  #9
                  I am using SPY ETF which is not the ES futures. I found the problem for the wrong values, my dates was set 1 year ago on my computer, not sure how that happened. Anyway, all new charts which I load are blank.
                  Last edited by tjendra; 03-27-2009, 07:14 AM.

                  Comment


                    #10
                    Please first ensure you are loading a time frame that you are entitled to from your data provider. Then open a brand new chart and try to draw data. If not, try doing a Reload Historical Data.
                    Josh P.NinjaTrader Customer Service

                    Comment


                      #11
                      I use IB for my data feed. I'm sure they provide 5 mins time frame charts.
                      But the last time I backtest, I could only get data up to 1 year for the 5 min time frame. Is that correct?

                      Comment


                        #12
                        tjendra,

                        IB provides historical minute data only from a live account. Please ensure you are using a live account.

                        Unfortunately I do not know how far back their data goes. You may want to contact them to see if they can provide you with this information.
                        Josh P.NinjaTrader Customer Service

                        Comment


                          #13
                          Originally posted by tjendra View Post
                          I use IB for my data feed. I'm sure they provide 5 mins time frame charts.
                          But the last time I backtest, I could only get data up to 1 year for the 5 min time frame. Is that correct?
                          That's correct, there is not more than 1-2 years back for the minute-data.

                          Regards
                          Ralph

                          Comment


                            #14
                            Originally posted by tjendra View Post
                            When I use Tools->Historical Data->Reload, it seem like I have to choose individual instrument to reload? I have over 100 instrument where I need to reload, can I do it all at once?
                            I had the same problem. Especially with daylight savings time. So I changed the timezone of my pc to US EST and then I had to kill my database and make a new one. Now it works fine.

                            Comment


                              #15
                              How did you kill your database? One by one? Or just you went to delete the files stored in a certain folder?

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                              0 responses
                              649 views
                              0 likes
                              Last Post Geovanny Suaza  
                              Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                              0 responses
                              370 views
                              1 like
                              Last Post Geovanny Suaza  
                              Started by Mindset, 02-09-2026, 11:44 AM
                              0 responses
                              109 views
                              0 likes
                              Last Post Mindset
                              by Mindset
                               
                              Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                              0 responses
                              574 views
                              1 like
                              Last Post Geovanny Suaza  
                              Started by RFrosty, 01-28-2026, 06:49 PM
                              0 responses
                              576 views
                              1 like
                              Last Post RFrosty
                              by RFrosty
                               
                              Working...
                              X