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

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 jeronymite, 04-12-2024, 04:26 PM
        3 responses
        40 views
        0 likes
        Last Post jeronymite  
        Started by bill2023, Today, 08:51 AM
        2 responses
        15 views
        0 likes
        Last Post bill2023  
        Started by sidlercom80, 10-28-2023, 08:49 AM
        167 responses
        2,260 views
        0 likes
        Last Post jeronymite  
        Started by warreng86, 11-10-2020, 02:04 PM
        7 responses
        1,362 views
        0 likes
        Last Post NinjaTrader_Manfred  
        Started by Perr0Grande, Today, 08:16 PM
        0 responses
        5 views
        0 likes
        Last Post Perr0Grande  
        Working...
        X