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

How to declare a BarsArray class?

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

    How to declare a BarsArray class?

    How to declare a BarsArray object?
    Last edited by atrader; 04-22-2009, 07:51 AM.

    #2
    Hi atrader, not sure I follow - you can work directly with BarsArray if you added instruments via the Add() method prior - http://www.ninjatrader-support.com/H...BarSeries.html
    BertrandNinjaTrader Customer Service

    Comment


      #3
      Thanks Bertrand! That is how to use the BarsArray. And what I am trying to do

      is to make a function or methord. I am going to use the BarsArray as a parameter, so I need to declare it as an object. I believe that I should be able to do it. But I can not find any documentation about it.

      Comment


        #4
        Unfortunately this is not supported. If you want to make a parameter I suggest you just make a parameter for the [] index and use that parameter where ever you have BarsArray[] used.
        Josh P.NinjaTrader Customer Service

        Comment


          #5
          Thans Josh! How can I declare the [] index?

          Acturally, I only need one series of bars. When I call the function, I will use BarsArray[1] as the parameter for example. However, when I make the function, I need to declare it. So my question is how can I declare it when I creat my funciton? or if it is not supported, can you privde me with the structure of that class, so that I can create the class by myself?

          Comment


            #6
            You just make a variable for the actual number.

            BarsArray[x] where x is your parameter.

            Unfortunately we do not support making classes.
            Josh P.NinjaTrader Customer Service

            Comment


              #7
              Thank you again Josh! There are serval values in the

              BarsArray[x], and I need to pass the whole content in the BarsArray[x] to my function. So how do I make the declaration? For example,
              private void MyOwnFuction (int integerExample, 'BarsArray[x]' barsArrayINeed)
              What should I use in the 'BarsArray[x]' part? (like the int in the integerExample)

              Comment


                #8
                Why do you need to pass the whole content? Just pass the x and go BarsArray in the function and reference the x that you just passed.
                Josh P.NinjaTrader Customer Service

                Comment


                  #9
                  Thank you so much Josh! I got it. You are quite right.

                  I made a simple thing complicated. Thanks again!

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by TheMarlin801, 10-13-2020, 01:40 AM
                  20 responses
                  3,914 views
                  0 likes
                  Last Post Bidder
                  by Bidder
                   
                  Started by timmbbo, 07-05-2023, 10:21 PM
                  3 responses
                  151 views
                  0 likes
                  Last Post grayfrog  
                  Started by Lumbeezl, 01-11-2022, 06:50 PM
                  30 responses
                  808 views
                  1 like
                  Last Post grayfrog  
                  Started by xiinteractive, 04-09-2024, 08:08 AM
                  3 responses
                  11 views
                  0 likes
                  Last Post NinjaTrader_Erick  
                  Started by Johnny Santiago, 10-11-2019, 09:21 AM
                  95 responses
                  6,194 views
                  0 likes
                  Last Post xiinteractive  
                  Working...
                  X