• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

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:

    http://ninjatrader.com/support/forum...ead.php?t=7499

    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.
      Patrick H.NinjaTrader Customer Service

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by superkolleech, Today, 12:46 AM
      1 response
      11 views
      0 likes
      Last Post MojoJojo  
      Started by davidwade, Today, 02:51 AM
      0 responses
      3 views
      0 likes
      Last Post davidwade  
      Started by aviat72, 04-26-2020, 09:41 PM
      10 responses
      92 views
      0 likes
      Last Post kissandfly  
      Started by healthooa, Today, 01:28 AM
      0 responses
      7 views
      0 likes
      Last Post healthooa  
      Started by harjinderjit, Yesterday, 08:24 PM
      0 responses
      20 views
      0 likes
      Last Post harjinderjit  
      Working...
      X