Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

OCO orders

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

    OCO orders

    I am using EnterLongStop() to place an order. As soon as that order gets filled, I need to place both an ExitLongStop and an ExitLongLimit such that as soon as one of these exit orders are executed, the other is canceled. Additionally, both of these exit orders will depend on the real price of the EnterLong order which is only known after this order is executed.

    Whats is the best way to place such an OCO-exit-order?

    #2
    Hello,
    You can submit logic for when an order is filled by placing the order submission logic into the OnExecution() event method. In addition to having logic entered into this method you can use IExecution to get information such as price which you could use to set a variable to submit your exit orders based off of.
    You would need to use the Unamanaged Approach to submit OCO orders, this would not be possible using the Managed Approach.
    In addition to the help guide sections hyperlinked about I would recommend that you review our reference sample on Using OnOrderUpdate() and OnExecution() methods to submit protective orders

    If you have any further questions please let us know.
    Last edited by NinjaTrader_CodyB; 06-16-2016, 02:02 PM.
    Cody B.NinjaTrader Customer Service

    Comment


      #3
      In the sample you mentioned:

      What happens to the targetOrder if the stopOrder is executed and what happens to the stopOrder if the targetOrder gets executed? There is no explicit CancelOrder in the sampleCode. Does one of these orders implicitely cancel the other?

      Comment


        #4
        Hello,
        Once a managed position is closed any pending Exit order method(ExitLongLimit, ExitLongStop, SetStopLoss, SetProfitTarget, etc) is cancelled.
        Cody B.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by knowmad, Today, 03:52 AM
        0 responses
        7 views
        0 likes
        Last Post knowmad
        by knowmad
         
        Started by tradingnasdaqprueba, Today, 03:42 AM
        0 responses
        6 views
        0 likes
        Last Post tradingnasdaqprueba  
        Started by Haiasi, 04-25-2024, 06:53 PM
        4 responses
        63 views
        0 likes
        Last Post effraenk  
        Started by ccbiasi, 11-23-2017, 06:06 AM
        5 responses
        2,203 views
        0 likes
        Last Post leodavis  
        Started by kujista, Yesterday, 12:39 AM
        2 responses
        14 views
        0 likes
        Last Post kujista
        by kujista
         
        Working...
        X