Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

BarPeriods or BarsPeriod

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

    BarPeriods or BarsPeriod

    The doc says BarPeriod but you get a compile error: The name 'BarPeriods' does not exist in the current conntext.
    Example:
    Print( BarPeriods[1].Value);

    Now if you use BarsPeriod one gets a clean compile
    Example
    Print( BarsPeriods[1].Value);

    Another strange compile error is: Operator '+' cannot be applied to operands of type 'string' and 'method group'
    Example
    Print( "Test" + BarsPeriods[1].ToString);

    I have posted this here in the 6.5 beta because this is what I am running when I get the error. It is possible that this also exists in 6.0.

    #2
    Please check out the actual types of both properties BarsPeriod and BarsPeriods in intellisense or the docs and you'll understand the difference: the former is the BarsPeriod for the primary instrument, the latter is an array of all BarsPeriod(s) for all instruments of a strategy.

    Comment


      #3
      Docs wrong.

      Note that the docs says "BarPeriods" when in fact the code required is "BarsPeriods".
      Please amend the docs. This confounded me for a while.

      saltminer.

      Comment


        #4
        Thanks for making us aware of that. We'll update the docs.

        Comment


          #5
          I found this thread really helpful and just wanted to point out the docs at (http://www.ninjatrader-support.com/H...html?Positions) show BarPeriods but in fact the right variable is BarsPeriods.

          Comment


            #6
            Thanks for making as aware. We'll fix the docs accordingly.

            Comment


              #7
              Just a headsup...this typo still exists in the NT7.0 documentation. Just search for "BarPeriods" and you'll find the page with the typo.

              Comment


                #8
                Thanks for the heads up. The typos have not been amended.
                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
                580 views
                0 likes
                Last Post Geovanny Suaza  
                Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                0 responses
                335 views
                1 like
                Last Post Geovanny Suaza  
                Started by Mindset, 02-09-2026, 11:44 AM
                0 responses
                102 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