MT5 Tick Size vs Point: A Test Harness for Price Distance

Leader ●1 ●9 ●28
calendar_today ago • schedule1 min read

Illustration of uncertainty in execution

The smallest quoted point and the minimum price change used as a trading tick can differ. If a program divides an exit distance by SYMBOL_POINT but multiplies by the monetary value of a trading tick, the resulting loss estimate may use incompatible units. Test the units before testing position sizing.

Educational and simulation content only. This is not financial advice, intermediation or an investment recommendation. Trading can result in loss of capital.

A fictional contract

Imagine a demo symbol with a point of 0.01 price units, a tick size of 0.05, and a loss-side tick value of 2 account-currency units per lot. A 0.50 price move spans 10 trading ticks, not 50. For 0.10 lots, a simplified linear estimate is 10 × 2 × 0.10 = 2 account-currency units. Substituting point for tick size would multiply that estimate by five. These inputs are fictional and do not describe any particular broker or instrument.

The official MQL5 symbol reference defines SYMBOL_POINT, SYMBOL_TRADE_TICK_SIZE, and SYMBOL_TRADE_TICK_VALUE_LOSS separately. Read actual symbol properties from the platform; do not assume that every symbol, account currency, or loss direction shares the same values.

An executable unit test

This example checks arithmetic under a deliberately narrow assumption: constant loss-side tick value and linear scaling with volume. It does not submit orders or model commissions, gaps or currency conversion changes.

from decimal import Decimal

def linear_estimate(entry, exit_price, tick_size, tick_value, lots):
    entry, exit_price, tick_size, tick_value, lots = map(
        lambda x: Decimal(str(x)),
        (entry, exit_price, tick_size, tick_value, lots),
    )
    if tick_size <= 0 or tick_value <= 0 or lots <= 0:
        raise ValueError("Tick size, tick value and lots must be positive")
    distance = abs(entry - exit_price)
    return distance / tick_size * tick_value * lots

assert linear_estimate(100, "99.50", "0.05", 2, "0.10") == Decimal("2.00")
assert linear_estimate(100, "100.50", "0.05", 2, "0.10") == Decimal("2.00")
assert linear_estimate(100, 100, "0.05", 2, "0.10") == 0

The absolute distance checks units only. It does not prove that the exit lies on the loss side: that depends on whether the simulated position is long or short. Check direction and valid prices separately. Prices and tick values can change; contract rules may make a simplified linear calculation unsuitable.

Compare with the platform

OrderCalcProfit estimates the result in the account currency for an order type, symbol, volume and specified open and close prices. In a demo environment:

  1. Record symbol, account currency, direction, open price, exit price, volume, point, tick size and loss-side tick value.
  2. Check the return value of OrderCalcProfit. If it fails, record the platform error and reject the estimate; never interpret failure as zero.
  3. Compare the signed result with the simplified calculation, using the same prices and volume. Investigate discrepancies rather than silently taking the smaller number.
  4. Repeat for long and short positions, multiple symbols and the broker's allowed volume increments. Keep fixtures and platform version with the results.
  5. Account separately for known costs, execution gaps and contract-specific rules. An estimate at the requested exit price is not a guaranteed loss limit.

MT5 also specifies minimum, maximum and step sizes for volumes. Those constraints are a separate test; see our earlier position-sizing article for the minimum-volume edge case. The Gueta Quant position sizer provides an educational comparison, not a guarantee of execution.

🔥 Join developers growing publicly
Share your knowledge, build in public, and grow your developer presence with a global community.

More Posts

Your AI Doesn't Just Write Tests. It Runs Them Too.

Kevin Martinez - May 12

TypeScript Complexity Has Finally Reached the Point of Total Absurdity

Karol Modelski - Apr 23

Dashboard Operasional Armada Rental Mobil dengan Python + FastAPI

Masbadar - Mar 12

SpeedCurve vs Apogee Watcher: Multi-Tenant Dashboards at Agency Price

ApogeeWatcherverified - Sep 15

I Wrote a Script to Fix Audible's Unreadable PDF Filenames

snapsynapseverified - Apr 20
chevron_left
1.4k Points • 38 Badges
Bogotá, Colombia • guetaquant.com
11Posts
2Comments
12Connections
Founder & Lead Quantitative Engineer at Gueta Quant (https://guetaquant.com).

I design open-source... Show more

Related Jobs

View all jobs →

Commenters (This Week)

4 comments
1 comment
1 comment

Contribute meaningful comments to climb the leaderboard and earn badges!