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

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.

    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

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by sidlercom80, 10-28-2023, 08:49 AM
        168 responses
        2,261 views
        0 likes
        Last Post sidlercom80  
        Started by Barry Milan, Yesterday, 10:35 PM
        3 responses
        10 views
        0 likes
        Last Post NinjaTrader_Manfred  
        Started by WeyldFalcon, 12-10-2020, 06:48 PM
        14 responses
        1,428 views
        0 likes
        Last Post Handclap0241  
        Started by DJ888, 04-16-2024, 06:09 PM
        2 responses
        9 views
        0 likes
        Last Post DJ888
        by DJ888
         
        Started by jeronymite, 04-12-2024, 04:26 PM
        3 responses
        41 views
        0 likes
        Last Post jeronymite  
        Working...
        X