Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Callint method in another indicator

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

    Callint method in another indicator

    I would like to reuse some code already written in another indicator. Can I call a method in another indicator? If so, how do I setup the calling structure? I tried NinjaTrader.Indicator.myIndicator.myMethod() but I get errors related to 'nonstatic reference' object.

    Thanx,
    Last edited by monpere; 04-15-2008, 05:26 PM.

    #2
    Try making the method "public static" instead of public etc...
    RayNinjaTrader Customer Service

    Comment


      #3
      Calling method in another indicator

      Thanks, that worked, but I can't use 'Print' inside the 'public static' method. How do I print to the output window from inside a static method.


      Originally posted by NinjaTrader_Ray View Post
      Try making the method "public static" instead of public etc...

      Comment


        #4
        >> How do I print to the output window from inside a static method.
        You can't since you'll need reference to an indicator where you could call Print() on.

        Comment

        Latest Posts

        Collapse

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