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 Mindset, 04-21-2026, 06:46 AM
      0 responses
      89 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by M4ndoo, 04-20-2026, 05:21 PM
      0 responses
      135 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Started by M4ndoo, 04-19-2026, 05:54 PM
      0 responses
      68 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Started by cmoran13, 04-16-2026, 01:02 PM
      0 responses
      119 views
      0 likes
      Last Post cmoran13  
      Started by PaulMohn, 04-10-2026, 11:11 AM
      0 responses
      69 views
      0 likes
      Last Post PaulMohn  
      Working...
      X