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.
| Since | Counts from | Where it works |
|---|---|---|
| This trade's entry | The fill of the trade being managed | Only in that trade's exit logic |
| Last entry | The latest entry by any entry in the strategy | Anywhere |
| Last exit | The latest time the strategy went flat | Anywhere |
| Last losing exit | The latest trade that closed at a loss | Anywhere |
| Session open | The trading day's session open: 18:00 the evening before on ES and NQ, 09:30 on a stock | Anywhere |
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 want | Use |
|---|---|
| Every trade closed after N minutes or bars, or at a clock time | The Bracket Order's Time exit |
| An entry to wait after its trade, or after a loss, before firing again | The Entry's Cooldown |
| Time as one condition inside a bigger rule | Time 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
Outputs
Use something else when
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.