OpenHour is a function in ProBuilder language that retrieves the opening hour of the current bar, according to the user’s local time zone. This function is particularly useful for strategies that need to make decisions based on the time of day, such as day trading strategies that might focus on market open or close times.
OpenHour
iHour = OpenHour
if iHour = 9 then
// Execute specific trading logic at 9 AM
endif
This example demonstrates how to use the OpenHour function to check if the current bar’s opening hour is 9 AM. If it is, the script executes specific trading logic, which could be tailored to take advantage of typical market behaviors observed at this time.
This function does not require any parameters and is straightforward to implement in any trading strategy that requires time-based decision making.