Time Since Node

The Time Since node counts minutes or bars since this trade's entry, the last entry, the last exit, the last losing exit or the session open, and says when a threshold is reached. How it differs from the Bracket Order's Time exit and the Entry's Cooldown.

NodeBy AlgoLiftUpdated 4 min read
On this page 8How it worksNot the same as the Time exit or the CooldownExample: give a trade 30 minutes to workSettingsOutputsUse something else whenWhen it doesn't behaveGoing further

Some rules are about time passing rather than the time of day. Give a trade 30 minutes to prove itself. Stay out for an hour after a loss. Let a few bars go by after the last exit. The Time Since node counts minutes or bars from an event you pick, and tells you when the count reaches a threshold.

Takes
Nothing. It counts from an event you pick
Gives
Reached (true or false) and Elapsed (a number)
Reach for it
Time in a trade, or time since the last entry, exit or loss, is part of a rule

How it works

Pick what to count from, whether to count minutes or bars, and the amount at which Reached turns true. Elapsed is the count itself, if you'd rather do your own comparing.

SinceCounts fromWhere it works
This trade's entryThe fill of the trade being managedOnly in that trade's exit logic
Last entryThe latest entry by any entry in the strategyAnywhere
Last exitThe latest time the strategy went flatAnywhere
Last losing exitThe latest trade that closed at a lossAnywhere
Session openThe trading day's session open: 18:00 the evening before on ES and NQ, 09:30 on a stockAnywhere

Minutes are real clock minutes, so they keep running overnight and over a weekend. Bars count the closes of a series (the primary one unless you pin another), so they only move while that market trades. A minute threshold goes up to 10,080, a week; a bar threshold up to 500.

Not the same as the Time exit or the Cooldown

AlgoLift has three ways to say "after a while", and each is the best tool for one job.

You wantUse
Every trade closed after N minutes or bars, or at a clock timeThe Bracket Order's Time exit
An entry to wait after its trade, or after a loss, before firing againThe Entry's Cooldown
Time as one condition inside a bigger ruleTime Since

The Cooldown and Time Since overlap, and the difference is scope. A Cooldown belongs to one entry and arms on that entry's own trades. Time Since's last entry, last exit and last losing exit are strategy-wide, so any entry's trade resets them. With one entry the two agree. With several, pick the one that matches what you mean.

Example: give a trade 30 minutes to work

Say your NQ 5m entries tend to work quickly or not at all, and the slow ones drift into the stop. You'd like to cut a trade that's still underwater after 30 minutes, and let one that's working run to its target.

In the trade's exit logic, add Time Since set to This trade's entry, Minutes, Reached at 30. Add a Trade Variable reading the entry price, and a Comparison: Current Price Less Than the entry price. AND Reached with that Comparison through a Logic node into a Set Exit Condition.

From the 30-minute mark on, the trade closes the moment it's below its entry. A trade in profit carries on under its bracket. The Bracket Order's Time exit couldn't do this alone: it would close every trade at 30 minutes, winners included.

Settings

Since
Default This trade's entry
This trade's entry, Last entry, Last exit, Last losing exit or Session open.
Count in
Default Minutes
Minutes on the exchange clock, or bars.
Reached at
Default 30
When Reached turns true: 1 to 10,080 minutes (to two decimal places), or 1 to 500 bars.
Counted series
Default Primary series
For bars, whose closes are counted. Pick a series and it stays put when you change the primary; pick Primary series and it follows.

Outputs

Reached
True or false
True once Elapsed is at or past the threshold. An event that never happened counts as reached.
Elapsed
Number
Minutes or bars since the event. Reads “never” before it happens.

Use something else when

Every trade should close after N minutes
After N minutes or bars, at a clock time, or a set time before the close, with its own exit type in the results.
Wait after an exit before re-entering
Per entry, and it can also wait until the next trading day or until a condition re-arms it.
The rule is about the time of day
Hours and weekdays, in New York time, with daylight saving and half days handled.
Bars since a condition was last true
Time Since counts from trades and the session open. For “bars since RSI was last under 30”, use Since.

When it doesn't behave

“This trade's entry exists only while a trade is open”

You've wired it into something outside a trade's exits, usually an entry's condition, where there's no trade yet to count from. This trade's entry only works inside that trade's exit logic. To space entries out, use Last entry, or the Entry's Cooldown.

“An hour after the open” fires in the evening

On ES and NQ the session opens at 18:00 the evening before, so an hour after the session open is 19:00. For an hour into regular hours, use a Time Window with its edge anchored to the RTH open instead.

My “within an hour of the last exit” rule never fires at the start

Until the first exit there's nothing to count from, so Elapsed reads “never” and anything that needs it to be small stays false. That's by design. It starts working after the first trade closes.

Going further

Elapsed is a number, so it can shape a rule as well as gate it. Run it through a Math node into a Set Stop Loss and a stop can tighten as a trade ages.

The threshold can be swept. The event and the unit can't: switching from the last exit to the last losing exit, or from minutes to bars, asks a different question rather than tuning the same one.

Or ask the copilot