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

Account.Submit() and AddOn order submission

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

    Account.Submit() and AddOn order submission

    Hello community,

    I am requesting a sample script which demonstrates airtight usage of the Account.Submit() method and AddOn trade management in general.

    The reason for this is because in the documentation there are a lot of intimidating disclaimers outlining how this method is for advanced programmers and improper usage of it can have serious adverse effects on one's trading account. And I'm starting to believe them! for example, when I implemented this method everything seemed to be working properly, but then I noticed that I had 22 pending orders that the control center wouldn't even allow me to cancel manually.

    Any script that demonstrates usage would be great. Or multiple scripts that do different things for that matter, the more demonstration the better. Thank you!

    #2
    Hello lunardiplomacy,

    Thanks for the post.

    The most complete sample I am aware of would be the basic addon sample: https://ninjatrader.com/support/help...t_overview.htm
    That demonstrates the Submit() method in a few ways however the uses are tailored to that sample.

    To detail this further in contrast to your question of it being airtight, that is really going to be subjective of the situation where the syntax is used. While the addon will work in most cases it is put in that is because the order types used and other logic it has in it compliments that use. From your description it sounds like you may have just missed some part to complete the logical loop to prevent extra orders.

    The reason this is documented as advanced is that the general expectation surrounding these sections would be that you are under the full control of development and debugging that code. This area of the help guide works more or less as an open API for you to interface with in whatever means you want and within reason of what your broker allows. The addon sample would be the "general" expectation of how that method can be used but the submit method can be used from any NinjaScript type and in may ways.

    What I could suggest for your existing file would be to try and gather some details on why it submitted more orders than you were expecting. With that information it may be more apparent on what is missing. If I was guessing it may be an order variable was not set or some part of the entry condition was stuck true to allow it.

    In regard to cancelling the orders, if that was a live order I would not expect that you cannot cancel it. You would need to call the broker if that is happening and ensure you are closed out. If that was a Sim order that may be a result of the order types and situation being presented, you can reset the sim account to clear those orders. If you are seeing this on sim with some specific orders/use case we could explore that further with more details about what was being done.


    I look forward to being of further assistance.



    JesseNinjaTrader Customer Service

    Comment


      #3
      Jesse, thanks for getting back to me. Your response was refreshingly thorough. And yes haha, it was a sim account, I would have to be a moron to use my live account without fully understanding the submission approach that I'm using.

      I think I am just going to have to go through trial and error and read the documentation some more.

      Thanks again, Jesse.

      Comment


        #4
        I'd like to chime in here; and advocate for more documentation emphasis
        on the "non-NinjaScript editor" methods of developing assembly DLL
        based complex developments.

        This relates to AddOnBase derived developments which include
        discussion of Order Entry, as well as AddOnBase state management
        and activation/deactivation of these facilities. Commercial partners
        offering complex AddOn no doubt have access to documentation
        in these areas.

        I realize that the support team needs to "draw the line" at just what can
        be supported. I'm adapting a Strategy to operate in the AddOn
        environment; because of the inherent stability which this will offer.

        But there is a lot of trial and error involved, and hunting for key
        documentation; and it seems to me that there is
        really only a single example of a Visual Studio AddOn example; which
        is heavily weighted toward just simple WPF forms and click actions.

        When code is deployed as an Assembly DLL; my experience so far
        tells me that it just can't be done with the usual NinjaScript single-class
        Indicator/Strategy mechanism; and requires a more advanced
        approach which involves using the AddOnBase derived class
        hierarchy, and a very different approach to development.

        Once again, I realize that what is possible in NinjaTrader is so
        vast, that the official policy needs to be that most of it is
        "unsupported" since, otherwise, your resources would be
        overrun by developers' requests. But more emphasis on available
        more complex examples of AddOn usage would help us.

        hyperscalper

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by DJ888, 04-16-2024, 06:09 PM
        6 responses
        18 views
        0 likes
        Last Post DJ888
        by DJ888
         
        Started by Jon17, Today, 04:33 PM
        0 responses
        1 view
        0 likes
        Last Post Jon17
        by Jon17
         
        Started by Javierw.ok, Today, 04:12 PM
        0 responses
        6 views
        0 likes
        Last Post Javierw.ok  
        Started by timmbbo, Today, 08:59 AM
        2 responses
        10 views
        0 likes
        Last Post bltdavid  
        Started by alifarahani, Today, 09:40 AM
        6 responses
        41 views
        0 likes
        Last Post alifarahani  
        Working...
        X