Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

order oco

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

    order oco

    OrdenStop = ExitLongStopMarket(0, true, execution.Order.Filled, StopLoss, "STOP", "LARGOS");
    OrdenProfit = ExitLongLimit(0, true, execution.Order.Filled, Target, "TARGET", "LARGOS");

    Currently this is the sl and tp mode that I use, I would like to convert this into oco commands, how would I do this or where can I get documentation?​​

    #2
    Hello franatas

    When using the managed approach you would use signal names to control OCO. In this case if the position which the entry LARGOS made is closed the order which did not fill will cancel.




    If you want to manually manage OCO you need to use the unmanaged approach. There is a sample of using OCO in unmanaged here:

    Comment


      #3
      following the steps that you indicated to me when making an unmanaged entry, it just doesn't execute the input and doesn't give any error
      IsUnmanaged = true;

      substituted​ : EnterLongStopLimit(0, true, ContratosBuy, PrecioEntrada + 2 * TickSize, PrecioEntrada, Buy);
      for: SubmitOrderUnmanaged(0, OrderAction.Buy, OrderType.StopLimit, ContratosBuy, PrecioEntrada + 2 * TickSize, PrecioEntrada, "", Buy);

      Comment


        #4
        Hello franatas,

        Is your condition becoming true? I wouldn't be able to tell from the given information why it was not submitted.

        Comment


          #5
          Yes of course, the code is simply for you to enter if it is a bullish candle in short and if not in long

          Comment


            #6
            captura de inicio
            Attached Files

            Comment


              #7
              I found the problem but now it gives me this
              Attached Files

              Comment


                #8
                Hello franatas,

                You need to remove and re apply scripts if you make changes to their OnStateChange section.

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by Mindset, 04-21-2026, 06:46 AM
                0 responses
                93 views
                0 likes
                Last Post Mindset
                by Mindset
                 
                Started by M4ndoo, 04-20-2026, 05:21 PM
                0 responses
                138 views
                0 likes
                Last Post M4ndoo
                by M4ndoo
                 
                Started by M4ndoo, 04-19-2026, 05:54 PM
                0 responses
                68 views
                0 likes
                Last Post M4ndoo
                by M4ndoo
                 
                Started by cmoran13, 04-16-2026, 01:02 PM
                0 responses
                123 views
                0 likes
                Last Post cmoran13  
                Started by PaulMohn, 04-10-2026, 11:11 AM
                0 responses
                73 views
                0 likes
                Last Post PaulMohn  
                Working...
                X