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

Debugging with Print

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

    Debugging with Print

    Hi,

    I am trying to debug an indicator code using Print statements. I have a number of custom methods and when I try to use Print I get the following error message:

    Indicator XXX.cs An object reference is required for the non-static field, method, or property 'NinjaTrader.Indicator.IndicatorBase.Print(string) ' CS0120 - click for info

    Is there a way to use Print for debugging outside its scope?

    Incidentally, I also tried using System.Diagnostics.Debug.Print. This compiles but can't find the output.

    Any suggestions would be greatly appreciated. Thank you.

    #2
    Printed outputs within NinjaTrader can be found by going to tools -> outputwindow

    unfortunately, you won't be able to print from outside the indicator

    You will need to use the following from within the script
    Print("debug text here");



    For more tips on debugging: http://www.ninjatrader.com/support/f...ead.php?t=3418
    I tend to favor the use of Drawing objects over print statements as this allows me to see the exact point of the crash on the chart visually. (drawn objects will remain on the chart up until the crash point)

    For external debugging you could go the Visual studio route: http://www.ninjatrader.com/support/h..._debugging.htm
    It says the express version isn't supported but I believe I've been able to get the newest express version to work with it.

    Let me know if I can further assist.
    LanceNinjaTrader Customer Service

    Comment


      #3
      Thanks Lance. I am aware of how to use the Print statement from inside an indicator and I am aware of debugging gin VS. I was hoping it would be a simple thing to perhaps instantiate Print to work outside an indicator.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by AdamDJ8, Today, 09:18 PM
      0 responses
      2 views
      0 likes
      Last Post AdamDJ8
      by AdamDJ8
       
      Started by knowmad, Today, 03:52 AM
      2 responses
      27 views
      0 likes
      Last Post knowmad
      by knowmad
       
      Started by ETFVoyageur, Today, 07:05 PM
      0 responses
      10 views
      0 likes
      Last Post ETFVoyageur  
      Started by Orion815, 05-02-2024, 08:39 AM
      2 responses
      18 views
      0 likes
      Last Post Orion815  
      Started by suroot, 02-25-2017, 04:43 AM
      11 responses
      2,554 views
      0 likes
      Last Post Zilvercat  
      Working...
      X