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 trilliantrader, 04-18-2024, 08:16 AM
                4 responses
                18 views
                0 likes
                Last Post trilliantrader  
                Started by mgco4you, Today, 09:46 PM
                1 response
                10 views
                0 likes
                Last Post NinjaTrader_Manfred  
                Started by wzgy0920, Today, 09:53 PM
                0 responses
                10 views
                0 likes
                Last Post wzgy0920  
                Started by Rapine Heihei, Today, 08:19 PM
                1 response
                10 views
                0 likes
                Last Post NinjaTrader_Manfred  
                Started by Rapine Heihei, Today, 08:25 PM
                0 responses
                10 views
                0 likes
                Last Post Rapine Heihei  
                Working...
                X