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

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 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
                7 views
                0 likes
                Last Post NinjaTrader_Manfred  
                Started by wzgy0920, Today, 09:53 PM
                0 responses
                9 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