Time
Last updated
Last updated
Returns the time for a specific bar.
shift
: A number representing the shift from the current bar
timeZoneMode
: Optional. Default value is project timezone. A TimeZoneMode
enum value representing the timezone mode to use for the returned date
Returns an object representing the bar's opening time.
The Time
method returns the opening time of a bar at the specified shift from the current bar. The time is returned as an FTODate
object, which provides various date/time manipulation capabilities. The shift parameter determines which bar's time to return:
0: Current bar
1: Previous bar
2: Two bars ago
And so on
The timeZoneMode
parameter allows you to specify how the time should be interpreted:
TimeZoneMode.PROJECT
: Returns time in the project's timezone (default)
TimeZoneMode.UTC
: Returns time in UTC