Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Flush Print buffer

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

    Flush Print buffer

    After starting a strategy, NT buffers output from the Print command until the last historical bar has been processed and real-time begins before writing the buffered output to the Output window.

    How does one flush the Print buffer on demand so that at any time from starting a strategy (even during historical processing), the output from the Print command can be flushed to the Output window?

    Thanks!

    #2
    Hello jeronymite,
    You can use the ClearOutputWindow to clear the output window. Please refer to our help guide to know more.
    http://www.ninjatrader.com/support/h...tputwindow.htm
    JoydeepNinjaTrader Customer Service

    Comment


      #3
      Thanks, Joydeep. That is not what I want to do, however.

      I need the accumulated buffered output to appear in the Output window on demand, rather than wait until NT decides to show it.

      Like this: Print.Flush() to show all currently buffered output in the Output window.

      Thanks.

      Comment


        #4
        Hello jeronymite,
        Thanks for the clarification.

        Unfortunately there are no native way to do it. You can however custom code further and achieve it using C# codes.

        For example you could collect all the messages in a list of strings and then choose to "flush" it in the Output Window

        Code:
        //in variable 
        List<string> list = new List<string>();
        
        //in OnBarUpdate
        
        //add the custom messages in the list
        if (condition)
        list.Add("my message");
        
        //flush it to the output window
        if (condition)
        {
                foreach (string str in list)
        	{
        		Print(str);
        	}
        }
        JoydeepNinjaTrader Customer Service

        Comment


          #5
          Thanks, Joydeep.

          That will not work either, I'm sorry. I use the Print command directly in my script, so there is no need to create lists of strings to Print later as that only complicates the matter.

          The Print command sends output to a buffer that is eventually written to the Output window. When starting a strategy, historical bars are processed and then real-time bars. It is during the processing of the historical bars that NT buffers all the Print'ed output until the real-time bars are reached, at which point, NT flushes the buffer and the output appears in the Output window. None of the output during that historical processing is visible until the real-time bars are reached and the Print buffer is flushed.

          I want to be able to flush the buffered Print'ed output on demand so that it appears in the Output window during this historical bar processing and before the real-time bars are reached.

          Essentially, what is the C# code that says "flush what is currently in the Print buffer to the Output window now"?

          Thanks again for your assistance.

          Comment


            #6
            Hello jeronymite,
            Unfortunately it is not possible to do so.

            You may create your own form / Output window using C# codes, however nothing we could support.
            JoydeepNinjaTrader Customer Service

            Comment


              #7
              OK. Thanks, Joydeep.

              May I request that this be added to a future release of NT so that it is possible to do this, please?

              Thanks!

              Comment


                #8
                Hello jeronymite,
                Thanks for your feedback.

                I will forward your feature request to development for future consideration.
                JoydeepNinjaTrader Customer Service

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by WHICKED, Today, 11:42 AM
                0 responses
                5 views
                0 likes
                Last Post WHICKED
                by WHICKED
                 
                Started by srbdoc, Today, 11:39 AM
                1 response
                2 views
                0 likes
                Last Post NinjaTrader_Eleanore  
                Started by rustyspring, Today, 10:55 AM
                2 responses
                11 views
                0 likes
                Last Post rustyspring  
                Started by collic653, Today, 10:05 AM
                3 responses
                20 views
                0 likes
                Last Post collic653  
                Started by ErikY, Today, 10:09 AM
                5 responses
                20 views
                0 likes
                Last Post s.kinra
                by s.kinra
                 
                Working...
                X