Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

Output Window Does Not Retain Print Statements

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

    Output Window Does Not Retain Print Statements

    Hi,

    In a simple program I added print statements intended to display on the output window. When I run the strategy analyzer I see the print statements briefly show up, but once it is finished running, the output window goes blank. How can I keep the print statements visible when the program is finished running?

    Thanks.

    #2
    Hello wooofad,

    Thank you for the post.

    From the given details it sounds like one the the scripts being used, either the strategy or one of its indicators is using ClearOutputWindow. Do you happen to have that used in your script? If so and if it is in State.Terminated that would be a cause for what you had described.



    I look forward to being of further assistance.
    JesseNinjaTrader Customer Service

    Comment


      #3
      Hi Jesse,

      To my knowledge I am not using ClearOutputWindow. This problem has also presented itself with other strategies.

      Comment


        #4
        Hello wooofad,

        Clearing the output window only happens when that method is called otherwise the output should remain in the window. It seems that something you have running is likely doing that. Have you tried closing all workpaces and opening a empty workspace for testing at this point?

        I would also suggest to try and create a new empty strategy that just has a print in OnBarUpdate for a test. Don't use any other indicators and just have a print, that will help to isolate the problem as well.

        One other test is to apply the strategy to a chart, enable it and click OK to close the strategies window and go back to the chart. This will likely clear the window, press F5 to reload the chart and restart the strategy, do you still see it being cleared? If the problem is a different strategy then running the script once without opening any strategy related settings windows could highlight that by retaining the output in that run.


        I look forward to being of further assistance.
        JesseNinjaTrader Customer Service

        Comment


          #5
          Hi,

          I closed all workspaces and opened a new one. Then I edited the program so it was only a print statement in onbarupdate. When I ran the program in strategy analyzer the same thing happened, I could see the print statements show up but once it was done running the output window went blank again.

          Comment


            #6
            Hello wooofad,

            Do you see the same happening from a chart or if you use the second test I had mentioned what is the result?

            I look forward to being of further assistance.
            JesseNinjaTrader Customer Service

            Comment


              #7
              I tried adding the strategy that prints once per onbarupdate to a live chart, and then pressing f5. I did not see any output in the output window at any point.

              Comment


                #8
                Hello wooofad,

                Did you add any conditions or anything else besides the print? The live data would not really matter in this case, we would just need OnBarUpdate to be run some amount of times from the historical data like the backtest. Pressing F5 from the chart with the straegy applied should cause it to have a popup window asking to reload, are you seeing that in testing? If not, did you apply the strategy directly to the chart or did you do it from the control center?

                If you are unable to find the cause another way to approach this is to do a clean installation and then do the test from that install without anything imported or changed. That will help to identify the problem further. You can temporarily rename the NinjaTrader 8 folder in your Documents folder to something else and then re install the platform. That will generate a new user folder to test from. After your test if you need to revert back to the old data you can remove the NinjaTrader 8 folder, then rename the original back to NinjaTrader 8.

                I look forward to being of further assistance.

                I look forward to being of further assistance.

                JesseNinjaTrader Customer Service

                Comment


                  #9
                  Woofad, I had today the same problem you mentioned in your post - text Prints() to the output window and then immediately disappears. I'm sure you solved this but if not, let me share what my problem was. I have indicators that have a "OutputDebugData" flag. At the end of my Update event I had a Print(" "); statement that I put there to delineate between one set of prints and another set. Unfortunately, I forgot to enclose that print in an if statement to test whether I should out put this. This blank character at the end of this routine (will print once per bar by the way) caused the current text in the window to disappear. I guess if you just print a blank and nothing else, it tells the output window to clear. Sort of a hack I guess.

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by ETFVoyageur, 05-07-2024, 07:05 PM
                  7 responses
                  54 views
                  0 likes
                  Last Post NinjaTrader_ChelseaB  
                  Started by dp8282, Today, 07:35 AM
                  0 responses
                  4 views
                  0 likes
                  Last Post dp8282
                  by dp8282
                   
                  Started by reynoldsn, Today, 07:23 AM
                  1 response
                  4 views
                  0 likes
                  Last Post NinjaTrader_Gaby  
                  Started by Sebastian - TwinPeaks, Yesterday, 01:31 PM
                  3 responses
                  21 views
                  0 likes
                  Last Post NinjaTrader_BrandonH  
                  Started by KonAdams, 05-07-2024, 10:53 PM
                  4 responses
                  21 views
                  0 likes
                  Last Post KonAdams  
                  Working...
                  X