Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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 rtwave, 04-12-2024, 09:30 AM
                5 responses
                37 views
                0 likes
                Last Post NinjaTrader_ChelseaB  
                Started by funk10101, Today, 12:02 AM
                1 response
                11 views
                0 likes
                Last Post NinjaTrader_LuisH  
                Started by GLFX005, Today, 03:23 AM
                1 response
                6 views
                0 likes
                Last Post NinjaTrader_Erick  
                Started by nandhumca, Yesterday, 03:41 PM
                1 response
                13 views
                0 likes
                Last Post NinjaTrader_Gaby  
                Started by The_Sec, Yesterday, 03:37 PM
                1 response
                11 views
                0 likes
                Last Post NinjaTrader_Gaby  
                Working...
                X