Date Time
The Date Time rule lets you work with dates and times in your strategy. You can capture the current moment, specify a fixed date and time, or apply time-based adjustments such as adding or subtracting a duration. The output can be used by scheduling rules, time-based conditions, or any rule that accepts a date-time value.
How It Works
The Date Time rule operates in two modes. In Now mode, it outputs the current date and time each time it is evaluated, providing a live timestamp that updates continuously. In Custom mode, you specify a fixed date and time value that remains constant throughout the strategy's execution.
Both modes support an optional time adjustment. You can add or subtract a duration from the base date-time value. This is useful for calculating future or past timestamps, such as determining a deadline that is 4 hours from now, or referencing a time that was 30 minutes before the current moment. The adjustment is applied after the base time is determined, so in Now mode the adjustment shifts from the current moment, while in Custom mode it shifts from your specified time.
Inputs
| Input | Type | Required | Description |
|---|---|---|---|
| Type | Selection | Yes | The mode of operation. Now uses the current date and time. Custom uses a specific date and time that you define. Default: Now. |
| Date Time | Date Time | When Custom | The specific date and time value to use. Only available when Type is set to Custom. |
| Adjust By | Selection | Yes | Optional time adjustment to apply to the base value. Options: None, Add, Subtract. Default: None. |
| Duration | Duration | When Add/Subtract | The time duration to add to or subtract from the base date-time value. Only available when Adjust By is set to Add or Subtract. |
Outputs
| Output | Type | Description |
|---|---|---|
| Date Time | Date Time | The resulting date and time value, after any adjustment has been applied. |
Tips
Combine Date Time with a condition rule to create time-based trading windows. For example, use Now mode with a Subtract adjustment of 5 minutes and compare it against a captured timestamp to check if a certain amount of time has elapsed since an event. You can also use Custom mode to define market session boundaries, such as the London open at 08:00 UTC, for session-based trading strategies.
Was this helpful? Let us know