Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Scrip oco

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

    Scrip oco

    Hello, I want you to send two orders, a BUYSTOP and SELLSTOP, given the conditions of my strategy, according to a level defined by my strategy, and that when one is filled, it cancels the other. And I looked for the information but everything is referred to the DOM. I want to program the script. Thank you!

    #2
    Hello Misel,

    Thank you for your post.

    The Managed approach contains Set methods such as SetProfitTarget and SetStopLoss that could be used to place One Cancels Other (OCO) orders. This means that two orders could be placed and are tied together by an OCO Id. When one order is filled, the other order is canceled.

    Please see the attached SetMethodsSample example which demonstrates how to use SetProfitTarget and SetStopLoss to place a profit target and stop-loss when an entry order is filled.

    Also, please see this help guide link about using the Managed approach - https://ninjatrader.com/support/help...d_approach.htm

    The Unmanaged approach is able to use the OCO feature also and would need to be used for bracketed entry orders.

    Please see the attached UnmanagedTemplate example which demonstrates how you could use the Unmanaged approach to accomplish this.

    Also, please review this help guide link about using the Unmanaged approach - https://ninjatrader.com/support/help...d_approach.htm

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

    Comment


      #3
      Thanks for the reply, I mean to put a buy order and a sell order each at a certain level. If you fill the sell order, you cancel the unfilled purchase order. If you fill the purchase order, you cancel the unfilled sell order. After filling the order, whether it is to buy or sell, the target and stop are designated there.
      The problem I have is that it only places a buy or a sell order and not both at the same time.


      Click image for larger version

Name:	orders.png
Views:	101
Size:	9.9 KB
ID:	1127444
      Attached Files

      Comment


        #4
        Hello Misel,

        Thank you for your note.

        The UnmanagedTemplate example attached in the previous post demonstrates how you could submit buy and sell entry orders that are tied together using an OCO Id. The way this works is that the strategy submits the buy and sell entry orders and if the buy entry order is filled, the sell entry order is canceled and a profit target and stop-loss are placed for the buy entry order that was filled.

        Please see the video in the link below which shows the UnmanagedTemplate example doing this.



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

        Comment


          #5
          OK thank you very much. Cheers!

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by gentlebenthebear, Today, 01:30 AM
          1 response
          8 views
          0 likes
          Last Post NinjaTrader_Jesse  
          Started by Aviram Y, Today, 05:29 AM
          1 response
          7 views
          0 likes
          Last Post NinjaTrader_ChelseaB  
          Started by cls71, Today, 04:45 AM
          1 response
          7 views
          0 likes
          Last Post NinjaTrader_ChelseaB  
          Started by TradeForge, Today, 02:09 AM
          1 response
          22 views
          0 likes
          Last Post NinjaTrader_ChelseaB  
          Started by elirion, Today, 01:36 AM
          2 responses
          14 views
          0 likes
          Last Post elirion
          by elirion
           
          Working...
          X