Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Limit level 2 data in API...

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

    Limit level 2 data in API...

    In implementing this example: https://ninjatrader.com/support/help...vel_ii_dat.htm
    The amount of level2 data is like 600+ rows. Is it possible to limit that return? Tweaking the List doesn't do anything.

    #2
    Hello funk10101,

    The sample that you are working with already has some logic to help keep the list limited to what the data provider is offering so beyond that there would not be any way to control how many datapoints are sent from the provider. You could select specific elements from the list if you are trying to references certain datapoints instead of looping over the whole list.

    Comment


      #3
      I just want to grab the totals for 30 rows. I've done this in the MyEventHandler, setting "this.MaxRows":
      Code:
      for (int i = 0; i < this.bidRows.Count; i++)
                  {
                      if (i < this.MaxRows)
                          this.bidTotal += this.bidRows[i].Volume;[/B]
                  }
      
      
                  for (int i = 0; i < this.askRows.Count; i++)
                  {
                      if (i < this.MaxRows)
                          this.askTotal += this.askRows[i].Volume;[/B]
                  }
      ​
      Can you see an issue with this?

      Comment


        #4
        Hello funk10101,

        yes thats what I was referring to, as long as that gets the rows of data you wanted that would be fine.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by CarlTrading, 03-31-2026, 09:41 PM
        1 response
        43 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by CarlTrading, 04-01-2026, 02:41 AM
        0 responses
        21 views
        0 likes
        Last Post CarlTrading  
        Started by CaptainJack, 03-31-2026, 11:44 PM
        0 responses
        30 views
        1 like
        Last Post CaptainJack  
        Started by CarlTrading, 03-30-2026, 11:51 AM
        0 responses
        50 views
        0 likes
        Last Post CarlTrading  
        Started by CarlTrading, 03-30-2026, 11:48 AM
        0 responses
        41 views
        0 likes
        Last Post CarlTrading  
        Working...
        X