Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Market depth/data performance impact when two indicators use it.

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

    Market depth/data performance impact when two indicators use it.

    I'm developing an indicator that leverages OnMarketData() / OnMarketDepth(). Most of the chart rendering objects need to be on top of everything else. But one set of rendering objects need to display behind the price bars. Since you can only set a single SetZOrder per indicator, I'm going to create a second indicator for the items that need to display behind the price bars.

    Since both would rely on the same OnMarketData() / OnMarketDepth() logic I was thinking about sharing a static list in an AddOnn. Primarily so the logic in OnMarketData() / OnMarketDepth() runs once instead of twice. Does this approach make sense or is there little performance impact to running OnMarketData() / OnMarketDepth() methods in both indicators?

    Thanks.

    #2
    Hello martyn73,

    Thanks for your post.

    OnMarketData and OnMarketDepth can iterate very frequently. You may see a greater performance impact having both indicators use separate OnMarketData and OnMarketDepth which have the same calculations. Managing this information in a static list in the AddOn namespace could yield some better performance. The benefit will largely be based on how much computation you save.

    As it may be easier to just build 2 indicators that both use OnMarketData and OnMarketDepth, I would recommend making this version as a first step so you can profile and measure the benefit when using a static list.

    Please let us know if we can be of further help.

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Geovanny Suaza, 02-11-2026, 06:32 PM
    0 responses
    566 views
    0 likes
    Last Post Geovanny Suaza  
    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
    0 responses
    330 views
    1 like
    Last Post Geovanny Suaza  
    Started by Mindset, 02-09-2026, 11:44 AM
    0 responses
    101 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
    0 responses
    547 views
    1 like
    Last Post Geovanny Suaza  
    Started by RFrosty, 01-28-2026, 06:49 PM
    0 responses
    548 views
    1 like
    Last Post RFrosty
    by RFrosty
     
    Working...
    X