Watch how to download trading robots for free
Find us on Twitter!
Join our fan page
Interesting script?
So post a link to it -
let others appraise it
You liked the script? Try it in the MetaTrader 5 terminal
Scripts

TickValue_Compare — diagnose differences between TICK_VALUE, LOSS and PROFIT - script for MetaTrader 5

Views:
184
Rating:
(1)
Published:
MQL5 Freelance Need a robot or indicator based on this code? Order it on Freelance Go to Freelance

PURPOSE


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

  • 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).



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.

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.
Heiken ashi as series Heiken ashi as series

Heiken ashi with all buffers set as series

TransactionCostCollector — Broker Cost Profiling Script TransactionCostCollector — Broker Cost Profiling Script

Triple-barrier labeling pipelines frequently use an arbitrary constant (0.5–1.0%) or a legacy spread assumption as the min_ret threshold. A threshold set below the actual round-trip transaction cost causes the pipeline to label cost-driven noise as tradeable signal. The labeled dataset then systematically overstates edge, and any model trained on those labels overfits to an artifact of the labeling scheme rather than to genuine market structure. TransactionCostCollector.mq5 is a standalone script that resolves the data-collection step of this problem.

SetSLByLoss — set Stop Loss on all open positions by target loss amount SetSLByLoss — set Stop Loss on all open positions by target loss amount

Script to set Stop Loss on every open position based on a target loss in the account's currency (e.g. $50 per position). Works on any deposit currency and any forex symbol. Validates broker stops/freeze levels. Currency conversion handled automatically.

MACD Signals MACD Signals

Indicator edition for new platform.