Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Print not a static method

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

    Print not a static method

    Why is the NinjaTrader Print apparently not a static method in the Strategy namespace? I have a private class in a strategy, and the compiler complains if I put a Print statement in a method in the class - although I can put a Log statement in the method and the compiler does not complain. Even during debugging I would prefer not to clutter up the log window more than it already is.
    Jack

    #2
    Hello,

    Thank you for the question.

    The Print method is an inherited method of Strategy or Indicator types, outside of these types Print does not exist as you have mentioned it is not static.

    NinjaTrader 7 was not originally intended to edit other types besides Indicator or Strategy so there is really not a specific use case in NT7 for having int static. Going forward this was taken into account in NT8 and now there is a Output.Process method which is static.

    Unfortunately in NT7 to utilize a print in a custom class, you would likely also need to pass the instance of the indicator or strategy to the class so you can access its public methods.

    for NT8, you could see this documentation regarding the new forms of debugging: http://ninjatrader.com/support/helpG...output.process

    Please let me know if I may be of further assistance.
    Last edited by NinjaTrader_Jesse; 05-09-2016, 12:21 PM.

    Comment


      #3
      Apologies, I neglected to mention I am using NT8. I do not find any documentation for Output.Process, and the compiler complains that the name Output does not exist in the current context (custom Strategy in NT8 which otherwise compiles).

      Comment


        #4
        You probably already solved this but you can do this via:

        Code:
        NinjaTrader.Code.Output.Process(....);

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        656 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        371 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        109 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        574 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        579 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X