Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Syntax of BarsArray with LowestBar() method

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

    Syntax of BarsArray with LowestBar() method

    Hi Guys, One for Josh maybe...

    Can I use the BarsArray[] call within the context of the LowestBar() Method...

    Say I have two dataseries and I want to access LowestBar(Low,10) but for the dataseries represented by BarsInProgress==0 but when the code is invoked by a call from BarsInProgress==0. Is this possible...? If so, what's the syntax...??

    Obviously it's easy for indicators as described in your example CCI(BarsArray[2],20)... or indeed for open, high, low close etc... in the syntax Low[0][20].... but is it possible to do this with methods such as LowestBar()...??

    Many Thanks

    #2
    Why would:

    if (BarsInProgress == 0) Print(LowestBar(Low, 10));

    not work?
    RayNinjaTrader Customer Service

    Comment


      #3
      Hi Ray,

      That would work except for this,

      I'm executing into a 1 min bar dataseries (BarsInProgress==1)... my primary series is, say, 10 min bars.

      When I place an entry order into the 1 min bar dataseries, I then place a stop via OnOrderUpdate()... and I want this stop price to be based off a price in the primary dataseries (10 min). However, when OnOrderUpdate() gets called in this context BarsInProgress==1 so somehow I have to access the primary data series when BarsInProgress==1 using the LowestBar() method...

      Does that makes sense...?

      Comment


        #4
        Try this and see if it works.

        if (BarsInProgress == 1) Print(LowestBar(Lows[0], 10));
        RayNinjaTrader Customer Service

        Comment


          #5
          Got it. Great Ray. All working now. Thanks.

          Comment


            #6
            Ray, while I've got you... one more question.

            Is it possible to apply indicators to dataseries that you add to a strategy. For example, in this case, if my primary is 10 min bars, and I've added 1 mins bars via Add()... can I think apply, say, some SMA's to the 1 min bar dataseries and use those as part of my entry & exit methodology...??

            Cheers

            Comment


              #7
              Yes you can.

              In case you have not reviewed yet, please see this reference - http://www.ninjatrader-support.com/H...struments.html
              RayNinjaTrader Customer Service

              Comment


                #8
                Of course. Doh!! I even quoted an example of it in my orignal post to you!!!

                Sorry, losing my mind.

                Thanks

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                0 responses
                633 views
                0 likes
                Last Post Geovanny Suaza  
                Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                0 responses
                364 views
                1 like
                Last Post Geovanny Suaza  
                Started by Mindset, 02-09-2026, 11:44 AM
                0 responses
                105 views
                0 likes
                Last Post Mindset
                by Mindset
                 
                Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                0 responses
                567 views
                1 like
                Last Post Geovanny Suaza  
                Started by RFrosty, 01-28-2026, 06:49 PM
                0 responses
                568 views
                1 like
                Last Post RFrosty
                by RFrosty
                 
                Working...
                X