Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

current bar previous bar

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

    current bar previous bar

    hi,

    i have a strategy that will calculate on bar close only.

    i want to compare the close from the closed bar with the bollinger values of that closed bar. is this then bollinger[1] < close[1] or is it bollinger[1] < close[0] because the current bar does not have a close ? i suppose that if my strategy starts calculating the new bar is alreadu created with an open etc and i need to do everything on the [1] bar or is [0] the bar that is closed ?
    little confused !

    #2
    Hello,

    Thank you for your post.

    If you are referencing the value of the Close and the Bollinger on the same bar you want to use the same index.

    An index of [0] will return the most recent price in any case. Since you have CalculateOnBarClose set to true, an index of [0] will return the most recent price of the last closed bar.

    From your description, it sound like you want to use bollinger[0] < close[0].
    DenNinjaTrader Customer Service

    Comment


      #3
      thanks Ben

      so the bollinger [0] are the bollinger values of the closed bar and not the current bar that is plotted will my calculation runs because it is on bar update = true ? so an open [0] is not the current price but the open of the closed bar

      Comment


        #4
        Hello,

        It sounds like you are on the right track.

        Think of it this way. When CalculateOnBarClose is set to true, the building bar does not exist and the "most recent price" is now on the closed bar.
        DenNinjaTrader Customer Service

        Comment


          #5
          thanks i got it !

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Geovanny Suaza, 02-11-2026, 06:32 PM
          0 responses
          647 views
          0 likes
          Last Post Geovanny Suaza  
          Started by Geovanny Suaza, 02-11-2026, 05:51 PM
          0 responses
          369 views
          1 like
          Last Post Geovanny Suaza  
          Started by Mindset, 02-09-2026, 11:44 AM
          0 responses
          108 views
          0 likes
          Last Post Mindset
          by Mindset
           
          Started by Geovanny Suaza, 02-02-2026, 12:30 PM
          0 responses
          572 views
          1 like
          Last Post Geovanny Suaza  
          Started by RFrosty, 01-28-2026, 06:49 PM
          0 responses
          573 views
          1 like
          Last Post RFrosty
          by RFrosty
           
          Working...
          X