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 Vietanhnguyen2hotmailcom, Yesterday, 10:29 AM
          4 responses
          23 views
          0 likes
          Last Post Vietanhnguyen2hotmailcom  
          Started by PhillT, 04-19-2024, 02:16 PM
          4 responses
          35 views
          0 likes
          Last Post PhillT
          by PhillT
           
          Started by ageeholdings, 05-01-2024, 05:22 AM
          5 responses
          37 views
          0 likes
          Last Post ageeholdings  
          Started by reynoldsn, Today, 02:34 PM
          0 responses
          13 views
          0 likes
          Last Post reynoldsn  
          Started by nightstalker, Today, 02:05 PM
          0 responses
          21 views
          0 likes
          Last Post nightstalker  
          Working...
          X