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.
OpenTime
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.
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.