Minute

Category: Date and time

The Minute function in ProBuilder language is used to retrieve the minute component of the timestamp for each bar on the chart. This function is particularly useful for analyzing data in intraday timeframes, where the minute-by-minute movement is significant.

Syntax:

Minute

Example:

To determine the timeframe of the current chart, you can calculate the difference in minutes between consecutive bars. This example also includes a condition to check if the current bar falls in the last half-hour of an hour.

tf = (Minute - Minute[1])
if tf < 0 then
    tf = 60 - abs(tf)
endif

// Check if we are in the last half-hour of the hour
if(Minute > 30) THEN
    HalfHour = 1
ELSE
    HalfHour = 0
ENDIF

RETURN HalfHour
  • The variable tf calculates the difference in minutes between the current bar and the previous bar. If this value is negative (which can happen at the hour transition), the formula adjusts it to provide the correct minute difference.
  • The condition checks if the minute value is greater than 30 to determine if the current time is in the last half-hour of an hour. It sets the HalfHour variable to 1 if true, otherwise 0.

This function is essential for strategies that require precise timing within the hour, such as assessing volatility or trading activity increases during specific periods of the trading session.

Related Instructions:

  • CurrentMinute date and time
  • OpenMinute date and time
  • Logo Logo
    Loading...