Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Similar Order Flow Trade Detector

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

    Similar Order Flow Trade Detector

    I am creating a similar indicator to Order Flow Trade Detector that will draw an ellipse based on delta size.

    Using the same chart data series inputs (ES 7 ticks) I can load the order flow trade detector (Price, 5, 20, session) in 1 second. When I load my indicator (equal or less amount of ellipse objects) it takes 30 seconds. I'm hoping to get some insights on how to improve my code or understanding of how I'm processing my onrender differently than the Order Flow Trade Detector indicator.

    Attached is my code.

    edit: fixed my second issue but code is still rendering much slower than desired.

    Thanks so much
    Attached Files
    Last edited by mlprice12; 02-22-2022, 10:33 AM.

    #2
    Sorry forgot to attach code

    Comment


      #3
      Hello mlprice12,

      Thank you for the post.

      I took a look at the script however you are already doing the most efficient way to render. You are using OnRender and the FromIndex/ToIndex to only render the data at that portion of the chart. If the script is taking long to load that may be a result of the required data and the time it takes to process said data. A way to test that would be to comment out your OnRender code and check how long the general script takes to process.



      Comment


        #4
        Thanks Jesse,

        So you believe the biggest hit on performance are the 2 Series T?

        What about reusing the brushes and reusing the ellipses OnRenderTarget Change?

        Comment


          #5
          Hello mlprice12,

          You could check if the rendering is taking the toll by commenting that out and then testing it on your machine. If you see the same time for loading the it would be the added series in contrast to the amount of data you loaded. If you see the script load fast you could try additional steps of using OnRenderTargetChanged to create resources and then use variables for those resources to reuse them were possible.



          Comment


            #6
            NinjaTrader_Jesse

            It looks like the Data series are definitely taking a lot of resources.

            Is there a more efficient way to render the 1.current bar delta and 2. midpoint of bar without having to store them in a series?

            Comment


              #7
              Hello mlprice12,

              Storing data in a series is not generally resource intensive, it would be the loading of the tick data that takes additional time and then processing that data. The series is just a storage container that matches the number of bars.

              The only suggestion that I could make would be to use less data if that is possible, limiting the amout of data to load/process would be the best solution to cut the load time down.


              Comment


                #8
                Thanks NinjaTrader_Jesse

                What would help resolve the fact that when in a trade the data seems to lag by half a second with a slight freeze when the trade is triggered to enter or exit?

                Is this a render issue that could be helped by reusing brushes or ellipses?

                Comment


                  #9
                  Hello mlprice12,

                  I would suggest looking at the utilization monitor to see if your item is causing a delay. https://ninjatrader.com/support/help...izationMonitor

                  If you see that happening when you are not using anything custom and just manually trading that could be a result of the PC being used not being powerful enough to handle the platform, please ensure you are using at lease the recommended requirements here: https://ninjatrader.com/support/help...quirements.htm

                  Comment


                    #10
                    NinjaTrader_Jesse

                    The delay and slight freeze only occur when my chart has my custom indicator and has been running late into the day accumulating lots of data/objects.

                    You don't think my code has any room for performance improvements?

                    Comment


                      #11
                      I will have to check utilization monitor during more active trading hours but this screen shot would tell me it isn't my indicator AggDelta that is causing a a freeze correct?
                      Attached Files

                      Comment


                        #12
                        Hello mlprice12,

                        The screenshot shows that PriceTradderLadder is using the most CPU time. Removing or reducing instances of items that use the most CPU time will have the biggest benefit to addressing lagging/performance symptoms.

                        AggDelta is not appearing there, so it does not appear that it is causing performance issues. As this is an indicator you are developing, testing the indicator by itself in a blank workspace would be a good way to see the performance impact of your indicator, ruling out other components running in your workspace.

                        Comment

                        Latest Posts

                        Collapse

                        Topics Statistics Last Post
                        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                        0 responses
                        646 views
                        0 likes
                        Last Post Geovanny Suaza  
                        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                        0 responses
                        367 views
                        1 like
                        Last Post Geovanny Suaza  
                        Started by Mindset, 02-09-2026, 11:44 AM
                        0 responses
                        107 views
                        0 likes
                        Last Post Mindset
                        by Mindset
                         
                        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                        0 responses
                        569 views
                        1 like
                        Last Post Geovanny Suaza  
                        Started by RFrosty, 01-28-2026, 06:49 PM
                        0 responses
                        573 views
                        1 like
                        Last Post RFrosty
                        by RFrosty
                         
                        Working...
                        X