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 NullPointStrategies, Today, 05:17 AM
      0 responses
      25 views
      0 likes
      Last Post NullPointStrategies  
      Started by argusthome, 03-08-2026, 10:06 AM
      0 responses
      120 views
      0 likes
      Last Post argusthome  
      Started by NabilKhattabi, 03-06-2026, 11:18 AM
      0 responses
      63 views
      0 likes
      Last Post NabilKhattabi  
      Started by Deep42, 03-06-2026, 12:28 AM
      0 responses
      41 views
      0 likes
      Last Post Deep42
      by Deep42
       
      Started by TheRealMorford, 03-05-2026, 06:15 PM
      0 responses
      46 views
      0 likes
      Last Post TheRealMorford  
      Working...
      X