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 Geovanny Suaza, 02-11-2026, 06:32 PM
      0 responses
      602 views
      0 likes
      Last Post Geovanny Suaza  
      Started by Geovanny Suaza, 02-11-2026, 05:51 PM
      0 responses
      347 views
      1 like
      Last Post Geovanny Suaza  
      Started by Mindset, 02-09-2026, 11:44 AM
      0 responses
      103 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by Geovanny Suaza, 02-02-2026, 12:30 PM
      0 responses
      560 views
      1 like
      Last Post Geovanny Suaza  
      Started by RFrosty, 01-28-2026, 06:49 PM
      0 responses
      559 views
      1 like
      Last Post RFrosty
      by RFrosty
       
      Working...
      X