The CurrentTime function in ProBuilder language is used to retrieve the current time of the trading session in HHMMSS (hours, minutes, seconds) format. This function is particularly useful for strategies that need to execute actions based on specific times during the trading day.
CurrentTime
Below is a simple example demonstrating how to use the CurrentTime function to check if it is a specific time (07:30:00 AM) and set a variable accordingly:
IF (CurrentTime = 073000) THEN
WakeUp = 1
ELSE
WakeUp = 0
ENDIF
RETURN WakeUp
This script checks if the current time equals 07:30:00 AM. If true, it sets the WakeUp variable to 1, otherwise, it sets it to 0. The RETURN statement then outputs the value of WakeUp.
Understanding and utilizing the CurrentTime function can significantly enhance the precision of trade execution based on time criteria within the ProBuilder environment.