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 CarlTrading, 03-31-2026, 09:41 PM
                1 response
                41 views
                0 likes
                Last Post NinjaTrader_ChelseaB  
                Started by CarlTrading, 04-01-2026, 02:41 AM
                0 responses
                20 views
                0 likes
                Last Post CarlTrading  
                Started by CaptainJack, 03-31-2026, 11:44 PM
                0 responses
                29 views
                1 like
                Last Post CaptainJack  
                Started by CarlTrading, 03-30-2026, 11:51 AM
                0 responses
                46 views
                0 likes
                Last Post CarlTrading  
                Started by CarlTrading, 03-30-2026, 11:48 AM
                0 responses
                37 views
                0 likes
                Last Post CarlTrading  
                Working...
                X