Expert Advisors • Indicators • Scripts • Libraries

MQL.RobotFX.org is the biggest collection of MetaTrader expert advisors (MT5 & MT4), indicators, scripts and libraries that can be used to improve trading results, minimize risks or simply automate trading tasks

Updated: Metatrader 5 Script | TickValue_Compare — diagnose differences between TICK_VALUE, LOSS and PROFIT…

Fresh MQL5 code release – perfect for enhancing your MT4/MT5 strategies.

PURPOSE


Compares the three tick-value properties exposed by MetaTrader 5 for every symbol in Market Watch:

Protect profits effectively with the smart Trailing Stop Expert Advisor. Advanced trailing options for MT4/MT5. See it in action.

  • SYMBOL_TRADE_TICK_VALUE (generic).
  • SYMBOL_TRADE_TICK_VALUE_LOSS (used for loss calculations).
  • SYMBOL_TRADE_TICK_VALUE_PROFIT (used for profit calculations).


WHY THIS MATTERS


Many EAs use one of the tick-value properties for risk-based lot sizing. When LOSS and PROFIT differ (as they do for cross-currency pairs on many brokers), choosing the wrong property leads to incorrectly sized positions:

  • Using LOSS: pessimistic loss estimate - smaller lots (safer, conservative for risk management).
  • Using TV: usually equals PROFIT (optimistic) - slightly larger lots than intended.

This script provides empirical per-symbol data so you can make an informed decision based on your specific broker.


USAGE


  1. Add to Market Watch the symbols you want to analyze.
  2. Drop the script on any chart.
  3. Enter the input parameters and click the OK button.
  4. Check the Experts tab for the summary.
  5. If "Save CSV" is enabled, full per-symbol data is exported to a CSV file in MQL5/Files/ (useful for large brokers, since the Experts tab is limited to ~2000 lines).


Image for TickValue_Compare — diagnose differences between TICK_VALUE, LOSS and PROFIT


OUTPUT


Each symbol is classified into one of these categories:

ALL_EQUAL: the three properties match within tol.

TV_MATCHES_PROFIT: TV == PROFIT, LOSS slightly different.

TV_MATCHES_LOSS: TV == LOSS, PROFIT slightly different.

ALL_DIFFER: all three properties are distinct.

A summary at the end aggregates counts per category.


Image for TickValue_Compare — diagnose differences between TICK_VALUE, LOSS and PROFIT


INTERPRETATION


  1. If most/all symbols are ALL_EQUAL, your broker treats LOSS and PROFIT as identical - any of the three properties is safe.
  2. If TV_MATCHES_PROFIT is common (typical pattern), then:

    • For risk-based sizing, use TICK_VALUE_LOSS (most conservative).
    • TV (generic) effectively equals PROFIT, the optimistic value.

Thanks for reading. Discover premium MetaTrader solutions at RobotFX.

73211

Best MetaTrader Indicators + Profitable Expert Advisors