Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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.
    Kate W.NinjaTrader Customer Service

    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 llanqui, Today, 11:10 AM
        0 responses
        3 views
        0 likes
        Last Post llanqui
        by llanqui
         
        Started by llanqui, Today, 10:29 AM
        0 responses
        5 views
        0 likes
        Last Post llanqui
        by llanqui
         
        Started by llanqui, Today, 08:32 AM
        1 response
        10 views
        0 likes
        Last Post llanqui
        by llanqui
         
        Started by lollers, Yesterday, 03:26 AM
        1 response
        53 views
        0 likes
        Last Post lollers
        by lollers
         
        Started by Salahinho99, 05-05-2024, 04:13 AM
        7 responses
        63 views
        0 likes
        Last Post Salahinho99  
        Working...
        X