Spread ATR Gate Trading Cost Meter
- Indicatori
-
Keiki Ishii
Independent MQL5 developer from Japan.
I build tools for MetaTrader 5 traders: risk managers, indicators and Expert Advisors.
How I work:
- Every product is tested in the Strategy Tester and on demo accounts (hedging and netting) before release. - Versione: 1.0
- Attivazioni: 5
Spread ATR Gate shows how much of your move the trading cost takes. It has no trade signals and never trades.
Spread in points does not say much on its own. 30 points is small on a 4-hour gold chart and large on a 1-minute chart. Spread ATR Gate compares the round-trip cost (spread + the commission you enter) with the average bar range (ATR) and with the target distance you plan to use, and colors the result green, yellow or red.
It works on any symbol: forex (including JPY pairs), gold and other metals, index CFDs, crypto CFDs. Points, pips and money are read from the symbol settings of your terminal, so the numbers follow your broker's digits and contract size.
What the panel shows (on the main chart)
-
Spread now in price units and in points, and the average recorded bar spread of the last bars.
-
Commission (round trip) that you enter: money per 1.00 lot, points, or percent of the trade value.
-
Round trip cost = spread + commission, in price units, points and account money per 1.00 lot.
-
ATR with your period and timeframe (last completed bar).
-
Cost / ATR in percent.
-
Target that you set: an ATR multiple, points, pips or a price distance.
-
Cost / target in percent, with a bar and a color: green below your first threshold, yellow between, red from your second threshold.
-
Swap long and short per day, in points and money per 1.00 lot, converted from the swap type of the symbol (points, base / margin / profit / account currency, annual interest, reopen).
-
Swap payback: how many calendar days of swap credit add up to the round-trip cost. Triple-swap days and weekends are taken from the terminal (per-day swap ratios, or the triple-swap weekday SYMBOL_SWAP_ROLLOVER3DAYS). If the swap is a charge, it says "never".
-
Symbol facts: digits, point and the pip size used, the triple-swap day, the time of the last tick (yellow when the market looks closed).
History (sub-window)
A histogram of the round-trip cost as a percent of ATR for each bar, colored by your thresholds. It uses the spread recorded with each bar (MT5 does not store every tick's spread in bar history), so it shows when in the day the cost is usually high — for example around the daily rollover. The bar being formed uses the live spread.
Alerts (optional)
A popup and/or push notification when the cost / target enters the yellow or red zone, with a minimum time between alerts.
What it does not do
-
No buy or sell arrows, no signals, no orders. It does not open, close or modify positions.
-
Slippage is not included. Swap values can change; they are read from the terminal each time.
-
It does not make any strategy profitable. It shows the cost so that you can decide whether a planned target is large enough.
Main inputs
-
ATR: ATR timeframe / ATR period
-
Cost: Commission type / Commission, round trip
-
Target: Target distance type / Target distance / Pip size in price units (0 = auto)
-
Colors: Green below this % of the target / Red from this % of the target / colors
-
History: Show cost/ATR histogram / Bars to calculate / Bars for the average bar spread
-
Alerts: Alert when cost / target enters (off, red, yellow or red) / Minimum seconds between alerts / Popup / Push
-
Panel: Show panel / corner / X and Y offset / font size / colors
Default values: ATR(14) on the chart timeframe, no commission, target 1.0 × ATR, green below 10%, red from 25%, alerts off.
Notes
-
Pip size: 10 points on 3- and 5-digit forex symbols, 1 point on everything else. The panel shows the pip size it uses. Set "Pip size in price units" if you count pips differently (for example 0.10 on gold).
-
Enter the commission as a round trip (open + close). If your broker quotes it per side, enter twice the value.
-
The panel shows WAITING until the account, symbol prices and ATR are loaded.
-
The sub-window holds the histogram. If you turn the histogram off, the sub-window stays small.
Support
Questions and bug reports: send a private message to the seller (Equity Guard Tools) on MQL5.
