CurrentMonth is a function in ProBuilder language that returns the current month as a numerical value. This function is particularly useful for creating time-specific conditions within trading algorithms or scripts.
Syntax:
CurrentMonth
Example:
The following example demonstrates how to use the CurrentMonth function to check if the current month is October. If it is, a variable HalloweenMonth is set to 1, otherwise, it is set to 0.
IF (CurrentMonth = 10) THEN
HalloweenMonth = 1
ELSE
HalloweenMonth = 0
ENDIF
RETURN HalloweenMonth
Additional Information:
- The CurrentMonth function returns an integer between 1 and 12, where 1 corresponds to January and 12 corresponds to December.
- This function can be used to implement trading strategies that need to adjust behavior based on the month of the year, such as seasonal trends or tax-related decisions.
This function does not require any parameters and can be used directly in any part of the ProBuilder script where a month-based condition is needed.