Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How to avoid decrementing a dataseries

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

    How to avoid decrementing a dataseries

    The blockcountrate variable below is being plotted in the OnBarUpdate() section.

    What I really want to indicate is the highest value of the blockcountrate for a one minute bar.

    How do I avoid the blockcountrate decrementing? What happens is in the beginning of a bar is when I typically see large blocks traded. Then as the ticks keep coming in, the blockcountrate goes down because the trades for these ticks are less then the large block setting I'm using. I have tried creating a dataseries of the blockcountrate then using MAX and HighestBar but no luck, won't compile.

    if (e.MarketDataType == MarketDataType.Last && e.Volume >= 6)
    {
    blockcount++ ;
    blockcountrate = blockcount / Bars.TickCount;
    }

    Thanks for any help. I've spent a couple hours trying to avoid the decrementing, so now I'm reaching out !
    Last edited by gdavis74; 09-01-2013, 09:37 PM. Reason: fix code example

    #2
    Originally posted by gdavis74 View Post
    The blockcountrate variable below is being plotted in the OnBarUpdate() section.

    What I really want to indicate is the highest value of the blockcountrate for a one minute bar.

    How do I avoid the blockcountrate decrementing? What happens is in the beginning of a bar is when I typically see large blocks traded. Then as the ticks keep coming in, the blockcountrate goes down because the trades for these ticks are less then the large block setting I'm using. I have tried creating a dataseries of the blockcountrate then using MAX and HighestBar but no luck, won't compile.

    if (e.MarketDataType == MarketDataType.Last && e.Volume >= 6)
    {
    blockcount++ ;
    blockcountrate = blockcount / Bars.TickCount;
    }

    Thanks for any help. I've spent a couple hours trying to avoid the decrementing, so now I'm reaching out !
    Code:
    blockcountrate = Math.Max(blockcountrate, blockcount / Bars.TickCount);

    Comment


      #3
      gdavis74, can you try the suggestion kindly shared by koganam?

      Comment

      Latest Posts

      Collapse

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