Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Multi-time period session times

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

    Multi-time period session times

    Hi
    I'm trying to set up a strategy where I enter based on a daily signal and manage the trade on a 5 min period, intraday. I've set up the daily period using "Add(PeriodType.Day,1);". When I run the strategy, I use 5 Min 8:30 to 15:30 CST. Problem is when I use " int Gap = Opens[1][0] - Closes[1][1];" I get the open and close at 12:00:00 AM. I want the open at 8:30 and the close at 15:30 the day before. Is there a way of setting the session time for day session? The 5 min session time I have set in the backtest dialogue box.
    Thanks in advance.

    #2
    Day bars are all timestamped 12:00AM. There is no session definitions for daily bars.
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      Ok Josh
      Any ideas on how I could get the closing price at 15:15 for the previous trading day?
      Thanks

      Comment


        #4
        Use PriorDayOHLC().PriorClose[0].
        Josh P.NinjaTrader Customer Service

        Comment


          #5
          Excellent - thanks

          One more question - I want to trigger an event based on the it being the start of the first bar of the day. What would I need to include in an if statement to accomplish this?
          Thanks

          Comment


            #6
            Code:
            if (Bars.FirstBarOfSession)
                 // Do something;
            Josh P.NinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by cmoran13, Yesterday, 01:02 PM
            0 responses
            29 views
            0 likes
            Last Post cmoran13  
            Started by PaulMohn, 04-10-2026, 11:11 AM
            0 responses
            21 views
            0 likes
            Last Post PaulMohn  
            Started by CarlTrading, 03-31-2026, 09:41 PM
            1 response
            160 views
            1 like
            Last Post NinjaTrader_ChelseaB  
            Started by CarlTrading, 04-01-2026, 02:41 AM
            0 responses
            95 views
            1 like
            Last Post CarlTrading  
            Started by CaptainJack, 03-31-2026, 11:44 PM
            0 responses
            148 views
            2 likes
            Last Post CaptainJack  
            Working...
            X