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

AddOn Order Creation and Submission

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

    AddOn Order Creation and Submission

    In an AddOn, with identical Order parameters, is there any practical difference between these two approaches:
    1. Use Account.CreateOrder to create an Order then submit with Account.Submit
    2. Create an Order with new Order() (including the Account parameter) then submit with Account.Submit
    The only practical difference I can see so far is simply that with Account.CreateOrder, it seems the Order is immediately entered into the NT database, whereas with new Order(), it is only entered after it is submitted. The practical consequence of this is that if an Order is subsequently not submitted for some reason, it cannot easily be removed from the NT database if one has used Account.CreateOrder.

    Comments on these two approaches (strengths/weaknesses) appreciated.

    Thanks.
    Last edited by jeronymite; 01-17-2022, 05:40 PM.
    Multi-Dimensional Managed Trading
    jeronymite
    NinjaTrader Ecosystem Vendor - Mizpah Software

    #2
    Hello jeronymite,

    Thanks for writing in.

    When using the AddOn Approach, it is best practice to use CreateOrder() to create an order. That order could then be submitted by calling Account.Submit(). It is not suggested to create new order objects with new Order().

    Note that you are welcome to do other things, such as using new Order(), but you would need to navigate those paths on your own since it goes against best practices. That said, this thread will be open for community feedback as well.

    See the help guide documentation below for more information.
    CreateOrder(): https://ninjatrader.com/support/help...reateorder.htm
    Submit(): https://ninjatrader.com/support/help...nt8/submit.htm

    Let us know if we may assist further.
    Brandon H.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by jaybedreamin, Today, 05:56 PM
    0 responses
    2 views
    0 likes
    Last Post jaybedreamin  
    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  
    Working...
    X