Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Strategy Analyzer Blocking UI Thread

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

    Strategy Analyzer Blocking UI Thread

    I want to report another problem with the Strategy Analyzer. I've got a very complex strategy with Loads of properties and Many Enum properties.

    When I select Enum Values to Optimize in my strategy, the UI thread gets blocked and it takes about 5-10 seconds for the checkbox to appear.

    I've attached a sample strategy that illustrates the problem. I've filled it will loads of empty properties and several enum properties. Open it in the optimizer and then scroll to the bottom of the properties list and select several Options from each of the Enum types. It seems to get worse the more properties you select. The delay is a few seconds on the sample strategy, but on my real strategy it takes about 10 seconds.

    I think the bug is caused by work being done directly from the Click/Checked handler of the checkbox. I think it would be easily fixed by doing the work inside a call to Dispatcher.InvokeAsync or by async/await. I have not experienced any blocking like this anywhere else on the Ninjatrader platform so there's definitely something clearly different/wrong with the implementation of the click handler that is used for selecting Enum options on the optimizer.

    Users expect an app to remain responsive while it does computation, regardless of the type of machine.



    Attached Files

    #2
    Hello kevinenergy,

    Thank you for your post.

    We will test this on our end and follow up with you here with any details.

    Comment


      #3
      Hello kevinenergy,

      Thank you for the post.

      Thank you for providing the sample script as well. I loaded the script into the Strategy Analyzer and received the same performance degradation. I will submit this behavior to our product management team to see about improving performance of this section of the UI.

      Thanks in advance for your patience.

      Comment


        #4
        Hi NinjaTrader_ChrisL, It looks like this is still the situation, 5 years down the road. Could you check if this was addressed?

        Comment


          #5
          Originally posted by Shai Samuel View Post
          Hi NinjaTrader_ChrisL, It looks like this is still the situation, 5 years down the road. Could you check if this was addressed?
          Hello Shai Samuel,

          Thank you for your note.

          I will check into this and get you an update. Once I have a tracking number and/or any additional information, I will update you here. In the meantime, please feel free to reach out with any additional questions or concerns.

          Thank you for your patience.

          Comment


            #6
            Hello Shai Samuel,

            Thank you for your patience.

            I heard back from the development team and they explained that this behavior is expected. As a user clicks on an enum checkbox in the optimization settings, just as when modifying a numeric optimization property, the property grid is reloaded. The time it takes for an enum box to check/uncheck is comparable to the time it takes for a property to update when updating a different property such as an int or double. For example, in the following video I set up an optimization for the Sample MA Crossover and when I change the fast/slow int ranges, it takes a moment for the change in value to register because the property grid is reloaded in the same way it would be when checking/unchecking an enum:
            • https://www.screencast.com/t/SbfIBPok0xY
              • Please note how each time I change the Min, Max, or Increment, if I click away from the box (or press Tab on my keyboard) it takes a moment for that change to be reflected
            Please don't hesitate to reach out with any additional items we may assist you with.

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by NullPointStrategies, Yesterday, 05:17 AM
            0 responses
            62 views
            0 likes
            Last Post NullPointStrategies  
            Started by argusthome, 03-08-2026, 10:06 AM
            0 responses
            134 views
            0 likes
            Last Post argusthome  
            Started by NabilKhattabi, 03-06-2026, 11:18 AM
            0 responses
            75 views
            0 likes
            Last Post NabilKhattabi  
            Started by Deep42, 03-06-2026, 12:28 AM
            0 responses
            45 views
            0 likes
            Last Post Deep42
            by Deep42
             
            Started by TheRealMorford, 03-05-2026, 06:15 PM
            0 responses
            50 views
            0 likes
            Last Post TheRealMorford  
            Working...
            X