Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Does a nested on market data call use additional resources?

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

    Does a nested on market data call use additional resources?

    I have a parent indicator that utilizes

    Code:
    protected override void OnMarketData(MarketDataEventArgs marketDataUpdate)
    {
    
    }
    The parent indicator calls other indicators to get various data values.

    If one of these other indicators also has an OnMarketData() does this create additional subscriptions or would the same cycles from the parent indicator get used?

    If additional subscriptions are created, is it possible to prevent this based on user input? For example, if user input is X then override OnMarketData, but if not, then it's not needed.

    I know I could do the following, but this would still process the OnMarketData()


    Code:
    protected override void OnMarketData(MarketDataEventArgs marketDataUpdate)
    {
        if(input != x)return;
    }
    ​​

    #2
    Hello HandsFreeTrader,

    Thank you for your post.

    Having OnMarketData() in a script will create a subscription to the data stream. If both scripts have OnMarketData(), they will both have subscriptions.

    There is an existing sample script on the forum that demonstrates using AddOn code to add MarketData events to your script conditionally.



    Please let us know if you have any further questions.

    Comment


      #3
      perfect, thanks for the info

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Geovanny Suaza, 02-11-2026, 06:32 PM
      0 responses
      672 views
      0 likes
      Last Post Geovanny Suaza  
      Started by Geovanny Suaza, 02-11-2026, 05:51 PM
      0 responses
      379 views
      1 like
      Last Post Geovanny Suaza  
      Started by Mindset, 02-09-2026, 11:44 AM
      0 responses
      111 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by Geovanny Suaza, 02-02-2026, 12:30 PM
      0 responses
      577 views
      1 like
      Last Post Geovanny Suaza  
      Started by RFrosty, 01-28-2026, 06:49 PM
      0 responses
      582 views
      1 like
      Last Post RFrosty
      by RFrosty
       
      Working...
      X