Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How to store variable number of values, and print at end of each session?

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

    How to store variable number of values, and print at end of each session?

    Quick question?

    I have a study that collects values throughout each session. It's a custom zigZag I scripted. As is now, i have it printing to the output window in a format like in the attached picture. Then I open it with excel, and delimit based on the commas in my 'Print()' commands.

    You can see for each occurrence of the event on the day, it prints a new line, so that there are multiple dates of the same day.

    The format I would like is to print the date only ONCE for each row, with the corresponding values for the events that occurred on that day.

    So for that, would I need to start an array each day, and store the values in that array, then at the end of each session, have it print in the format I want? I.e...
    Attached Files
    Last edited by forrestang; 02-12-2012, 10:02 PM.

    #2
    forrestang, that sounds about correct, you would record those values as for example strings in a list and then loop through the list at your desired end session time to output them. Lists would have the advantage that it's size doesn't need to be fixed in advance like a classic array so easier to deal with.

    Comment


      #3
      Originally posted by NinjaTrader_Bertrand View Post
      forrestang, that sounds about correct, you would record those values as for example strings in a list and then loop through the list at your desired end session time to output them. Lists would have the advantage that it's size doesn't need to be fixed in advance like a classic array so easier to deal with.
      Do you happen to know where a good NT reference/thread is that shows how to create such a structure?

      Comment


        #4
        Some very helpful information would be for example shared here - http://www.ninjatrader.com/support/f...ad.php?t=24801

        Comment


          #5
          I am still in need of a simple way to store a set of values in order as they appear, and then be able to access them later.

          Is there anything simple, that I can just create as a variable, simply put values into this container?

          I am having trouble understanding the examples I have seen so far.

          Comment


            #6
            forrestang,

            You could work with lists in C#.
            Ryan M.NinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by Geovanny Suaza, 02-11-2026, 06:32 PM
            0 responses
            572 views
            0 likes
            Last Post Geovanny Suaza  
            Started by Geovanny Suaza, 02-11-2026, 05:51 PM
            0 responses
            331 views
            1 like
            Last Post Geovanny Suaza  
            Started by Mindset, 02-09-2026, 11:44 AM
            0 responses
            101 views
            0 likes
            Last Post Mindset
            by Mindset
             
            Started by Geovanny Suaza, 02-02-2026, 12:30 PM
            0 responses
            549 views
            1 like
            Last Post Geovanny Suaza  
            Started by RFrosty, 01-28-2026, 06:49 PM
            0 responses
            550 views
            1 like
            Last Post RFrosty
            by RFrosty
             
            Working...
            X