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 cmoran13, Yesterday, 01:02 PM
    0 responses
    28 views
    0 likes
    Last Post cmoran13  
    Started by PaulMohn, 04-10-2026, 11:11 AM
    0 responses
    18 views
    0 likes
    Last Post PaulMohn  
    Started by CarlTrading, 03-31-2026, 09:41 PM
    1 response
    160 views
    1 like
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 04-01-2026, 02:41 AM
    0 responses
    95 views
    1 like
    Last Post CarlTrading  
    Started by CaptainJack, 03-31-2026, 11:44 PM
    0 responses
    148 views
    2 likes
    Last Post CaptainJack  
    Working...
    X