Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Trading Hours session can not span a weekend

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

    Trading Hours session can not span a weekend

    When defining a trading session, one can not define one that begins on a Friday and ends on a Monday. On Friday's near the close I want to treat 3pm central time as the end of Friday and the beginning of the Monday trading session:

    I originally asked for this years ago before NT8 was started. Disappointed it wasn't implemented.
    Attached Files

    #2
    For some background, our data loading rules are also dependent on these session templates and limitations how you can define a session revolve around these under the hood. Any changes in these areas are sensitive and we have not had enough requests to implement these features to overhaul all of this data handling logic.

    For me to better understand your request to either pass these thoughts on to development, or to see if there is something currently we can accommodate, can you please help us understand exactly what the use case is that would require a session template to span a weekend?

    Since most markets close end of day friday throughout saturday, and do not reopen until sunday, wouldn't you be able to set the Start Date as Sunday, instead of Friday? Please fill me in if there is something I'm not envisioning there.

    There were some requests in NT7 which asked to allow sessionsn to be defined longer than a week due to the way some bar types reset at the end of the session, but this was resolved with the new BreakEOD handling: http://ninjatrader.com/support/helpG...eak_at_eod.htm

    If there is some use case you wish to define that is not met, I'll be interested to know how we can improve here.
    MatthewNinjaTrader Product Management

    Comment


      #3
      Thanks Matt.
      I want to adjust end of day bars to be a little different than the exchange sessions for a couple of reasons.
      I'm using 1440 minute bars so that the end of the session template will serve to end a bar and begin a new bar.
      Strategy automation that calculates end of bar and submits orders at the start of the next bar can be controlled so that the time of the calculation and order submission matches with what the template is defined as.
      For my end of day trading, on a Friday I want to be able to capture the ES close at 4pm NYSE ( cash session ) run my calculation on that price and submit an order to get in position ( or out ) at the price nearest that 4pm time. If I wait until the open on Sunday night it could be very different due to weekend events. That's the 1st and most important reason.
      The other reason is that I've found NT freezes for 5 to 15 seconds at the start of the Sunday session. Maybe due to the necessary restart of NT every weekend because of the server disconnect. Whatever the reason submission of orders through automation at the open is delayed and I miss a move in the market as a consequence. I'd really like to get in or out of my position on Friday for the Monday session. Can't due easily with the sessions as I hoped.
      Probably you're going to suggest a supplemental series as a work around?

      Comment


        #4
        Thanks for providing the details, I will review your case and get back to you

        Originally posted by Brillo View Post
        Thanks Matt.
        Probably you're going to suggest a supplemental series as a work around?
        Perhaps, as changes to session template logic is not something we can accommodate in the near future, but I'll be sure to track your use case once I have had time to fully understand it by tomorrow.
        MatthewNinjaTrader Product Management

        Comment


          #5
          Originally posted by Brillo View Post
          Thanks Matt.
          I want to adjust end of day bars to be a little different than the exchange sessions for a couple of reasons.
          I'm using 1440 minute bars so that the end of the session template will serve to end a bar and begin a new bar.
          Strategy automation that calculates end of bar and submits orders at the start of the next bar can be controlled so that the time of the calculation and order submission matches with what the template is defined as.
          For my end of day trading, on a Friday I want to be able to capture the ES close at 4pm NYSE ( cash session ) run my calculation on that price and submit an order to get in position ( or out ) at the price nearest that 4pm time. If I wait until the open on Sunday night it could be very different due to weekend events. That's the 1st and most important reason.
          You can pull another session template from the TradingHours class so you can tell it to submit an order/etc at the end of another session.

          If your strategy is running Default 24/7 for example and you want to execute logic at the end of the NYSE cash session, then pull in the US Equities RTH session and operate based on that logic from there.

          Code:
          // [4] will be the Friday session
          int endTime = TradingHours.Get("US Equities RTH").Sessions[4].EndTime;
          DayOfWeek endDay = TradingHours.Get("US Equities RTH").Sessions[4].EndDay;
          						
          if(ToTime(Time[0]) == endTime && Time[0].DayOfWeek == endDay)
          {
          	// do something
          }
          If you prefer to work with DateTime objects, you can make use of the Session Iterator and pass in a specific Trading Hours template to its constructor and you can calculate each trading day to find the actual end time (more resource intensives)

          Code:
          SessionIterator myCashSessions = new SessionIterator(TradingHours.Get("US Equities RTH"));
          
          if(Bars.IsFirstBarOfSession)
          {
              myCashSessions.GetNextSession(Time[0], true);
              
              Print(myCashSessions.ActualSessionEnd);
          }
          Last edited by NinjaTrader_Matthew; 11-20-2015, 11:39 AM.
          MatthewNinjaTrader Product Management

          Comment


            #6
            Interesting.
            I expect that this method would require running the strategy tick by tick ( CalculateOnBarClose = false )?

            Comment


              #7
              I would not say it would be required. You could run it OnBarUpdate OnPriceChange, or you could check in OnMarketData against the e.Time property, or implement on your own timer.
              Last edited by NinjaTrader_Matthew; 11-20-2015, 04:37 PM.
              MatthewNinjaTrader Product Management

              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
              4 views
              0 likes
              Last Post funk10101  
              Started by gravdigaz6, Yesterday, 11:40 PM
              1 response
              8 views
              0 likes
              Last Post NinjaTrader_Manfred  
              Started by MarianApalaghiei, Yesterday, 10:49 PM
              3 responses
              10 views
              0 likes
              Last Post NinjaTrader_Manfred  
              Working...
              X