Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Why does Bars.TotalTicks not look right?

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

    Why does Bars.TotalTicks not look right?

    What am I missing ….

    Say I have a 100 tick chart of the TF (no sessions …. 24/7 … 5 days back of data).

    CurrentBar (total # of bars on chart) = 4062
    …. at 100 ticks per bar …. I should have close to 406,200 total ticks

    How come Bars.TotalTicks only shows: 289,499 ? That’s almost 30% lower than I’d expect.


    I’m just using:
    Code:
    [FONT=Courier New][COLOR=black][COLOR=black][FONT=Courier New]DrawTextFixed([/FONT][/COLOR][COLOR=maroon][FONT=Courier New]"tag1"[/FONT][/COLOR][COLOR=black][FONT=Courier New], [/FONT][/COLOR][COLOR=maroon][FONT=Courier New]"TotalTicks: "[/FONT][/COLOR][COLOR=black][FONT=Courier New] + Bars.TotalTicks + [/FONT][/COLOR][COLOR=maroon][FONT=Courier New]"\nCurrentBar: "[/FONT][/COLOR][COLOR=black][FONT=Courier New] + CurrentBar,  TextPosition.TopLeft);[/FONT][/COLOR]
    [/COLOR][/FONT]
    Attached Files

    #2
    Hello,

    Thanks for the forum post.

    When a new session begins and a new day in your case with Default 24/7 a new tick bar will be created regardless of if the number of ticks to complete the bar is satisfied.

    We do this as we needed to force an OnBarUpdate when a new session starts for the session logic to work correctly. Therefor you could have a bar at the start of a new session that ends prematurely. This is true with Range, Volume and Tick charts.

    Let me know if I can be of further assistance.
    BrettNinjaTrader Product Management

    Comment


      #3
      Brett,

      I think I understand you, but something is still way off.

      So maybe 5 bars got 'cut short' on their ticks for the 5 session start events.... that would explain a difference of less than 500 ticks when using 100 tick bars.

      But I'm still missing 116,000 ticks somehow on this simple concept study.

      If you plug in that one line of code on any tick chart, does Bars.TotalTicks come close to: # of bars * tick count? Even understanding the expected offset of < a bar's worth of ticks each session, something is still awry.

      Thanks

      Comment


        #4
        Hello,

        Not sure how much data you had loaded in your test.

        When I test on my side see the below screenshot. I get the expected results.

        There are a few more ticks counted then exact since I'm loading a 1 day chart and to load 1 day there is some bleed over into the next day for the session template which is expected.

        Whats different between are setups? How many days you testing? If you test 1 do you get the same results as me?

        Let me know if I can be of further assistance.
        Attached Files
        BrettNinjaTrader Product Management

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by cmoran13, 04-16-2026, 01:02 PM
        0 responses
        36 views
        0 likes
        Last Post cmoran13  
        Started by PaulMohn, 04-10-2026, 11:11 AM
        0 responses
        23 views
        0 likes
        Last Post PaulMohn  
        Started by CarlTrading, 03-31-2026, 09:41 PM
        1 response
        162 views
        1 like
        Last Post NinjaTrader_ChelseaB  
        Started by CarlTrading, 04-01-2026, 02:41 AM
        0 responses
        96 views
        1 like
        Last Post CarlTrading  
        Started by CaptainJack, 03-31-2026, 11:44 PM
        0 responses
        152 views
        2 likes
        Last Post CaptainJack  
        Working...
        X