Trade Cost Meter for MT4/MT5
Info
The Trade Cost Meter for MT4/MT5 is a Indicator for MetaTrader 5 that this indicator displays crucial trade cost information directly on your chart for the current symbol. Understanding trade costs is vital, especially on lower timeframes where small stops can be significantly impacted by spreads and commissions.
Usage
This tool is typically used for enhancing chart analysis and decision making.
Platform
This Indicator works exclusively on MetaTrader 5 (both build 600+ and newer versions).
Setup
Place the downloaded file in MQL5/Indicators folder via File ? Open Data Folder in MetaTrader 5.
How to Install and Use Trade Cost Meter for MT4/MT5
1. Installation: Place your file in the MQL/Indicators folder via "Open Data Folder" and restart your terminal.
2. Loading: Find the indicator in the Navigator, drag it onto your chart, and configure the input parameters in the popup window.
3. Customization: Press Ctrl+I to open the indicator list, select your tool, and click "Properties" to change colors, levels, or visual styles.
4. Updating: Replace the old file in the Indicators folder with the new version and restart the platform to apply changes.
Frequently Asked Questions
Q: Why is my indicator not showing? A: Verify the file is in the MQL/Indicators folder, or try right-clicking the "Indicators" tree in the Navigator and clicking "Refresh."
Q: Do custom indicators slow down the platform? A: Too many complex indicators can impact performance; remove unused ones via the "Indicator List" (Ctrl+I).
Q: Can I use MT4 indicators on MT5? A: No, MQL4 and MQL5 are distinct languages; ensure the indicator is compiled specifically for your platform version.
What this tool does
This indicator displays crucial trade cost information directly on your chart for the current symbol.
Typical Use Case
This Indicator excels in automated trading and technical analysis on MetaTrader 5.
Compatible Platform & Setup
This Indicator works on MetaTrader 5. Place the file in the MQL5/Indicators folder and restart the terminal.
Description & Settings
Related: Real-Time Broker Execution Analysis: Spread, Swap, and Cost Indicator - another powerful indicator for MetaTrader 5 traders.
This indicator displays crucial trade cost information directly on your chart for the current symbol.Also recommended: Detecting Missing Bars in MetaTrader History Before Backtesting - similar indicator with strong performance on MetaTrader 5.
Understanding trade costs is vital, especially on lower timeframes where small stops can be significantly impacted by spreads and commissions. A strategy that appears profitable before costs might incur losses after them.
The Trade Cost Meter analyzes and presents the following:
- Current, average, and maximum spread over recent ticks.
- Commission per 1 lot (as entered in the input parameters).
- Overnight swap cost, including the triple swap day.
- Total round-trip cost for trading 1 lot.
For each timeframe from M1 to D1, the indicator compares the total trade cost to a calculated typical stop loss (N x ATR). It then quantizes this cost as a percentage of the total risk (R) for each trade.
Interpreting the Results:
Green
: Trade costs account for less than 3% of the risk (R) by default. This indicates favorable trading conditions for the specific timeframe.
Orange
: Trade costs are between 3% and 10% of the risk (R). Costs are noticeable, suggesting that a strategy requires a clear edge to remain profitable.
Red
: Trade costs exceed 10% of the risk (R). A significant portion of each trade's potential profit is allocated to the broker.
Example:
Consider XAUUSD on a demo account with a spread of 0.15. If the stop loss is set at 1.5 ATR, the trade costs represent 6.2% of the risk on M1, 2.4% on M5, and only 0.5% on H1. Wider spreads or added commissions will increase these percentages, particularly on lower timeframes.
Input Parameters:
Commission per 1 lot per side (in account currency): Enter 0 if your account does not have commissions. Refer to your broker's account conditions for this value.
Stop distance, x ATR (default 1.5): Multiplier for the Average True Range (ATR) to determine the typical stop loss distance.
ATR period (default 14): The period used for calculating the ATR.
Ticks for average and maximum spread (default 5000): The number of recent ticks to consider for average and maximum spread calculations.
Red and green thresholds (% of R): Customizable percentage values to define the color-coding for trade cost risk.
Panel corner: Select the display position for the indicator panel on the chart.
Notes:
The indicator converts spreads and swaps into monetary values using the symbol's tick value, ensuring compatibility across Forex, metals, indices, and CFDs. Swap costs in interest modes are provided as approximations.
A practical application involves comparing two account types from the same broker (one with commission, one without). By entering the commission value, you can observe its impact on the round-trip trade cost.
The panel refreshes every 5 seconds, even in the absence of new ticks. This indicator is for informational purposes only and does not execute trades.
This tool was updated in 2026.
You may also like: Five-Point Retest Indicator: Automated Trade Structure Analysis - excellent alternative for indicator users on MetaTrader 5.
Source Code
#property copyright "RobotFX"
#property link "https://robotfx.org"
#property version "1.00"
#property description "This code is educational. Feel free to use, modify and upgrade as you wish. Visit ROBOTFX.ORG for professional trading tools"
#property indicator_chart_window
#property indicator_buffers 0
#property indicator_plots 0
input double InpCommission = 0.0;
input double InpStopATR = 1.5;
input int InpATRPeriod = 14;
.......
⚠ Limitations & Risk Warning
- This tool is provided for educational and testing purposes only.
- Past performance does not guarantee future results.
- Trading involves substantial risk of loss. Use on a demo account first.
- Results may vary depending on market conditions, broker, and settings.
- We recommend thorough backtesting and forward testing before using with real funds.