Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Repetitious cancellation orders grinding system to a halt

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

    #16
    Not sure what you are referring to. Please provide more information. Thank you.
    Josh P.NinjaTrader Customer Service

    Comment


      #17


      Comment


        #18
        Please use TraceOrders = true and print those logs here. Please also provide the code snippet being executed. Thank you.
        Josh P.NinjaTrader Customer Service

        Comment


          #19
          if (reversalPrice != null)
          {
          if (Position.MarketPosition == MarketPosition.Long && Close[0] >= reversalPrice)
          {
          SetStopLoss(CalculationMode.Ticks, 5);
          EnterShort(DefaultQuantity, "Scalp sell");
          EnterShort(DefaultQuantity, "Sell short");
          reversalPrice = null;
          }
          else if (Position.MarketPosition == MarketPosition.Short && Close[0] <= reversalPrice)
          {
          SetStopLoss(CalculationMode.Ticks, 5);
          EnterLong(DefaultQuantity, "Scalp buy");
          EnterLong(DefaultQuantity, "Buy");
          reversalPrice = null;
          }
          }
          I did not have my output window open when it occurred this time. I will have it open and print the logs the next time it happens.

          Comment


            #20
            "Profit Target" was the name of your cancelled order. I do not see you using SetProfitTarget in the snippet. TraceOrders will be critical to evaluate what is going on.
            Josh P.NinjaTrader Customer Service

            Comment


              #21
              SetProfitTarget is used only in the initialize section:

              protected override void Initialize()
              {
              SetProfitTarget("Scalp sell", CalculationMode.Ticks, 8);
              SetProfitTarget("Scalp buy", CalculationMode.Ticks, 8);
              SetProfitTarget("Buy", CalculationMode.Ticks, 16);
              SetProfitTarget("Sell short", CalculationMode.Ticks, 16);
              IncludeCommission = true;
              TimeInForce = Cbi.TimeInForce.Day;
              EntriesPerDirection = 1;
              TraceOrders = true;
              EntryHandling = EntryHandling.UniqueEntries;
              }

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by Mindset, 04-21-2026, 06:46 AM
              0 responses
              101 views
              0 likes
              Last Post Mindset
              by Mindset
               
              Started by M4ndoo, 04-20-2026, 05:21 PM
              0 responses
              144 views
              0 likes
              Last Post M4ndoo
              by M4ndoo
               
              Started by M4ndoo, 04-19-2026, 05:54 PM
              0 responses
              70 views
              0 likes
              Last Post M4ndoo
              by M4ndoo
               
              Started by cmoran13, 04-16-2026, 01:02 PM
              0 responses
              125 views
              0 likes
              Last Post cmoran13  
              Started by PaulMohn, 04-10-2026, 11:11 AM
              0 responses
              78 views
              0 likes
              Last Post PaulMohn  
              Working...
              X