Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Time offset splitting day bars (Session Manager)

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

    Time offset splitting day bars (Session Manager)

    I seem to be having an issue regarding the time zone settings and Session Manager. The issue is related to, but not identical to, this forum issue.

    I am getting a double bar in my data:


    (SLV -- Arca Exchange)
    Local time: 12:30 AM, May 04, 2011. That new, small, rightmost bar was just created 30 minutes ago.

    I am using Interactive Brokers as my data source; I don't think it's a problem with the data provider (hopefully?).

    Rather, the current date and time in the above picture is about 12:30 AM, May 04 2011, in the GMT +8 Time Zone.

    I can't just ignore the bar, as it invalidates all of my indicators. Furthermore, as of 12:00 AM, NinjaTrader started a new daily bar! This means that the bars being generated are not market-aligned, and the data in the last couple of bars, which should be contained in a single bar, is instead "split" between different days. This is a problem. I Also think that fixing this time zone would also fix the double bar, above.

    I have attempted to fix the issue by updating the values in the "US Equities RTH" Session preset (which I have set SLV to use). I have attempted to "shift back" the data by modifying the time zone in the Session preset.

    Currently I am in GMT +8, and the market closes at 4 AM. I need to "push back" this time by 12 hours so that it appears to close at 4 PM the previous day. It seems the way to do that would be to move forward the Time Zone in the session manager by 12 hours. As I am already GMT +8, it seems that I will need a GMT+20 setting to do this.

    However, there are no GMT+20 settings in the time zone options (obviously). I must be missing something about the correct way to approach this problem.

    Also note that adjusting my system clock is not an option as that would interfere with certain SSL protocol (SSH) communications I use on a regular basis.

    Please let me know if I can provide any other data, or if there is anything else I can do to help debug this issue. Thanks!

    Regards,
    Ryan S.

    #2
    Hi Ruien,

    Thank you for your post, and welcome to the forum.

    There is not a UTC +20, but rather you would use a time zone of UTC -4 based on the 12 hour clock, but that would have the effect of changing your date from the current date to yesterday's date and would result in the chart within NinjaTrader offsetting based on your local time zone to be UTC -4 for a 12 hour difference, and thus a date difference.

    However, you will not want to modify the Session Template time zone unless you change the hours to reflect the new time zone. So that would mean pushing the times for the US Equities RTH with a UTC -4 to 10:30 AM start time to 5:00 PM close time, and then use that value.

    However, due to the offsets the values of the chart will still be based on the local time, and so you may want to change the time zone of the Session Template and then close and reopen NinjaTrader and reload the chart to see the effects of those changes on your Session Template modifications.
    Ryan O.NinjaTrader Customer Service

    Comment


      #3
      Thank you for your post, and welcome to the forum.
      Much appreciated.

      Since changing my system time (even by an exact day) is not an option, I decided to go with editing the Session Template as suggested.

      To summarize the procedure (for posterity):

      (1) Determine the offset necessary to move the bars to the "correct" time. For example, if the market actually closes at 7 AM local time the day after the real close, an adjustment of -15 hours is necessary to push that close back to 4PM the previous day.

      (2) Time zones are effectively negative adjustments due to a shift in the frame of reference. Therefore, an adjustment of +15 hours in time zone would have the effect of moving the "visible" time of the bars back by 15 hours.

      (3) Add the negative adjustment (+15 in this case) to the current local time's UTC offset. For a hypothetical UTC+3 location, this would translate to UTC+18.

      (4) If the offset is greater than +12 or less than -12, there won't be a physical location with those properties. In this case, add or subtract 24 hours to bring it back into the normal range. In my example, we would subtract 24 hours from UTC+18 to arrive at UTC-6

      (5) Set the Session Template to use the UTC value calculated in Step 4

      (6) Adjust the Session Template's session times so that the open and close times are correct as viewed from this new Session Template timezone (set in Step 5). For example, in a UTC-6 environment, the market opens at 8:30 AM and closes at 3:00 PM

      (7) Apply this Session Template to the securities being viewed (in Instrument Manager or Chart) and then close and re-open Ninjatrader

      The result will be correct time bars, perhaps offset by +/- 1 day, but it won't affect indicators or cause bars to be non-market-aligned.

      Following these steps with my own data (UTC+20 -> UTC-4, setting Session Template to 10:30AM - 5:00 PM) appears to have solved the issue. I will check this during market hours during the 12:00 AM transition tonight to see if it worked. Thanks!

      Regards,
      Ryan S.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by yertle, Yesterday, 08:38 AM
      7 responses
      28 views
      0 likes
      Last Post yertle
      by yertle
       
      Started by bmartz, 03-12-2024, 06:12 AM
      2 responses
      21 views
      0 likes
      Last Post bmartz
      by bmartz
       
      Started by funk10101, Today, 12:02 AM
      0 responses
      5 views
      0 likes
      Last Post funk10101  
      Started by gravdigaz6, Yesterday, 11:40 PM
      1 response
      9 views
      0 likes
      Last Post NinjaTrader_Manfred  
      Started by MarianApalaghiei, Yesterday, 10:49 PM
      3 responses
      11 views
      0 likes
      Last Post NinjaTrader_Manfred  
      Working...
      X