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.
    DierkNinjaTrader Customer Service

    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.
        DierkNinjaTrader Customer Service

        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.
            DierkNinjaTrader Customer Service

            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 Blairski, Yesterday, 09:19 AM
                1 response
                9 views
                0 likes
                Last Post NinjaTrader_Jesse  
                Started by tonynt, Today, 09:33 AM
                1 response
                5 views
                0 likes
                Last Post NinjaTrader_Jesse  
                Started by minotti1, Today, 08:31 AM
                1 response
                13 views
                0 likes
                Last Post NinjaTrader_Jim  
                Started by SmartArtsStudio, 05-15-2021, 10:46 AM
                1 response
                15 views
                0 likes
                Last Post NinjaTrader_ChelseaB  
                Started by Airwave, Today, 06:02 AM
                2 responses
                22 views
                0 likes
                Last Post NinjaTrader_BrandonH  
                Working...
                X