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.
    JesseNinjaTrader Customer Service

    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 Waxavi, Today, 02:10 AM
        1 response
        16 views
        0 likes
        Last Post NinjaTrader_LuisH  
        Started by Kaledus, Today, 01:29 PM
        5 responses
        13 views
        0 likes
        Last Post NinjaTrader_Jesse  
        Started by Waxavi, Today, 02:00 AM
        1 response
        12 views
        0 likes
        Last Post NinjaTrader_LuisH  
        Started by alifarahani, Today, 09:40 AM
        5 responses
        23 views
        0 likes
        Last Post NinjaTrader_Jesse  
        Started by gentlebenthebear, Today, 01:30 AM
        3 responses
        17 views
        0 likes
        Last Post NinjaTrader_Jesse  
        Working...
        X