Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Strategy disable delay

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

    Strategy disable delay

    What would cause a long delay in a strategy disabling when clicking on the Enabled Button on the Strategies tab? I am talking about a one minute delay where NT control panel freezes until the strategy unchecks. Enabling is fine, disabling takes alot longer. No compiling / log errors apparent. Regards and many thanks. the code contains many of the following loops types:

    for (int esuhsc = 0, esuhscx = intSizeES; esuhsc < esuhscx; esuhsc++)
    {
    if (BarsInProgress == 1
    && Positions[1].MarketPosition == MarketPosition.Flat
    && CurrentBars[0] > barNumberOfOrderES + 5)
    {
    foreach(Order order in orderList)
    {
    if( order.Name == "ES SHORT LIMIT" + esuhsc)
    CancelOrder(order);
    gapEStradetoday = false;
    }
    }
    }
    Last edited by elliot5; 03-03-2021, 04:19 AM.

    #2
    Hello elliot5,

    Code being run in State.Terminated could cause behavior such as this.

    A large position that has to be exited, or a large amount of order cancellations could also cause this.

    Are you able to reproduce this behavior with the SampleMACrossOver included with NinjaTrader, in a new blank workspace with all other workspaces closed?
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      I have solved this issue by embedding the loops deeper into the code. Clearly the multiple loops were causing the delay. Regards and many thanks for your support

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by CarlTrading, 03-31-2026, 09:41 PM
      1 response
      80 views
      1 like
      Last Post NinjaTrader_ChelseaB  
      Started by CarlTrading, 04-01-2026, 02:41 AM
      0 responses
      40 views
      0 likes
      Last Post CarlTrading  
      Started by CaptainJack, 03-31-2026, 11:44 PM
      0 responses
      64 views
      2 likes
      Last Post CaptainJack  
      Started by CarlTrading, 03-30-2026, 11:51 AM
      0 responses
      63 views
      0 likes
      Last Post CarlTrading  
      Started by CarlTrading, 03-30-2026, 11:48 AM
      0 responses
      54 views
      0 likes
      Last Post CarlTrading  
      Working...
      X