• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

multiple session templates?

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

    multiple session templates?

    I wanted to access both the RTH and ETH session templates within the same indicator. Don't see how I can do that.

    #2
    Hello,

    Thank you for the question.

    Can I please clarify more details on what you are trying to accomplish?

    If you are trying to do this with the same instrument I believe you would need to utilize NinjaScript and a 24 hour session template on the instrument.

    Essentially you would have 24 hours of data available on the data series and you would need to create logic around the times for each session manually rather than using the session template.

    If you can explain this more I will be happy to assist.
    JesseNinjaTrader Customer Service

    Comment


      #3
      Jessie

      I wanted to capture the rth open time so I didn't have to use utc math. As I didn't want to hard code 9:30 in my code.or an adjusted 9:30 based on a persons computer time.

      I am in New Zealand but my trading computer is on NY time but a friends is on California time who uses the same code. By using the base instrument templates I didn't have to create new templates and avoided any hard coding of open times.

      Hope that explains it.
      Currently testing:
      DateTime openTimeUtc = new DateTime(Times[1][0].Year, Times[1][0].Month, Times[1][0].Day, 9, 30, 00, DateTimeKind.Utc);
      DateTime tradeTimeUtc = TimeZoneInfo.ConvertTimeToUtc(Times[1][0]);

      Seems to work but I need to test it on more machines with different local time zones.

      Cheers
      Last edited by ct; 11-06-2014, 12:19 PM.

      Comment


        #4
        You need to use session templates that reflect the exchange time of the instrument traded. This is the only way to comply with different daylight savings schedules throughout the year. There is no location that is always in line with UTC, and US and Europe have different daylight savings schedules, whereas most Asian countries do not follow DST.

        Simple solution: Convert all local times of your PC (whether they are New Zealand, New York or Californian time) to exchange time. Alternatively, simply apply the correct session template and count the bars starting with the session break.

        To access both ETH and RTH sessions within the same indicator, I have subdivided my session template into three sections. Sample session template for ES attached.

        If you use UTC, you will never make it.
        Attached Files

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by bosajin, Yesterday, 06:27 PM
        1 response
        6 views
        0 likes
        Last Post NinjaTrader_Jim  
        Started by stefanrvc, Today, 04:59 AM
        1 response
        14 views
        0 likes
        Last Post NinjaTrader_Marco  
        Started by 7robert, Yesterday, 08:30 PM
        2 responses
        16 views
        0 likes
        Last Post NinjaTrader_Marco  
        Started by pjsmith, Today, 01:13 AM
        1 response
        16 views
        0 likes
        Last Post NinjaTrader_ChrisSch  
        Started by yukashg, Yesterday, 09:56 PM
        1 response
        16 views
        0 likes
        Last Post NinjaTrader_ChrisSch  
        Working...
        X