Node reference
Bars In Position
Bars since the position opened.
Rev. 2026.06
Bars In Positionstate
No inputsOutputsBars In Position
Bars
main · number
Configure
- side
- — Which book to read — net, long, or short
- default net
What it does
Counts how many candles the current position has been open.
What happens
Read from the engine's live execution context each candle — it reflects the current run (position, equity, time, trade history), not a computed indicator.
When to use
Time-based exits and minimum-hold rules.
Gotchas
- Reads 0 or −1 when flat.