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

How to count Ticks?

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

    How to count Ticks?

    Hi Ninjas,

    This is a simple matter but for a non-professional high-tech in deep NinjaTrader core, I'm not sure what is the best way to count Ticks. My goal is to keep an exact count of Ticks in a session from its beginning, let's say that I have a 1 Tick chart, where every Tick is a new Bar. So far, I've seen these options with my doubts:

    1. Count:
    Allegedly it returns the total number of bars or data points but it doesn't specify whether is for the session or the Chart. What I look for is a counter for the whole session, regardless the "Maximum Lock Bars" in a Strategy Analyzer.

    2. CurrentBar:
    Another counter but it seems that only counts for the Bars in a Chart. Is it possible use it for the whole session?

    3. TickCount:
    Since its definition is: "The total number of ticks of the current bar" it seems that in a TickChart of 1, it will always be 1, right? Can TickCount be useful in other way?

    4.BarsSinceSession:
    Since its definition is "The number of bars that have elapsed since the session started." , it seems that it will work as Count.

    So, in your experience, what would it be the best option to achieve my goal as the fastest and flawless one?

    Thank you
    Last edited by pstrusi; 06-20-2015, 12:16 PM.

    #2
    Hello pstrusi,

    Thank you for your post.

    BarsSinceSession would work for your purposes.

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Brevo, Today, 01:45 AM
    0 responses
    3 views
    0 likes
    Last Post Brevo
    by Brevo
     
    Started by aussugardefender, Today, 01:07 AM
    0 responses
    3 views
    0 likes
    Last Post aussugardefender  
    Started by pvincent, 06-23-2022, 12:53 PM
    14 responses
    239 views
    0 likes
    Last Post Nyman
    by Nyman
     
    Started by TraderG23, 12-08-2023, 07:56 AM
    9 responses
    384 views
    1 like
    Last Post Gavini
    by Gavini
     
    Started by oviejo, Today, 12:28 AM
    0 responses
    6 views
    0 likes
    Last Post oviejo
    by oviejo
     
    Working...
    X