Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Output from Bars.TickCount includes strange bar details

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

    Output from Bars.TickCount includes strange bar details

    I'm planning to use TickCount in a new indicator and I built a very simple test to check the output from TickCount.

    The code in OnBarUpdate simply contains this:

    protected override void OnBarUpdate()
    {

    Print(string.Format("Bar {0} The tick count of the current bar is {1} ", CurrentBar, Bars.TickCount.ToString()));
    }

    But when I run this on a 250 tick chart with Tick Replay enabled, I see the following output:

    Bar 18979 The tick count of the current bar is 247
    Bar 4744381 The tick count of the current bar is 1
    Bar 18979 The tick count of the current bar is 248
    Bar 4744382 The tick count of the current bar is 1
    Bar 18979 The tick count of the current bar is 249
    Bar 4744383 The tick count of the current bar is 1
    Bar 18979 The tick count of the current bar is 250
    Bar 4744384 The tick count of the current bar is 1
    Bar 18980 The tick count of the current bar is 1
    Bar 4744385 The tick count of the current bar is 1
    Bar 18980 The tick count of the current bar is 2
    Bar 4744386 The tick count of the current bar is 1
    Bar 18980 The tick count of the current bar is 3
    Bar 4744387 The tick count of the current bar is 1
    Bar 18980 The tick count of the current bar is 4
    Bar 4744388 The tick count of the current bar is 1
    Bar 18980 The tick count of the current bar is 5
    Bar 4744389 The tick count of the current bar is 1
    Bar 18980 The tick count of the current bar is 6
    Bar 4744390 The tick count of the current bar is 1
    Bar 18980 The tick count of the current bar is 7
    Bar 4744391 The tick count of the current bar is 1

    Why do I see these strange bar numbers, all with a tick count of 1 on every alternate line?

    #2
    Hello toughcookie,

    Thank you for your inquiry.

    In my testing with Tick Replay on a 1 minute ES 12-20 chart and , I don't see the same. Who is your data provider, and what instrument are you testing on?

    Thanks in advance; I look forward to assisting you further.

    Comment


      #3
      Hello Kate,

      My data provider is CQG. The chart I was testing on was ES 09-20, 250 tick. I ran Tick Counter on the same chart and it worked OK, so I'm sure it's something wrong in my indicator.

      Comment


        #4
        Hello Kate,
        Sorry, my bad. I just noticed I had left an Add Data Series instruction in the State == State.Configure section for a 1 tick data series.
        I removed that and it now works OK.
        Sorry for wasting your time.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by charlesugo_1, 05-26-2026, 05:03 PM
        0 responses
        68 views
        0 likes
        Last Post charlesugo_1  
        Started by DannyP96, 05-18-2026, 02:38 PM
        1 response
        151 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by CarlTrading, 05-11-2026, 05:56 AM
        0 responses
        162 views
        0 likes
        Last Post CarlTrading  
        Started by CarlTrading, 05-10-2026, 08:12 PM
        0 responses
        100 views
        0 likes
        Last Post CarlTrading  
        Started by Hwop38, 05-04-2026, 07:02 PM
        0 responses
        288 views
        0 likes
        Last Post Hwop38
        by Hwop38
         
        Working...
        X