Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

question about unmanaged

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

    question about unmanaged

    good day, please help, I'm trying to understand the unmanaged mode, I decided to do a little strategy with placing orders, but for some reason they don't open, could you please tell me what my error is? Below attached code.
    Attached Files

    #2
    Originally posted by Papercut110 View Post
    good day, please help, I'm trying to understand the unmanaged mode, I decided to do a little strategy with placing orders, but for some reason they don't open, could you please tell me what my error is? Below attached code.
    Have you first tried experimenting with market orders?
    These may be easier to get started with than the Limit entry
    orders you're trying to use.

    Another problem I see: your entryOrder never gets set back
    to null after the entry order is filled.

    Otherwise, your use of SubmitOrder() looks fine to me.

    On a possibly different note ...

    Your OnExecution is not robust enough.

    If DefaultQuantity > 1 expect problems with partial fills,
    since I see your OnExecution doesn't handle that.

    Partial fills for your protective stop and profit target will
    also fail for similar reasons.

    Why? OnExecution is called for every fill or partial fill of
    every order: whether entry, stop, or target.

    Consider this:
    Your stop order gets partial filled which invokes OnExecution
    where your code sets a new stop and target order (which
    is obviously not what you will be wanting).

    You will only see these major problems with DefaultQuantity > 1
    but never with strategy analyzer (which doesn't do partial fills).

    You can allow/deny partial fills in Sim101 via the Options dialog.

    Study this reference tutorial here for some ideas on a better
    and more robust OnExecution:

    The OnOrderUpdate() and OnExecution() methods are reserved for experienced programmers. Instead of using Set() methods to submit stop-loss and profit target orders, you can submit and update them manually through the use of IOrder and IExecution objects in the OnOrderUpdate() and OnExecution() methods. The OnOrderUpdate()

    Comment


      #3
      Hello Papercut110,

      Thank you for your post.

      bltdavid provides some good insight into what you are performing. I would also recommend implementing debugging techniques such as TraceOrders so that you can see what is happening with the orders. I would also recommend checking the Log tab of the Control Center for any messages on your orders.

      For information on TraceOrders please visit the following link: http://ninjatrader.com/support/forum...ead.php?t=3627

      Please let me know if you have any questions.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Geovanny Suaza, 02-11-2026, 06:32 PM
      0 responses
      558 views
      0 likes
      Last Post Geovanny Suaza  
      Started by Geovanny Suaza, 02-11-2026, 05:51 PM
      0 responses
      324 views
      1 like
      Last Post Geovanny Suaza  
      Started by Mindset, 02-09-2026, 11:44 AM
      0 responses
      101 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by Geovanny Suaza, 02-02-2026, 12:30 PM
      0 responses
      545 views
      1 like
      Last Post Geovanny Suaza  
      Started by RFrosty, 01-28-2026, 06:49 PM
      0 responses
      547 views
      1 like
      Last Post RFrosty
      by RFrosty
       
      Working...
      X