Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

OCO order error

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

    #16
    I re sent the files, please verify

    Comment


      #17
      Thank you. I will review them and get back to you.
      Josh P.NinjaTrader Customer Service

      Comment


        #18
        Please try placing manual orders and see if you can get it to work.
        Josh P.NinjaTrader Customer Service

        Comment


          #19
          how can I place manual orders on ninjatrader? I place the orders thought ninjascript. Or do you mean place the orders manually on the TWS?

          Comment


            #20
            Manual order in NinjaTrader. You can use any of the order entry windows or Chart Trader on a chart.
            Josh P.NinjaTrader Customer Service

            Comment


              #21
              I wil try tomorrow and let you know.
              Look at this code, maybe is something wrong?

              this.SetProfitTarget(CalculationMode.Price, this.takeProfit);
              //this.SetProfitTarget(this.takeProfit);
              Print("Stop loss Orden " + this.valorStop);
              this.SetStopLoss(CalculationMode.Price, this.valorStop);
              //this.SetStopLoss(this.valorStop);

              Comment


                #22
                cesas, what values are you submitting for takeProfit and valorStop? Did you try the manual orders yet to see if they are placed to the TWS as expected?

                Comment


                  #23
                  Hi. The values for stop loss:

                  this.valorStop = this.instanciaIndicador.getCloseActual() - 3;

                  Print("Valor Stop " + this.valorStop);

                  Print("Entrada Orden " + this.entrada);

                  this.ordenActual = this.EnterLongLimit(this.BarsInProgress, true, 200, this.entrada, "");
                  } else {
                  this.valorStop = this.instanciaIndicador.getCloseActual() + 3;

                  values for take profit:

                  private double calcularTakeProfit(int tendenciaActual) {

                  double close;

                  double toReturn;

                  close = this.instanciaIndicador.getCloseActual();


                  if (tendenciaActual == 1) {

                  toReturn = close + 1.25;

                  } else {

                  toReturn = close - 1.25;
                  }

                  Print ("Take Profit " + toReturn);
                  return toReturn;

                  Comment


                    #24
                    I will try manual orders today with the market open

                    Comment


                      #25
                      Thanks, I don't think the issue is related to the code you use, please try manual orders and report back how this works out. If it does, then I would suggest adding a simple target and stop to the SampleMACrossOver and rechecking the order placement to the TWS paper account with this strategy.

                      Comment


                        #26
                        I notice that error appear on both manual an automatic orders. Today, the error appear in some trades, not in all trades. And I noticed that is related to large amount of contracts and rapid filled orders.

                        Comment


                          #27
                          Likely due to the huge contract quantities you are using.
                          Josh P.NinjaTrader Customer Service

                          Comment


                            #28
                            what can I do?

                            Comment


                              #29
                              Please decrease quantity size on your orders.
                              Josh P.NinjaTrader Customer Service

                              Comment


                                #30
                                Then, ninjatrader does't work with large amount orders?

                                Comment

                                Latest Posts

                                Collapse

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