Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by hazylizard, Today, 08:38 AM
    4 responses
    10 views
    0 likes
    Last Post hazylizard  
    Started by geddyisodin, Today, 05:20 AM
    2 responses
    18 views
    0 likes
    Last Post geddyisodin  
    Started by Max238, Today, 01:28 AM
    5 responses
    47 views
    0 likes
    Last Post Max238
    by Max238
     
    Started by giulyko00, Yesterday, 12:03 PM
    3 responses
    13 views
    0 likes
    Last Post NinjaTrader_BrandonH  
    Started by habeebft, Today, 07:27 AM
    1 response
    16 views
    0 likes
    Last Post NinjaTrader_ChristopherS  
    Working...
    X