• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Bars Numbering

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

    Bars Numbering

    Hello,
    My question is a very basic one and might have been answered before but could not find any help relating to it.

    How are the bars numbered in NT7 ? Is the CurrentBar always 0 and all previous bars numbered in increments of 1 from right to left ?
    I found some free indicators which are numbering Bars but they are all from right to left , so am confused as to which one to believe.

    #2
    Today is 0, yesterday is 1, etc. Some other platforms use 0, -1, -2, etc. Python code usually does the reverse. In this area there are no standards

    Comment


      #3
      Hello SurenForex,

      Thank you for writing in.

      If you look up a given NinjaScript method in our help guide: http://ninjatrader.com/support/helpG..._reference.htm

      Then anywhere you see "int barsAgo", you know the index of the most recent item is 0 and the values increases the further you go back. This is particularly relevant when working with the Close, Closes, Open, Opens, High, Highs, Low, Lows, Time, Times, Volume, and Volumes methods as well as with DataSeries objects.

      CurrentBar is the number of bars currently on the chart. So for example:
      Code:
      Print(Close[CurrentBar]); //gives you the close of the oldest bar on the chart (the furthest left bar).
      Print(Close[0]); //gives you the close of the most recent bar on the chart (the furthest right bar).
      Anywhere that does not use "int barsAgo", the indexing is standard where 0 is the first item in the array and it increases the further you go forward.

      Please let me know if you require further clarification.
      Last edited by NinjaTrader_MichaelM; 10-11-2015, 08:13 AM.
      Michael M.NinjaTrader Quality Assurance

      Comment


        #4
        Originally posted by SurenForex View Post
        How are the bars numbered in NT7 ? Is the CurrentBar always 0 and all previous bars numbered in increments of 1 from right to left ?
        Yes.
        I found some free indicators which are numbering Bars but they are all from right to left , so am confused as to which one to believe.
        That is the same statement as your question.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by pstrusi, Today, 12:50 PM
        1 response
        4 views
        0 likes
        Last Post NinjaTrader_Jesse  
        Started by ralett, Today, 11:52 AM
        1 response
        4 views
        0 likes
        Last Post NinjaTrader_PatrickG  
        Started by rtwave, Yesterday, 07:06 PM
        1 response
        23 views
        0 likes
        Last Post NinjaTrader_PaulH  
        Started by DTSSTS, Today, 11:27 AM
        2 responses
        10 views
        0 likes
        Last Post DTSSTS
        by DTSSTS
         
        Started by siroya, Today, 10:02 AM
        2 responses
        9 views
        0 likes
        Last Post DTSSTS
        by DTSSTS
         
        Working...
        X