Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

CreateOrder(..) works but stop and limit get cancelled?

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

    CreateOrder(..) works but stop and limit get cancelled?

    deleted...
    Last edited by defa0009; 09-20-2024, 03:37 PM.

    #2
    Hello defa0009,

    Thank you for your post.

    What's the trick to get all 3 orders to stick and tied to each other?
    You can tie them via OCO. I recommend taking a look at ProfitChaseStopTrailAddonExample and/or ProfitCaseStopTrailIndicatorExample, these scripts demonstrate how to tie your orders together via OCO.



    And how do you how close a specific market order? Using the entryOrder example above is this the way to do it?
    Things like FromEntrySignal is also only used with the Managed Approach to tie Enter and Exit orders together. There is no fromEntrySignal parameter when using CreateOrder(). We can specify a name for the order for your own tracking, but there isn't anything internal to these approaches to tie orders together (other than OCO) because you are working with the orders at a lower level where there is no order management layer like the Managed Approach.

    Please let us know if you have any further questions.

    Comment


      #3
      Hello,

      Yes, in OrderUpdate we check that the entry order has been created then create the PT and SL orders and link them via OCO.

      I don't see in this code that you have specified an OCO ID. You need to link the entry, SL, and TP orders with the same OCO ID, otherwise the one-cancels-other logic won't trigger.

      Market orders can't use OCO since they fill immediately. Only limit or stop market orders can be used with OCO.
      Last edited by NinjaTrader_Gaby; 09-04-2024, 10:10 AM.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Geovanny Suaza, 02-11-2026, 06:32 PM
      0 responses
      553 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
      100 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by Geovanny Suaza, 02-02-2026, 12:30 PM
      0 responses
      543 views
      1 like
      Last Post Geovanny Suaza  
      Started by RFrosty, 01-28-2026, 06:49 PM
      0 responses
      546 views
      1 like
      Last Post RFrosty
      by RFrosty
       
      Working...
      X