Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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.
    JimNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Shansen, 08-30-2019, 10:18 PM
    24 responses
    938 views
    0 likes
    Last Post spwizard  
    Started by Max238, Today, 01:28 AM
    0 responses
    3 views
    0 likes
    Last Post Max238
    by Max238
     
    Started by rocketman7, Today, 01:00 AM
    0 responses
    2 views
    0 likes
    Last Post rocketman7  
    Started by wzgy0920, 04-20-2024, 06:09 PM
    2 responses
    27 views
    0 likes
    Last Post wzgy0920  
    Started by wzgy0920, 02-22-2024, 01:11 AM
    5 responses
    32 views
    0 likes
    Last Post wzgy0920  
    Working...
    X