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

Set back an Array to Null Value

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

    Set back an Array to Null Value

    I want to set back an array to null value on each OnBarUpdate calling.
    How do you do that ?

    #2
    baba123,

    Can you clarify how you're using the array? Is this a custom array or do you mean a data series?

    If you're using a basic data series, you can use:

    myDataSeries.Reset();

    Please let me know if that's not what you meant.
    MatthewNinjaTrader Product Management

    Comment


      #3
      Originally posted by baba123 View Post
      I want to set back an array to null value on each OnBarUpdate calling.
      How do you do that ?
      What type of array is it?
      What was your intital declaration of said array?

      Comment


        #4
        It is a custom array : int[ ] MyArray =new int {0,0,0}

        To be more specific I want to clear all the value in my array on each bar update

        Comment


          #5
          Originally posted by baba123 View Post
          It is a custom array : int[ ] MyArray =new int {0,0,0}

          To be more specific I want to clear all the value in my array on each bar update
          Then just declare the array again on each OnBarUpdate() pass. Declaring an array with the same name as an existing array replaces the existing array.

          If you just want to reset all the elements of the array to zero, use Array.Clear(MyArray, 0, MyArray.Length).
          Last edited by koganam; 08-11-2011, 08:06 PM. Reason: Corrected spelling

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by pechtri, 06-22-2023, 02:31 AM
          10 responses
          124 views
          0 likes
          Last Post Leeroy_Jenkins  
          Started by judysamnt7, 03-13-2023, 09:11 AM
          4 responses
          59 views
          0 likes
          Last Post DynamicTest  
          Started by ScottWalsh, Yesterday, 06:52 PM
          4 responses
          36 views
          0 likes
          Last Post ScottWalsh  
          Started by olisav57, Yesterday, 07:39 PM
          0 responses
          7 views
          0 likes
          Last Post olisav57  
          Started by trilliantrader, Yesterday, 03:01 PM
          2 responses
          22 views
          0 likes
          Last Post helpwanted  
          Working...
          X