Announcement

Collapse
No announcement yet.

Time when the last bar started

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

  • Time when the last bar started

    How can I get the time when the last bar (the one being built) started ?
    Everything that I tried returned the starting time of the previous (completed) bar.
    Thank you.

  • #2
    jbiard
    getHour(0)+":"+getMinute(0)+":"+getSecond(0); will return the time of the current bar
    Alex

    Comment


    • #3
      Alex,
      from the testing I did, the code you suggest returns the starting time of the last COMPLETED bar; what I am expecting is the time the bar IN CONSTRUCTION was started.
      Unless I missed something .....

      Comment


      • #4
        jbiard
        The code I suggested will return the time of the current bar (see enclosed image).
        Do you have a setComputeOnClose() statement in preMain?
        Alex

        Comment

        Working...
        X