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 Hwop38, 05-04-2026, 07:02 PM
      0 responses
      175 views
      0 likes
      Last Post Hwop38
      by Hwop38
       
      Started by CaptainJack, 04-24-2026, 11:07 PM
      0 responses
      331 views
      0 likes
      Last Post CaptainJack  
      Started by Mindset, 04-21-2026, 06:46 AM
      0 responses
      253 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by M4ndoo, 04-20-2026, 05:21 PM
      0 responses
      356 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Started by M4ndoo, 04-19-2026, 05:54 PM
      0 responses
      183 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Working...
      X