• 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

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 saltminer, Today, 06:11 PM
        0 responses
        2 views
        0 likes
        Last Post saltminer  
        Started by epitoma, Today, 05:21 PM
        1 response
        15 views
        0 likes
        Last Post NinjaTrader_ShawnB  
        Started by BatBart, Today, 01:24 PM
        1 response
        22 views
        0 likes
        Last Post NinjaTrader_Melissa  
        Started by ezrakoper, Today, 03:05 PM
        1 response
        8 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by asmmbillah, Today, 02:23 PM
        1 response
        17 views
        0 likes
        Last Post NinjaTrader_Jesse  
        Working...
        X