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

Bar Number from Time ?

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

    Bar Number from Time ?

    How do I get the bar number of a specific time? eg, I'd like to get the bar number of the 1 tick series at thirty seconds after the beginning of a minute. (Seems like Chelsea pointed me to this awhile back. I sure can't find this in the Help Guide. "GetBars [x]" ?)

    #2
    Hello, thanks for writing in. We have this method that will get the bar index given a timestamp:
    Chris L.NinjaTrader Customer Service

    Comment


      #3
      Mmm. That looks like it needs to be implemented from within a chart. I'm trying to do this entirely within a strategy script.

      Comment


        #4
        Hi, you can still call this from a strategy that is running on a chart, just not from the Control Center.
        Chris L.NinjaTrader Customer Service

        Comment


          #5
          Well, maybe I'm fixated on that other method. Does "GetBars()" make any sense?

          Comment


            #6
            Hi, there is no method called GetBars() there is only these two which will let you get a bar index:

            GetBarIdxByTime()
            GetBarIdxByX()
            Chris L.NinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by usasugardefender, Today, 01:42 AM
            0 responses
            1 view
            0 likes
            Last Post usasugardefender  
            Started by haas88, 03-21-2024, 02:22 AM
            15 responses
            182 views
            0 likes
            Last Post haas88
            by haas88
             
            Started by brianfnoel, Today, 01:24 AM
            0 responses
            6 views
            0 likes
            Last Post brianfnoel  
            Started by bill2023, Yesterday, 08:21 AM
            2 responses
            14 views
            0 likes
            Last Post bill2023  
            Started by ynoldsany, Today, 01:00 AM
            0 responses
            3 views
            0 likes
            Last Post ynoldsany  
            Working...
            X