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

Bars Array

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

    Bars Array

    Add(PeriodType.Minute, 5);

    If I wanted to refer to the Low[1] off the 5 minute chart how would I need to write the Low[1]

    Also is I want to refer to 5 x 5 minute bars below how would this need to be written

    Bars.BarsSinceSession>=5

    #2
    fiddy, this info would be accessible via Lows - http://www.ninjatrader.com/support/h...s/nt7/lows.htm

    Would do you want to compare the 5 min bars to for your second condition? You would want to see 5 bars from the start the of the session given by the added 5 min chart?
    BertrandNinjaTrader Customer Service

    Comment


      #3
      thanks for Low suggestion

      Re: Bars.BarsSinceSession>=5

      I would like there to 5 x 5 min bars certain criteria is assessed

      Comment


        #4
        fiddy, both CurrentBars[x] as well as Bars.BarsSinceSession would work in the called BarsInProgress context, meaning you can get a count based off the primary or secondary series and check how many bars have for example passed to validate / invalidate a setup.
        BertrandNinjaTrader Customer Service

        Comment


          #5
          How do u refer to the second array using Bars.BarsSinceSession

          Comment


            #6
            You would just call it in BarsInProgress == 1.
            BertrandNinjaTrader Customer Service

            Comment


              #7
              How do you refer to the second array for Close[0]

              I would like to refer to the close if the 1 minute bars

              Add(PeriodType.Minute, 1);

              Close[0] - 100 * TickSize > longExitStopOrder.StopPrice

              Comment


                #8
                Just use the Closes then with your desired bars array object specified - https://www.ninjatrader.com/support/...nt7/closes.htm
                BertrandNinjaTrader Customer Service

                Comment


                  #9
                  Would this coding work, as it doesn't seem to be, can this function only be used in the primary index?
                  Position.GetProfitLoss(Closes[1][0], PerformanceUnit.Points)

                  Comment


                    #10
                    Would expect it to work in any index, the double price you pass in is just used as comparison to compute against, if you pass in the added series close price and also calculate in this added series context it should report as expected.
                    BertrandNinjaTrader Customer Service

                    Comment

                    Latest Posts

                    Collapse

                    Topics Statistics Last Post
                    Started by fx.practic, 10-15-2013, 12:53 AM
                    5 responses
                    5,404 views
                    0 likes
                    Last Post Bidder
                    by Bidder
                     
                    Started by Shai Samuel, 07-02-2022, 02:46 PM
                    4 responses
                    95 views
                    0 likes
                    Last Post Bidder
                    by Bidder
                     
                    Started by DJ888, Yesterday, 10:57 PM
                    0 responses
                    8 views
                    0 likes
                    Last Post DJ888
                    by DJ888
                     
                    Started by MacDad, 02-25-2024, 11:48 PM
                    7 responses
                    160 views
                    0 likes
                    Last Post loganjarosz123  
                    Started by Belfortbucks, Yesterday, 09:29 PM
                    0 responses
                    9 views
                    0 likes
                    Last Post Belfortbucks  
                    Working...
                    X