Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

OCO ID issues in trade copier (Repilikanto)

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

    OCO ID issues in trade copier (Repilikanto)

    Hi there.

    I've developed a strategy that works fine, doing all with no problems.

    While trying to replicate its trades using Repilikanto trade copier, it gives me error messages about OCO ID:

    Click image for larger version

Name:	Screenshot 2025-04-03 104809.png
Views:	201
Size:	19.0 KB
ID:	1339525

    I've contacted Flowbots (Repilijanto), and they replied saying it's a Ninjatrader issue, and I should contact Ninjatrader for help.

    Is there any way my strategy can affect what the trade copier makes?

    Any suggestions on how to fix it?

    #2
    Hello faccipieri,


    Thank you for posting on the NinjaTrader forums.


    While I cannot diagnose the strategy that you have created I can add more context to the error message:

    NinjaTrader requires a unique OCO ID for each group of linked orders (typically used with profit targets and stop losses). This ID should never be reused across different order groups — even if the previous orders using that ID have been canceled or filled.

    In your case:
    • A previously submitted ATM strategy or manually submitted OCO order used the OCO ID Take Profit 1|026E370C|8.
    • Then a new order tried to submit with that same ID, resulting in this rejection.

    You’ll want to ensure that a new OCO ID is generated each time.



    Thank you!

    Comment


      #3
      Hi Luis.

      Thank you for your reply.

      My strategy manages independent OCO IDs for every order, and it never fails to deliver that in any char I enable it. BTW, it works flawlessly in those charts.

      But it's my understanding that the trade copier is generating its own orders at the slave chart, and it has nothing my strategy can do to prevent it from failing. Is my assumption correct? Is there anything from my end that I can do in the strategy to avoid such behavior in the third part copier (Repilikanto)?

      Comment


        #4
        faccipieri,


        I'm not sure how the trade copier manages OCO orders, in my limited knowledge I understand that all the copier is doing is duplicating actions across the selected accounts.

        While not an issue, I think it's best to reach out to the trade copier vendor to get a better understanding as to how these are meant to be handled. We know that OCO IDs need to be unique, these cannot be recycled.

        It is also possible that the strategy that was used here is attempting to use the same OCO ID and produces that error since the same action is being duplicated.



        I hope this helps!

        Comment


          #5
          Hi there.

          The guys from FlowBots (Repilikanto) analyzed the issue and replied with this comment:

          You are using the same OCO ID (Stop Loss) for all your orders, you need to make a different one each time you submit an order on a leader account. This will fix the issue.

          Although I was already using OCO orders, I changed the command to generate entirely individual OCO orders for each operation.


          Previous:
          string breakevenOcoId = $"OCO_BE_{Guid.NewGuid().ToString("N")}";
          Order newStopLossOrder;

          Changed To:

          Copystring breakevenOcoId = $"BE_{Guid.NewGuid().ToString("N")}";
          Order newStopLossOrder;​

          I did it to all types of orders, and it worked.

          Comment


            #6
            Just to give all the steps...

            I was using it to generate unique OCO IDs for SL, TP1, and TP2:

            string slOcoId = $"OCO_SL_{Guid.NewGuid().ToString("N")}";
            string tp1OcoId = $"OCO_TP1_{Guid.NewGuid().ToString("N")}";
            string tp2OcoId = $"OCO_TP2_{Guid.NewGuid().ToString("N")}";

            I changed to:


            Copystring ocoBaseId = Guid.NewGuid().ToString("N");
            string slOcoId = $"SL_{ocoBaseId}";
            string tp1OcoId = $"TP1_{ocoBaseId}";
            string tp2OcoId = $"TP2_{ocoBaseId}";


            Then, I changed all calls as mentioned in the post above.

            This fixed the issues with Repilikanto.​

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by argusthome, 03-08-2026, 10:06 AM
            0 responses
            65 views
            0 likes
            Last Post argusthome  
            Started by NabilKhattabi, 03-06-2026, 11:18 AM
            0 responses
            41 views
            0 likes
            Last Post NabilKhattabi  
            Started by Deep42, 03-06-2026, 12:28 AM
            0 responses
            23 views
            0 likes
            Last Post Deep42
            by Deep42
             
            Started by TheRealMorford, 03-05-2026, 06:15 PM
            0 responses
            26 views
            0 likes
            Last Post TheRealMorford  
            Started by Mindset, 02-28-2026, 06:16 AM
            0 responses
            52 views
            0 likes
            Last Post Mindset
            by Mindset
             
            Working...
            X