Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Unmanaged order

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

    Unmanaged order

    Hello,

    I've seen the unmanaged order example from previous post's by NT Team.
    But this script cancels the pending order if one order or the other gets filled.
    How can we allow for the order that isn't filled stay on?

    Click image for larger version

Name:	image.png
Views:	238
Size:	15.7 KB
ID:	1223858

    #2
    Hello r3n3v,

    Thank you for your post.

    Based on your description, it sounds like the example might be using an OCO string for both orders. This would pair them up as One Cancels Other orders and result in the behavior where if one of the orders gets filled/canceled, then the other order will be canceled. The OCO string in the method overload may be left as a null string, or "", if you would like to submit an order without OCO.



    If you'd like for me to further review and even provide a sample snippet, please provide a link to one of the posts you are referring to so I may make sure that I am using the correct sample.

    Please let me know if I may be of further assistance.

    Comment


      #3
      I'm using this link below.

      Hi, Is there a collection of sample/reference strategies that illustrates how to use the unmanaged order approach in advanced scenarios which also illustrates all the things one would need to be concerned about vs using the managed approach? Is there something like that you can point me to? Thanks, FaaastEddy


      When I try adding a character to make them unique and unrelated it doesn't place both orders just the long side.

      Comment


        #4
        Hello r3n3v,

        Thank you for your reply.

        Where are you adding a character? Do you get an error in the Log tab of the Control Center or the NinjaScript Output window? If you do not want to use oco in an order method, you can put a null string such as the following:
        Change this:
        SubmitOrderUnmanaged(0, OrderAction.SellShort, OrderType.Limit, 100, High[0]+EntryDistance*TickSize, 0, oco, "Short limit entry");

        To this:
        SubmitOrderUnmanaged(0, OrderAction.SellShort, OrderType.Limit, 100, High[0]+EntryDistance*TickSize, 0, "", "Short limit entry");

        The example you are referring to does use OCO as a way to set up a bracket entry; it is supposed to go either long or short, and if one of those orders fills it will break out with the stop loss and profit target orders and the other entry that did not fill gets canceled. If this is not your goal, you will likely need to adjust your logic accordingly and may not need to use all of the concepts demonstrated in the unmanaged example.

        Please let us know if we may be of further assistance.

        Comment


          #5
          Yes that is what it's doing right now. It cancels one or the other. So I'm trying to disable that mechanism to leave them both on. When I change it to "" it still doesn't show both brackets.

          Comment


            #6
            Hello r3n3v,

            Thank you for your reply.

            Since the behavior is still to cancel one or the other, it sounds like there is still an OCO ID being used in the order methods somewhere. You mention that you are making changes, but you have not advised where in the script you are making the changes. If you do not want two orders to be paired where one cancels when the other is filled, do not use an OCO ID in the order method. The only time two orders will be linked via OCO is when both order methods use the same OCO ID in the method.

            If the issue persists, please provide a snippet or sample of the script you are working with.

            Thank you for your patience.

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by NullPointStrategies, Today, 05:17 AM
            0 responses
            52 views
            0 likes
            Last Post NullPointStrategies  
            Started by argusthome, 03-08-2026, 10:06 AM
            0 responses
            130 views
            0 likes
            Last Post argusthome  
            Started by NabilKhattabi, 03-06-2026, 11:18 AM
            0 responses
            70 views
            0 likes
            Last Post NabilKhattabi  
            Started by Deep42, 03-06-2026, 12:28 AM
            0 responses
            44 views
            0 likes
            Last Post Deep42
            by Deep42
             
            Started by TheRealMorford, 03-05-2026, 06:15 PM
            0 responses
            48 views
            0 likes
            Last Post TheRealMorford  
            Working...
            X