Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

New Line

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

    New Line

    I'd like my script to print a blank line. This can be done using "Print ("")". However, it should also be possible to use "\n", but that doesn't work. Any idea why?

    #2
    Hello spottysallrite,

    Thanks for your post.

    Yes, to print a blank line to the NinjaScript Output window you could add a print such as Print(" "); or Print("\n");.

    Both of the above print statements will cause a blank line to print to the NinjaScript Output window.

    Let us know if we may assist further.
    <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


      #3
      That wasn't my question. I should be able to use "Print ("stuff" + "\n"); " and get "stuff" on one line, then a blank line. Why does that not work?

      Comment


        #4
        Hello spottysallrite,

        There is no guarantee that the NinjaScript Output window will function the same way as other editors in regard to using escape sequences. If you would like to have a blank line printed to the NinjaScript Output window, you would need to add Print("\n"); or Print(" "); on a separate line in your script.

        For example:

        Print("Line 1");
        Print("\n");
        Print("Line 2")


        Let us know if we may assist further.
        Last edited by NinjaTrader_BrandonH; 05-11-2022, 09:51 AM.
        <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


          #5
          Well, I'd appreciate it if this normal feature of C# would be active. Why is it not active?

          Comment


            #6
            Hello spottysallrite,

            Thanks for your note.

            The current way the NinjaScript Output window works is you would need to add a Print("\n"); or Print(" "); on a separate line in your script to have a blank line printed to the Output window.

            We are tracking interest for this in an internal ticket and I have added your vote.

            The internal tracking number for your feature request is SFT-5524. Please reference this internal tracking number when contacting Platform Support if you ever have questions regarding this feature request.

            When a feature request is implemented, you'll find a description of the new feature in the release notes:Let us know if we may assist further.
            <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


              #7
              Shortcomings of the current implementation aside, I use this:
              Code:
              private static readonly string nl = Environment.NewLine;
              ...
              Print("Whatever" + nl + "Something else");
              Hope that helps.

              Thanks.
              Multi-Dimensional Managed Trading
              jeronymite
              NinjaTrader Ecosystem Vendor - Mizpah Software

              Comment


                #8
                Ahh, good idea!

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by NullPointStrategies, Today, 05:17 AM
                0 responses
                52 views
                0 likes
                Last Post NullPointStrategies  
                Started by argusthome, 03-08-2026, 10:06 AM
                0 responses
                130 views
                0 likes
                Last Post argusthome  
                Started by NabilKhattabi, 03-06-2026, 11:18 AM
                0 responses
                70 views
                0 likes
                Last Post NabilKhattabi  
                Started by Deep42, 03-06-2026, 12:28 AM
                0 responses
                44 views
                0 likes
                Last Post Deep42
                by Deep42
                 
                Started by TheRealMorford, 03-05-2026, 06:15 PM
                0 responses
                48 views
                0 likes
                Last Post TheRealMorford  
                Working...
                X