SecondsTillTime

SecondsTillTime ( int tillTime );

Description

Returns the number of seconds till the specified time (24-hour clock notation) in the EST timezone. Note that this function always returns zero when chart's aggregation period is greater than or equal to 1 day.

Input parameters

Parameter Default value Description
tillTime - Defines time until which seconds are counted, in the HHMM format, 24-hour clock notation.

Example

input CloseTime = 1600;
input DurationHours = 1;

def durationSec = DurationHours * 60 * 60;
def secondsRemained = SecondsTillTime(closeTime);

plot Price = if secondsRemained >= 0 and secondsRemained <= durationSec then close else double.NaN;

This example draws the close plot based on the defined duration and through the specified time in EST.