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 TigerKiger, Today, 01:12 PM
      0 responses
      10 views
      0 likes
      Last Post TigerKiger  
      Started by tonynt, Today, 12:46 PM
      0 responses
      5 views
      0 likes
      Last Post tonynt
      by tonynt
       
      Started by ntdev, Today, 12:19 PM
      0 responses
      3 views
      0 likes
      Last Post ntdev
      by ntdev
       
      Started by RubenCazorla, Today, 12:02 PM
      0 responses
      4 views
      0 likes
      Last Post RubenCazorla  
      Started by pkr75, Today, 11:03 AM
      1 response
      9 views
      0 likes
      Last Post pkr75
      by pkr75
       
      Working...
      X