ProBacktest/probacktest · proorder

TICKSIZE

TICKSIZE returns the smallest price increment of the current instrument in ProBacktest and ProOrder, used to convert price distances into ticks or pips.

Syntax

probuilder
TICKSIZE

How it works

Every instrument quotes in discrete steps. On EUR/USD a step might be 0.0001, on an index future it might be 0.5 points. TICKSIZE returns that minimum step for the instrument the strategy runs on, so code can adapt to any market without hard-coded magic numbers.

The main use is unit conversion. A raw price distance such as close - low is expressed in price units, which vary wildly between instruments. Dividing by TICKSIZE turns the distance into a tick count, a number that is comparable across markets and matches how many traders think about stops and targets. Multiplying a tick count by TICKSIZE goes the other way, producing a price offset that is always a valid increment.

TICKSIZE is related to, but distinct from, POINTSIZE and PIPSIZE. The point size is the value of one point in the platform's price display, the pip size is the conventional pip unit on forex pairs, and the tick size is the exchange's minimum increment. On many instruments some of these coincide, on others they differ, which is exactly why the three constants exist separately.

Examples

Example 1, Converting a price distance into pips (ProBacktest)

probuilder
// On EUR/USD this yields 40 instead of the raw 0.0040
StopLossPIPS = (close - low) / TickSize

The distance between the close and the low is divided by the tick size, turning a raw price difference into a tick or pip count that reads naturally.

Example 2, Rounding a stop distance to a valid increment (ProOrder)

probuilder
atr = AverageTrueRange[14](close)
// Snap the ATR-based distance to a whole number of ticks
stopDistance = ROUND(1.5 * atr / TICKSIZE) * TICKSIZE

IF NOT onmarket AND close crosses over average[20](close) THEN
  BUY 1 CONTRACT AT MARKET
  SET STOP LOSS stopDistance / pointsize
ENDIF

An ATR-derived distance is rarely a clean multiple of the minimum increment. Rounding through TICKSIZE guarantees the resulting level is one the market can actually quote.

Example 3, Breakout order one tick above the prior high (ProOrder)

probuilder
IF NOT onmarket THEN
  // Enter as soon as price prints a single tick above yesterday's high
  BUY 1 CONTRACT AT DHigh(1) + TICKSIZE STOP
ENDIF

Adding exactly one TICKSIZE to the previous daily high places the buy stop at the first price that confirms a breakout, on any instrument.

Common errors and gotchas

  • Tick size is not point size. TICKSIZE, POINTSIZE, and PIPSIZE can all differ on the same instrument. Mixing them up shifts every calculated level by a constant factor. Verify which unit an instruction expects, SET STOP LOSS for example works in points.
  • Instrument-dependent value. The same code returns different values on different markets. A strategy tuned with a hard-coded increment breaks when moved to another instrument, which is the problem TICKSIZE is meant to solve.
  • Unrounded levels. Arithmetic on prices often produces values between ticks. Orders at such levels are adjusted or rejected. Snap computed offsets to a multiple of TICKSIZE before using them in orders.
  • Wrong scope. The constant belongs to the trading engine. Pasting strategy code that reads TICKSIZE into an indicator fails to compile, the conversion has to happen inside the ProBacktest or ProOrder code.
  • PIPSIZE, the pip unit of the current instrument.
  • PIPVALUE, monetary value of one pip.
  • POINTSIZE, the point unit of the current instrument.
  • POINTVALUE, monetary value of one point.
  • ROUNDEDUP, rounds an order quantity upward.
  • ROUNDEDDOWN, rounds an order quantity downward.
  • TRADEPRICE, entry price of the current position.
  • STOP, stop-loss configuration whose distances are expressed in points.