Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Question about populating and printing from arrays

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

    Question about populating and printing from arrays

    I need some help to get text into an array. I then need to print the contents of the array to the Output Window, each entry on its own line.

    Sample code below:

    string[] ReadMeLater = new string[];
    Code:
    if (Open[1] > 25)
    {
    
    //Type something below that will copy the text into the "ReadMeLater" string array.
    "The OPEN was greater than the assigned number."
    
    }
    
    
    
    if (Close[1] < 399)
    {
    
    //Type something below that will copy the text into the "ReadMeLater" string array.
    "The CLOSE was less than than the upper range."
    
    }

    I would then like to print both entries in the array to the Output Window when needed. I need to have each entry appear on its own line.


    Example of what should appear in Output Window:

    The OPEN was greater than the assigned number.
    The CLOSE was less than than the upper range.


    FYI, the array will contain many entries. A lot more than two. : )


    Thanks in advance.
    ​​
    Last edited by ArmKnuckle; 04-16-2023, 06:31 PM.

    #2
    Sorry, this should be in Strategy Development.

    Comment


      #3
      Hello ArmKnuckle,

      Thanks for your notes.

      I have moved your thread over to the Strategy Development section of the forums as you have noted.

      That said, using arrays is a C# concept and is not NinjaScript specific so this would fall under C# education which goes beyond the support we provide. To understand how to work with arrays in C# you could do a quick Google search for something like 'Add text to array C#' or 'print array values C#' to research this topic further.

      This forum thread will be open for other community members to provide C# education when it comes to working with arrays in C#.
      Brandon H.NinjaTrader Customer Service

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by llanqui, Today, 03:53 AM
      0 responses
      6 views
      0 likes
      Last Post llanqui
      by llanqui
       
      Started by burtoninlondon, Today, 12:38 AM
      0 responses
      10 views
      0 likes
      Last Post burtoninlondon  
      Started by AaronKoRn, Yesterday, 09:49 PM
      0 responses
      15 views
      0 likes
      Last Post AaronKoRn  
      Started by carnitron, Yesterday, 08:42 PM
      0 responses
      11 views
      0 likes
      Last Post carnitron  
      Started by strategist007, Yesterday, 07:51 PM
      0 responses
      14 views
      0 likes
      Last Post strategist007  
      Working...
      X