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 Mindset, 04-21-2026, 06:46 AM
                0 responses
                97 views
                0 likes
                Last Post Mindset
                by Mindset
                 
                Started by M4ndoo, 04-20-2026, 05:21 PM
                0 responses
                141 views
                0 likes
                Last Post M4ndoo
                by M4ndoo
                 
                Started by M4ndoo, 04-19-2026, 05:54 PM
                0 responses
                68 views
                0 likes
                Last Post M4ndoo
                by M4ndoo
                 
                Started by cmoran13, 04-16-2026, 01:02 PM
                0 responses
                125 views
                0 likes
                Last Post cmoran13  
                Started by PaulMohn, 04-10-2026, 11:11 AM
                0 responses
                76 views
                0 likes
                Last Post PaulMohn  
                Working...
                X