Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How do I set unbuffered print?

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    How do I set unbuffered print?

    It appears to me that Print() output is buffered. When I do an F5, my chart redraws and then the Print() stuff comes out afterwards

    How do I set it so that Print() output comes as it is generated?

    (Think of it as Unix stdout vs stderr)

    --EV

    #2
    Print() is buffer for performance reasons. Unfortunately unbuffered Print() is not supported.

    Comment


      #3
      Understood.

      My observation is that I do not care in the least about performance optimizing Print() when I am debugging. I suppose there can be cases where I would, but not most of the time for me. For my debugging, buffered output is a really bad choice. There is no performance concern then, and the lack of timely output can be killer. For example, right now I am trying to figure out a crash. Buffered output means getting no output at all. That's a problem.

      I have not tried, but perhaps you can tell me to save me time experimenting -- is there any alternative way to write to the output window, perhaps the normal C# console write stuff, that is unbuffered?

      Note: this is the Unix stderr / stdout discussion all over again. Please do as Unix does, and allow me my choice of which to use.

      Thanks,
      EV

      Comment


        #4
        Unfortunately only buffered Print() is supported. I believe in another thread of yours I tried to explain that NinjaTrader is not an "open framework" which you probably have in mind. We provide with NinjaScript a clearly defined and documented path which > 95% of our users are looking for. Trying to explore the options beyond that path may work or may fail. In no event we would provide support for that.

        Thanks for your understanding

        Comment


          #5
          What in the world does choosing buffered vs unbuffered print capability have to do with a framework, open or otherwise?

          I would expect the main use of Print() is for debugging for those of us without a Visual Studio version that you support. I could care less whether it is part of the framework.

          I am asking that you please at least add to the list of requested features that unbuffered printing be available in a future release.

          --EV

          Comment


            #6
            Thanks for your suggestion. We'll add it to the list of future considerations.

            Comment


              #7
              Have you tried stepping through the chart bar by bar? In that event, Print() is effectively unbuffered. Actually, that is the way that I debug using Print() statements, because to the immediacy of the output.

              Comment


                #8
                That's a good suggestion, and I usually do.

                In this case, I was not getting far enough to do that.

                I found and fixed the bug, so now I am back to normal, doing as you also do -- bar by bar.

                -- EV

                Comment


                  #9
                  Originally posted by NinjaTrader_Dierk View Post
                  Unfortunately only buffered Print() is supported.
                  Dierk,

                  If I get an exception is any buffered output that has not yet been printed displayed?

                  I just ran across a case where it looks to me as if the buffered ouptut not yet displayed got lost when I got that exception.

                  --EV

                  Comment


                    #10
                    AFAIK the exception handling in VS halts all threads and timers (you may consult with MS support on details how VS debugging works). I believe this may result in Output window not being populated.

                    Comment


                      #11
                      Originally posted by NinjaTrader_Dierk View Post
                      AFAIK the exception handling in VS halts all threads and timers (you may consult with MS support on details how VS debugging works). I believe this may result in Output window not being populated.

                      I believe you.

                      I know that you have been skeptical of the need for an unbuffered print capability, even for debugging. The fact that an exception loses any undisplayed buffered output is a very good reason why, for debugging, we NEED unbuffered printing. When debugging we need to see all output, right up until that exception.

                      I fully understand why a live indicator that uses Print() should be using a buffered Print(). Debugging is another case, though -- it requires unbuffered Print() to be sure that all of its output actually gets out.

                      Please take seriously my request that the next release support unbuffered print, somehow. It can be a call that does unbuffered output, it can be setting a flag ... I do not care, as long as it is available.

                      --EV

                      Comment


                        #12
                        I'm not sure what else to say than what I already did in my posts below: it's not supported at this time. However, we have added it to our of future considerations. Thanks

                        Comment


                          #13
                          I understand that it is not available in the current release.

                          The only reason I posted again is that I had the impression that you did not take the need for it very seriously. To me, the exception example illustrates the need, so I am hoping that it convinces you to take the need seriously.

                          As long as whoever evaluates it for inclusion in the next release actually understands why it is important, I am satisfied.

                          --EV

                          Comment


                            #14
                            We take all product enhancement requests seriously including yours and as such, your suggestion has been added to our list for review. I can assure you that all people involved in making decisions on what to include/exclude in future updates take the time to understand the nature of the request.
                            RayNinjaTrader Customer Service

                            Comment

                            Latest Posts

                            Collapse

                            Topics Statistics Last Post
                            Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                            0 responses
                            574 views
                            0 likes
                            Last Post Geovanny Suaza  
                            Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                            0 responses
                            333 views
                            1 like
                            Last Post Geovanny Suaza  
                            Started by Mindset, 02-09-2026, 11:44 AM
                            0 responses
                            101 views
                            0 likes
                            Last Post Mindset
                            by Mindset
                             
                            Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                            0 responses
                            553 views
                            1 like
                            Last Post Geovanny Suaza  
                            Started by RFrosty, 01-28-2026, 06:49 PM
                            0 responses
                            551 views
                            1 like
                            Last Post RFrosty
                            by RFrosty
                             
                            Working...
                            X