Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

how to skip first bar of session in condition

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

    how to skip first bar of session in condition

    how to skip first bar of session in condition


    I use a condition that counts all bars (the volume of all bars since the beginning of the session), I had the task of excluding the first bar of the session from the condition, that is, I need to start the calculation of the condition from the second bar of the session

    how can I do it right?

    Tried so - does not work

    if (Bars.IsFirstBarOfSession == false)
    if Conditionl)
    {
    }

    UPD

    rechecked by printout

    if (Bars.IsFirstBarOfSession == false) - works good

    the first bar is excluded from the calculation.

    Then the question changes to how to exclude, for example, the first 3 bars from the calculation?
    Last edited by memonolog; 10-20-2020, 04:26 AM.

    #2
    Hello memonolog,

    Thanks for your post.

    You can use Bars.BarsSinceNewTradingDay: https://ninjatrader.com/support/help...tradingday.htm

    if (Bars.BarsSinceNewTradingDay > 3) // perform after the 3 first bars
    {
    if (your condition)
    {

    Comment


      #3
      Originally posted by NinjaTrader_PaulH View Post
      Hello memonolog,

      Thanks for your post.

      You can use Bars.BarsSinceNewTradingDay: https://ninjatrader.com/support/help...tradingday.htm

      if (Bars.BarsSinceNewTradingDay > 3) // perform after the 3 first bars
      {
      if (your condition)
      {
      Thank you Paul

      Comment


        #4
        Paul, is there a way to achieve this kind of condition within the strat builder? I have a range bar pattern I'm working with and I need the strategy to ignore any bars from a prior session, or even better, a prior time.

        thanks,
        David

        Comment


          #5
          Hello trader3000a,

          Thanks for your post.

          The only reference the strategy builder would have is Misc>First bar of session which is a true/false condition.

          You can use a time filter or time referfence.
          References:


          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Geovanny Suaza, 02-11-2026, 06:32 PM
          0 responses
          576 views
          0 likes
          Last Post Geovanny Suaza  
          Started by Geovanny Suaza, 02-11-2026, 05:51 PM
          0 responses
          334 views
          1 like
          Last Post Geovanny Suaza  
          Started by Mindset, 02-09-2026, 11:44 AM
          0 responses
          101 views
          0 likes
          Last Post Mindset
          by Mindset
           
          Started by Geovanny Suaza, 02-02-2026, 12:30 PM
          0 responses
          553 views
          1 like
          Last Post Geovanny Suaza  
          Started by RFrosty, 01-28-2026, 06:49 PM
          0 responses
          551 views
          1 like
          Last Post RFrosty
          by RFrosty
           
          Working...
          X