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 NullPointStrategies, Yesterday, 05:17 AM
      0 responses
      71 views
      0 likes
      Last Post NullPointStrategies  
      Started by argusthome, 03-08-2026, 10:06 AM
      0 responses
      143 views
      0 likes
      Last Post argusthome  
      Started by NabilKhattabi, 03-06-2026, 11:18 AM
      0 responses
      76 views
      0 likes
      Last Post NabilKhattabi  
      Started by Deep42, 03-06-2026, 12:28 AM
      0 responses
      47 views
      0 likes
      Last Post Deep42
      by Deep42
       
      Started by TheRealMorford, 03-05-2026, 06:15 PM
      0 responses
      51 views
      0 likes
      Last Post TheRealMorford  
      Working...
      X