Second

Category: Date and time

The Second function in ProBuilder language is used to retrieve the number of seconds past the minute for the timestamp of the current candlestick in a trading chart. This function is particularly useful for strategies that require precise timing down to the second, such as high-frequency trading algorithms.

Syntax:

Second

Example:

mySecond = Second
RETURN mySecond

This example defines a variable mySecond which stores the number of seconds past the minute of the current candlestick’s timestamp. It then returns this value to the indicator window, which can be useful for debugging or logging in a trading strategy.

Additional Information:

  • The Second function returns an integer between 0 and 59, representing the seconds.
  • This function can be combined with other time-related functions like Hour and Minute to construct full timestamps.
  • Understanding the precise second of a candlestick can be crucial for strategies that are sensitive to the timing of market events or data releases.

For beginners, it’s important to note that the precision of the Second function’s output depends on the granularity of the chart being used. For instance, on a daily chart, the second will always be zero since the candle represents an entire day.

Related Instructions:

  • CurrentSecond date and time
  • OpenSecond date and time
  • Logo Logo
    Loading...