RegularTradingStart

RegularTradingStart ( int yyyyMmDd);

Description

Returns the number of milliseconds elapsed since the epoch (January 1, 1970, 00:00:00 GMT) till the start of the regular trading hours on a given day for the current symbol. The trading day is to be specified using the YYYYMMDD format.

Input parameters

Parameter Default value Description
yyyyMmDd - Defines the trading day in the YYYYMMDD format.

Example

def rth = (RegularTradingEnd(GetYYYYMMDD()) - RegularTradingStart(GetYYYYMMDD())) / AggregationPeriod.HOUR;
AddLabel(yes, "RTH duration (hrs): " + rth);

This example script displays a chart label with duration of a regular trading session in hours.