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 burtoninlondon, Today, 12:38 AM
        0 responses
        5 views
        0 likes
        Last Post burtoninlondon  
        Started by AaronKoRn, Yesterday, 09:49 PM
        0 responses
        13 views
        0 likes
        Last Post AaronKoRn  
        Started by carnitron, Yesterday, 08:42 PM
        0 responses
        11 views
        0 likes
        Last Post carnitron  
        Started by strategist007, Yesterday, 07:51 PM
        0 responses
        13 views
        0 likes
        Last Post strategist007  
        Started by StockTrader88, 03-06-2021, 08:58 AM
        44 responses
        3,982 views
        3 likes
        Last Post jhudas88  
        Working...
        X