Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Getting the current bar's open price

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

    #16
    Hello takeaseat,

    The time series represents the bar close times. Using negative indexes as a bars ago is not valid, that would be looking into the future that has not happened yet.

    Comment


      #17
      Time[0].Minute-1 is what I meant sorry
      Edit: This *seems* to be working

      Comment


        #18
        Hello takeaseat,

        That would give you the time of the closed bar if you were using a 1 minute series. You can alternatively use Time[1] to get the last closed bars time. Time[0] will print the building bars anticipated close time.

        Comment


          #19
          Ah gotcha. I am testing on 1 minute and iterating changes. Is there a function to get the timeframe as an int? Like 15 minute chart, returns 15 etc

          Comment


            #20
            Hello takeaseat,

            Yes you can use Bars.BarsPeriod.Value

            Keep in mind this can only be used while the script is running from OnBarUpdate, Bars should not be used in OnStateChange SetDefaults or Configure.

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by NullPointStrategies, Yesterday, 05:17 AM
            0 responses
            53 views
            0 likes
            Last Post NullPointStrategies  
            Started by argusthome, 03-08-2026, 10:06 AM
            0 responses
            130 views
            0 likes
            Last Post argusthome  
            Started by NabilKhattabi, 03-06-2026, 11:18 AM
            0 responses
            70 views
            0 likes
            Last Post NabilKhattabi  
            Started by Deep42, 03-06-2026, 12:28 AM
            0 responses
            44 views
            0 likes
            Last Post Deep42
            by Deep42
             
            Started by TheRealMorford, 03-05-2026, 06:15 PM
            0 responses
            49 views
            0 likes
            Last Post TheRealMorford  
            Working...
            X