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 NullPointStrategies, Today, 05:17 AM
      0 responses
      50 views
      0 likes
      Last Post NullPointStrategies  
      Started by argusthome, 03-08-2026, 10:06 AM
      0 responses
      126 views
      0 likes
      Last Post argusthome  
      Started by NabilKhattabi, 03-06-2026, 11:18 AM
      0 responses
      69 views
      0 likes
      Last Post NabilKhattabi  
      Started by Deep42, 03-06-2026, 12:28 AM
      0 responses
      42 views
      0 likes
      Last Post Deep42
      by Deep42
       
      Started by TheRealMorford, 03-05-2026, 06:15 PM
      0 responses
      46 views
      0 likes
      Last Post TheRealMorford  
      Working...
      X