Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Bars.FirstBarOfSession

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

    Bars.FirstBarOfSession

    Hi Ninja Team,

    Perhaps a silly question but if using Bars.FirstBarOfSession in a strategy, is that going to look at the first bar since the strategy was started or the first bar of the new Session Templates?

    I'm looking at using the sample code from your SamplePnL strategy in NT7and am wondering what the expected behavior would be if I want the PnL to start at zero each day if;

    1. I'm using the default 24/7 Template
    2. I'm using a template like CBOT Ag RTH

    And the strategies themselves run;

    a) 24/5
    b) 23/5 with a restart of NT daily.

    Just trying to get my head around the logic before I go too deep...

    Thanks!

    EDIT: Perhaps asking when the counter for Performance.AllTrades.TradesPerformance.Currency.C umProfit etc starts is a better question... and how/when is it reset. Thanks.
    Last edited by MXASJ; 01-13-2010, 06:37 AM.

    #2
    FirstBarOfSession will return true on the first bar of a session based on the historical data set loaded by your strategy. CumProfit is based on all trades in the collection, in your example you are pointing to AllTrades thus this means all historical and real-time trades closed by your strategy.
    RayNinjaTrader Customer Service

    Comment


      #3
      Simple question

      What is the difference between Bars.FirstBarOfSession and Bars.SessionBreak?

      Comment


        #4
        SessionBreak is deprecated. Please use FirstBarOfSession.
        Josh P.NinjaTrader Customer Service

        Comment


          #5
          Hi Josh,

          thank you for your answer. I just saw that SessionBreak was still used in the NT CurrentDayOHL indicator.

          Originally posted by NinjaTrader_Josh View Post
          SessionBreak is deprecated. Please use FirstBarOfSession.

          Comment


            #6
            Harry,

            Thanks for the spot.
            Josh P.NinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by Geovanny Suaza, 02-11-2026, 06:32 PM
            0 responses
            581 views
            0 likes
            Last Post Geovanny Suaza  
            Started by Geovanny Suaza, 02-11-2026, 05:51 PM
            0 responses
            338 views
            1 like
            Last Post Geovanny Suaza  
            Started by Mindset, 02-09-2026, 11:44 AM
            0 responses
            103 views
            0 likes
            Last Post Mindset
            by Mindset
             
            Started by Geovanny Suaza, 02-02-2026, 12:30 PM
            0 responses
            554 views
            1 like
            Last Post Geovanny Suaza  
            Started by RFrosty, 01-28-2026, 06:49 PM
            0 responses
            552 views
            1 like
            Last Post RFrosty
            by RFrosty
             
            Working...
            X