• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

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 bosajin, Today, 06:27 PM
          0 responses
          2 views
          0 likes
          Last Post bosajin
          by bosajin
           
          Started by saltminer, Today, 06:11 PM
          0 responses
          2 views
          0 likes
          Last Post saltminer  
          Started by epitoma, Today, 05:21 PM
          1 response
          15 views
          0 likes
          Last Post NinjaTrader_ShawnB  
          Started by BatBart, Today, 01:24 PM
          1 response
          23 views
          0 likes
          Last Post NinjaTrader_Melissa  
          Started by ezrakoper, Today, 03:05 PM
          1 response
          8 views
          0 likes
          Last Post NinjaTrader_ChelseaB  
          Working...
          X