Round to Tick¶
Math · Transform
Snap each value to the nearest multiple of tick (round half away from zero). Use to quantise a price to a broker tick size or a round-number grid — e.g. an SL/TP level that must land on a real tick for honest MT5/Pine execution.
Round To Tick snaps each value to the nearest multiple of a tick size. Point it at a price level and it lands that level on a real, tradeable increment instead of a fractional in-between value — which matters when an exported stop or target has to sit on a price your broker will actually accept.
How it works¶
Each bar it rounds the input to the nearest multiple of tick, rounding halves away from zero (so 1.23455 with a 0.0001 tick → 1.2346). Set tick to your instrument's minimum price increment for broker-faithful levels, or to a larger round number (e.g. 0.0050) to snap onto a price grid. Lookahead-free.
When to use it¶
Use it on any level you'll hand to the Tester or ship in an export: a computed SL/TP that must land on a real tick for honest MT5/Pine execution, or a round-number entry grid. It removes the mismatch between a mathematically-derived price and what the venue will actually fill, keeping the backtest and the live order aligned.
Example¶
Broker-faithful stop: build a stop level from structure, then Round To Tick with tick = 0.0001 (a 5-digit FX broker) so the exported EA places the stop on a valid price. Wire the rounded level into the Tester's stop input.
Tips & gotchas¶
- Set
tickto the instrument's real increment — it differs by symbol (FX 0.0001/0.00001, indices/stocks vary). - Round half away from zero — deterministic and symmetric.
- Snapping to a large tick makes a price grid; snapping to the broker tick makes levels executable.
Related blocks¶
Inputs¶
| Socket | Type | What to wire in |
|---|---|---|
| In | series / bars |
Value to snap. BARS input uses close. |
Outputs¶
| Output | Type | Plots as | Description |
|---|---|---|---|
| snapped | series |
Line · sub-pane | Value rounded to the nearest tick. |
Parameters¶
| Parameter | Type | Default | What it does |
|---|---|---|---|
| Tick | number · 1e-08–1000000.0 | 1.0 |
Grid / tick size to snap to. |
Reference auto-generated from the block catalog · category Math.