Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Access to NinjaTrader built-in functions from classes

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

    Access to NinjaTrader built-in functions from classes

    Is there any way through namespace constructs to access the built-in functions from my own class within a strategy? In other words, if you say "SubmitOrder(..." from within a function within the "Strategy" namespace it works just fine. But if you define a class and it has a method that calls "SubmitOrder(..." it gives an error. So then I tried the following:

    public class myOrderHandling: Strategy{
    public void enter(double limit){
    SubmitOrder(0, OrderAction.Buy, OrderType.Limit, 1, limit, 0, "", "1st entry");
    }
    }

    And this compiled. What I did was to inherit from "Strategy" in order to access "SubmitOrder." Will this work?

    #2
    tradetree, while it might be work for you, this inheritance is unfortunately not supported.

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by charlesugo_1, 05-26-2026, 05:03 PM
    0 responses
    60 views
    0 likes
    Last Post charlesugo_1  
    Started by DannyP96, 05-18-2026, 02:38 PM
    1 response
    147 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 05-11-2026, 05:56 AM
    0 responses
    161 views
    0 likes
    Last Post CarlTrading  
    Started by CarlTrading, 05-10-2026, 08:12 PM
    0 responses
    97 views
    0 likes
    Last Post CarlTrading  
    Started by Hwop38, 05-04-2026, 07:02 PM
    0 responses
    284 views
    0 likes
    Last Post Hwop38
    by Hwop38
     
    Working...
    X