Announcement

Collapse
No announcement yet.

Referring to Volume bar by 'Time'.

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

  • Referring to Volume bar by 'Time'.

    How do you identify a bar by the 'time' it closed. I trade on the one hour bar and I want to be able to check a condition on the 3.00 pm bar close. While writing an EFS program, I understand we can refer to bars by 'index' like (0),(-1),(-2) and so on, but how do you refer to a specific bar based on the 'closing time' of that bar?
    Any help on this will be appreciated. Thanks.

  • #2
    Lookup the time functions:

    hour(), minute(), second()

    or

    getHour(), getMinute(), getSecond()

    All of these take the argument pattern:

    hour( barIndex [, numBars] [, sym()] [, inv()] )

    or

    getHour( barIndex [, numBars] [, symbol] )

    If your script needs to check whether or not you've started a new day so that you need to reinitialize some variables, you can use this code:

    Code:
      if (getDay(0) != getDay(-1)
      {
        // you're at the start of a new day
      }

    Comment

    Working...
    X