Root causes
- A loop performs too many iterations on a single historical bar or realtime tick.
- Nested loops make the outer loop exceed the per-bar limit.
- The same search or aggregation is repeated on every bar instead of using a bounded calculation or cached state.