Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Print Statements not showing up in Output Window

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

    Print Statements not showing up in Output Window

    Hi all,

    I started doing my monthly updates to my trading scripts, and Ninjatrader 8 doesn't seem to want to print "Print" statements anymore, in either Output 1 or Output 2.

    Here's what I'm looking at. I'm essentially wanting these to print at the first tick of every 20 tick bar:

    Code:
    for (xCount=0; xCount<BUpper.Length; xCount++)
    					{	
    						BUpper[xCount] = Math.Round(Bollinger(2,12).Upper[xCount],2);;
    						BMiddle[xCount] = Math.Round(Bollinger(2,12).Middle[xCount],2);;
    						BLower[xCount] = Math.Round(Bollinger(2,12).Lower[xCount],2);;
    						BSpread[xCount] = Math.Round((BUpper[xCount] - BLower[xCount]) * 100, 0);
    						
    						Print("BUpper[" + xCount + "] = " + BUpper[xCount]);
    						Print("BMiddle[" + xCount + "] = " + BMiddle[xCount]);
    						Print("BLower[" + xCount + "] = " + BLower[xCount]);
    						Print("BSpread[" + xCount + "] = " + BSpread[xCount]);
    						Print("-----------------------------------------------");
    					}
    This is just one example. The code is fine. It's just that the strategy, working against a simulated data feed on "Global 24x7" and showing bars, isn't outputting anything to the output window.

    There's also this code outside the for loop:
    Code:
    Print("BRange_UpperDirection = " + BRange_UpperDirection);
    					Print("BRange_MiddleDirection = " + BRange_MiddleDirection);
    					Print("BRange_LowerDirection = " + BRange_LowerDirection);
    					Print("====================================================");

    Starting and restarting Ninjatrader 8 doesn't seem to get anywhere. What else should I try?

    #2
    Hello Spiderbird,

    Thanks for your post.

    When you run your scripts, do you see any error messages in the "log" tab of the control center?

    If not, if you add a simple unconditional print statement as the first statement under OnBarUpdate() do you see any print in the output? For example Print ("OBU");

    If you do see the OBU print then you would need to keep debugging by moving or adding further print statements down in your code.

    If you do not see OBU print and do not see any error messages in the log tab then please send your log and trace files into platform support. Mark the e-mail Atten: Paul and include a link to this thread.

    Please follow the steps below to manually attach your log and trace files to your email:
    • Open your NinjaTrader folder under My Documents.
    • Right click on the 'log' and 'trace' folders and select Send To> Compressed (zipped) Folder.
    • Send the 2 compressed folders as attachments to your email.
    • Once complete, you can delete these compressed folders.

    Comment


      #3
      Hi Paul,

      Thanks for the involved write-up and the help. It ended up being a matter of resetting the Sim account, and disabling/re-enabling the script. All set. Thanks a lot!

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by CarlTrading, 03-31-2026, 09:41 PM
      1 response
      43 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by CarlTrading, 04-01-2026, 02:41 AM
      0 responses
      20 views
      0 likes
      Last Post CarlTrading  
      Started by CaptainJack, 03-31-2026, 11:44 PM
      0 responses
      30 views
      1 like
      Last Post CaptainJack  
      Started by CarlTrading, 03-30-2026, 11:51 AM
      0 responses
      48 views
      0 likes
      Last Post CarlTrading  
      Started by CarlTrading, 03-30-2026, 11:48 AM
      0 responses
      38 views
      0 likes
      Last Post CarlTrading  
      Working...
      X