Timing · condition block
Cooldown
The cooldown block is true only when at least N candles have passed since the bot's last trade, buy or sell. It is the simplest tool against overtrading when a condition stays true for many candles.
How the engine evaluates it
The engine remembers the candle of the most recent fill. The block is true when the current candle is at least N candles later. Before the first trade it is always true.
Any trade resets it, including a trade made earlier on the same candle by a rule above, because rules run top to bottom and update the portfolio as they go.
true when (current candle − candle of last trade) ≥ N
Botscript syntax
In the Lab you pick this block from the Timing group and fill in its fields. In the code view the same condition is written like this:
cooldown 12
cooldown 24
Settings
| Setting | Values | Default | Notes |
|---|---|---|---|
| Candles | 1 – 1,000,000 | 12 | Counted in candles of the run's candle size. |
How traders use it
- Pair it with state-type conditions such as
rsi(14) < 30that stay true for many candles. - Space out re-entries after an exit:
cooldown 24on the entry rule.
Example bot
bot "Patient Dip Buyer"
guard stacking on
guard max_invested 60%
when price down 2% in 12 and cooldown 24
then buy 20%
when pnl up 6%
then sell 100%
- Allows adding to the position (stacking) but caps it at 60% of equity.
- Adds 20% of cash on each 2% dip, at most once every 24 candles.
- Sells everything 6% above the average entry.
Pitfalls
- Cooldowns count candles, so the same number means different time spans on different candle sizes.
- A sell also resets the cooldown, which can delay the next entry.
Cooldown: frequently asked questions
Does a sell reset the cooldown?
Yes. Any trade, buy or sell, resets it.
Is the cooldown per rule?
No. It counts from the bot's most recent trade, whichever rule made it.
What is it before the first trade?
True. There is no previous trade to wait for.
Does it matter if I don't allow stacking?
Less, because buys are ignored while you hold. It still spaces out a new entry after an exit.
Related blocks
Simulated results are hypothetical. They include only the fee and slippage you set on the bot, not every real-world cost or market condition, and past performance does not guarantee future results. Nothing here is financial advice.