OpenTime

Category: Date and time

Definition and Purpose:

The OpenTime function in ProBuilder language is used to retrieve the opening time of the current bar on the chart, formatted as HHMMSS based on the user’s local time zone. This function is particularly useful for strategies that require precise time-based conditions to trigger trading actions or analyses.

Syntax:

OpenTime

Example Usage:

Suppose you want to check if the current bar opened at 9:30 AM. You could use the OpenTime function in the following way:

IF OpenTime = 93000 THEN
    // Execute specific trading logic here
ENDIF

This code snippet checks if the opening time of the current bar is exactly 9:30:00 AM, and if so, it executes the specified trading logic.

Additional Information:

  • The time is returned as a six-digit integer, where the first two digits represent the hour, the next two digits represent the minutes, and the last two digits represent the seconds.
  • It is important to note that the time is based on the user’s local time zone as set in the ProRealTime platform settings.
  • This function does not take any parameters and can be used directly in conditional statements or as part of larger expressions.

Understanding the OpenTime function is essential for developing time-specific trading strategies and for performing analysis that depends on the exact opening time of market bars.

Related Instructions:

  • CurrentTime date and time
  • OpenTimestamp date and time
  • TIME date and time
  • Timestamp date and time
  • Logo Logo
    Loading...