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#.
      <span class="name">Brandon H.</span><span class="title">NinjaTrader Customer Service</span><iframe name="sig" id="sigFrame" src="/support/forum/core/clientscript/Signature/signature.php" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Hwop38, 05-04-2026, 07:02 PM
      0 responses
      160 views
      0 likes
      Last Post Hwop38
      by Hwop38
       
      Started by CaptainJack, 04-24-2026, 11:07 PM
      0 responses
      308 views
      0 likes
      Last Post CaptainJack  
      Started by Mindset, 04-21-2026, 06:46 AM
      0 responses
      245 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by M4ndoo, 04-20-2026, 05:21 PM
      0 responses
      349 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Started by M4ndoo, 04-19-2026, 05:54 PM
      0 responses
      179 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Working...
      X