Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How to place brackets (oca/oco) orders?

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

    How to place brackets (oca/oco) orders?

    Even in TradingView PineScript, it's possible to issue OCA (one cancels another) orders (can be said as "bracket"), like:

    LongStop(myLongStopPrice);
    ShortStop(myShortStopPrice);

    so, these commands can be issued simultaneulsy on same bar, and then whichever is met, is executed.
    how can we achieve similar in NT?

    Btw, I DONT PREFER over-complicated unmanaged orders. (however, you can still mention that).

    #2
    In a nutshell, you can't do it in Managed mode. Full stop. End of story.

    Sooo, if you do want OCO orders, well, that's a major reason to use Unmanaged
    mode, precisely because OCO functionality is not possible in Managed mode.

    Lookup SubmitOrderUnmanaged, check out the "oco" or "ocoId" string.

    To submit a bracket order, such as a Buy Stop order 10 ticks above and a separate
    Sell Stop order 10 ticks below, you would call SubmitOrderUnmanaged once for each
    order, and specify the exact same ocoId string for both.

    Because these entry orders have the exact same ocoId string, after one order executes
    you are guaranteed the other order is automatically cancelled -- and that's it! No further
    coding is necessary, that little ocoId string supplies all the magic necessary to achieve
    what you're asking.

    Comment


      #3
      bltdavid thank you so much! !

      One question - is it possible to use other methods `SetStopLoss, EnterLong ...` etc within same strategy, where SubmitOrderUnmanaged is used?
      so, i could use both.

      I am quite frustrated that even puppy platforms like TradingView/etc allows OCOs, and in NT, we dont have it with managed approach. are there any tickets to vote?

      in the meanwhile I've gone with a bit different route -
      1) added 1 second dataseries (or i think, 1 Range is better for performance)
      2) doing all conditions in BIP 0 and executing MARKET orders over STOP PRICE cross on BIP 1
      Last edited by ttodua; 11-16-2019, 03:53 AM.

      Comment


        #4
        Hi TazoTodua, thanks for your post.

        The unmanaged approach does need to be used if you have entry orders on either side of the market. You can not use any of the managed order methods while IsUnmanaged = true, SubmitOrderUnmanaged() must be used.
        Chris L.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by ScottWalsh, 04-16-2024, 04:29 PM
        6 responses
        27 views
        0 likes
        Last Post ScottWalsh  
        Started by frankthearm, Today, 09:08 AM
        10 responses
        35 views
        0 likes
        Last Post frankthearm  
        Started by GwFutures1988, Today, 02:48 PM
        0 responses
        3 views
        0 likes
        Last Post GwFutures1988  
        Started by mmenigma, Today, 02:22 PM
        1 response
        3 views
        0 likes
        Last Post NinjaTrader_Jesse  
        Started by NRITV, Today, 01:15 PM
        2 responses
        9 views
        0 likes
        Last Post NRITV
        by NRITV
         
        Working...
        X