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

Daylight Saving Time US and Europe

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

    Daylight Saving Time US and Europe

    In US, DST changes on second sunday in March and on first sunday in November. But in Europe, on last sunday in March and on last sunday in September.

    I am from Europe and I have to trade US futures one hour earlier at these times. I'am working on my automated trading strategy and I need to correct the times by a script and don't know how.

    I'd like to make a test like this:

    if (today localtime is summertime
    && today US time is summertime)

    { trade as usual }
    else { trade one hour earlier }

    Is there any C# function to do this?

    #2
    xmms1,

    You can try searching google or MSDN for daylight savings for DateTime objects.
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      Just change the time of the computer to CST. That's what I did.

      Baruch

      Comment


        #4
        I don't want to change the time. I want to trade using my time. I am trying to find a C# method but nothing suitable found. I'm not a programmer.

        Comment


          #5
          Doing so may require programming. Unfortunately if there is no pre-built method you would have to create your own. I am sure there are some code snippets to do so on google, but unfortunately this is beyond the scope I can offer support for. Thank you for understanding.
          Josh P.NinjaTrader Customer Service

          Comment


            #6
            Hi xmms1,

            there is indeed a function which tells you, if your local computer time is daylight saving time: DateTime.IsDaylightSavingTime. But it doesn't solve your problem with US DST.

            Here is a proposal for a patch (quick and dirty):
            Define two groups of three variables for your strategy: DaylightSavingStart, DayLightSavingStop, Offset

            Offset is the hour-delay for the timeperiod of concern. If you define that for both US and EU-Time, then you could compare against the current Date/Time of your strategy and offset the trading time accordingly.

            Regards
            Ralph

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by Haiasi, 04-25-2024, 06:53 PM
            4 responses
            63 views
            0 likes
            Last Post effraenk  
            Started by ccbiasi, 11-23-2017, 06:06 AM
            5 responses
            2,202 views
            0 likes
            Last Post leodavis  
            Started by kujista, Yesterday, 12:39 AM
            2 responses
            14 views
            0 likes
            Last Post kujista
            by kujista
             
            Started by Austiner87, Yesterday, 11:24 AM
            2 responses
            13 views
            0 likes
            Last Post brucerobinson  
            Started by Rogers101, 05-05-2024, 11:30 AM
            3 responses
            22 views
            0 likes
            Last Post Rogers101  
            Working...
            X