MT5 installation guide · Custom indicator
How to Install and Set Up an Indicator in MT5
Add a custom indicator to MetaTrader 5, change its inputs and check that the chart matches the intended calculation. This guide uses the free TF ATR Risk Bands 1.00 indicator on MT5 desktop for Windows.
Before you start
Use a connected MT5 desktop terminal and a demo chart for the walkthrough. A custom MT5 indicator uses an EX5 file; an MT4 EX4 file is incompatible. The MT5 mobile apps and web terminal do not use this desktop file-installation workflow. If you already have a compatible demo account, you can use it without opening another account.
1. Download and extract the ZIP
Save the ZIP and choose Extract All in Windows. The package contains:
| File | Purpose |
|---|---|
TF_ATR_Risk_Bands.ex5 |
Compiled indicator, ready for MT5 |
TF_ATR_Risk_Bands.mq5 |
Readable source code |
README-TF-ATR-Risk-Bands.md |
Indicator instructions |
CHECKSUMS-TF-ATR-Risk-Bands.txt |
File integrity reference |
The EX5 is sufficient to run the supplied build. Keep the source and documentation if you want to inspect how the lines are calculated.
2. Copy the indicator to MT5
In the terminal you use, choose File → Open Data Folder. Open MQL5 → Indicators. You may create a TradeForex subfolder. Copy the EX5 there, with the MQ5 alongside it if wanted:
MT5 data folder
└── MQL5
└── Indicators
└── TradeForex
├── TF_ATR_Risk_Bands.ex5
└── TF_ATR_Risk_Bands.mq5
For other packages, preserve any documented dependencies: .mqh include files belong under MQL5/Include using the supplied folder structure. ATR Risk Bands has no extra include-folder requirement. Do not move an indicator into Experts; that folder is for EAs. MetaQuotes’ file locations.
4. Set the three inputs
In the indicator properties window, open Inputs and begin with the supplied defaults:
| Input | Default | Valid setting | Effect |
|---|---|---|---|
ATRPeriod |
14 |
An integer of at least 2 | Number of bars used by the ATR calculation |
StopATR |
2.0 |
Greater than zero | Distance of the two inner reference lines |
TargetATR |
4.0 |
Greater than StopATR |
Distance of the two outer reference lines |
For example, StopATR=2.0 and TargetATR=1.0 is invalid and prevents initialization. The values come from the supplied source. They are display settings, not tested entry, exit or profitability recommendations.
Click OK. This indicator needs neither DLL imports nor WebRequest access. Leave the Algo Trading toolbar switch off if you are only following this indicator tutorial.
5. Understand the four lines
The source calculates the lines from each bar’s close and that bar’s ATR value:
| Line | Default formula | Default appearance |
|---|---|---|
| Upper target reference | Close + 4 × ATR | Green, dotted |
| Upper stop reference | Close + 2 × ATR | Gold, dashed |
| Lower stop reference | Close − 2 × ATR | Gold, dashed |
| Lower target reference | Close − 4 × ATR | Green, dotted |
The names describe distances. They do not instruct you to buy, sell, or place an order at those prices. The lines move with each candle’s close and volatility; they are not fixed to your actual entry price and do not trail a real broker order.
For an illustrative completed candle with close 1.10000 and ATR 0.00100, the default lines are 1.10400, 1.10200, 1.09800 and 1.09600, from top to bottom. On usual EURUSD pricing, the inner distance is 20 pips and the outer distance is 40 pips. These are hypothetical calculation inputs, not current market prices.
6. Verify the display
Open View → Data Window and point at a completed candle. Look for the four named indicator values. If you also add MT5’s standard Average True Range with period 14, you can compare the ATR value with the distance from that candle’s close to each line.
The current, unfinished candle is bar 0. Its close and ATR can change with incoming prices, so its reference bands can move. Use a completed candle for a stable arithmetic check; revised broker history can still change historical calculations.
If no bands appear, let history synchronize. The source waits for at least ATRPeriod + 2 bars and sufficient ATR buffer data. Very old bars without enough history may remain empty. MetaQuotes’ indicator controls.
7. Adjust the appearance and save your setup
Right-click the chart, open Indicators List, select TF ATR Risk Bands (14), and choose Properties. Use Inputs for the calculation and Colors for line colour, style and width. Choose colours that remain visible on your chart background.
Use the chart’s Templates → Save Template command to save the chart setup under a descriptive name such as ATR-Risk-Study. Applying a template can replace the chart’s existing setup, so save anything you need before applying another one. MetaQuotes’ chart templates.
8. Turn a reference distance into a risk calculation
A visible band is only one input to a trade plan. First define the entry and invalidation level using your own documented rules. Then calculate the distance from the proposed entry to the actual stop and use the position-size calculator to estimate monetary exposure.
For arithmetic only: a USD 10,000 account with a 0.25% risk budget allows USD 25 before costs. A 20-pip stop with a USD 10 pip value per standard lot implies 25 / (20 × 10) = 0.125 standard lots before costs. With a 0.01 lot step, round down to 0.12 and reduce further if needed for costs. Confirm the symbol’s actual pip value, contract size, minimum lot and trading costs. This example does not specify a trade to take.
MT5 indicator not showing: separate file, loading and display problems
A missing line does not always mean the indicator failed to install. First decide whether the file is absent from Navigator, attachment fails, or the indicator is attached but its plotted values are not visible. The checks below help isolate those cases; they are not a claim that a runtime acceptance test has been completed.
The indicator is absent from Navigator
From the terminal you are using, open File → Open Data Folder and inspect MQL5/Indicators. Confirm that the ZIP was extracted and that the runnable file ends in EX5. An EX4 file is for MT4, and renaming it does not make it an MT5 indicator. Source in MQ5 format must compile successfully to produce a runnable build.
Refresh the Indicators branch or restart that terminal after copying the file. With multiple terminals, repeat the folder check in each relevant window; do not assume they share one data folder. Follow MetaQuotes’ documented file locations and the package’s dependency instructions.
The indicator appears, but does not attach
Note the message and time of the failed attachment in the platform logs. For the TF ATR Risk Bands version described above, confirm ATRPeriod ≥ 2, StopATR > 0 and TargetATR > StopATR. Those are input-validity conditions, not suggestions for a profitable strategy. Test one change at a time so that you can identify which input caused the failure.
Do not use the Algo Trading switch as a display repair. This indicator draws lines and does not submit trade requests. The existing package documentation states that it needs no DLL import or WebRequest access. Use the exact log message to guide the next check; MetaQuotes documents the logs.
The indicator is attached, but the chart looks empty
- Open the chart’s Indicators List and confirm that the intended indicator is actually on that chart.
- Check the active timeframe. Open the selected indicator’s Properties → Visualization and ensure the current chart timeframe is selected. An indicator enabled only on H1 can appear hidden after switching to H4.
- Make the values inspectable. Enable Show in the Data Window where available, then open the Data Window and point to a recent completed candle. Distinguish missing indicator rows from named rows whose values are blank; a hidden row alone does not prove a calculation failed.
- If the expected numerical values are present, inspect line colours, line width and chart scale. A line outside the visible price range or matching the background can look absent even when a value exists.
- If named values remain blank after those checks, inspect synchronized price history, sufficient bars and ATR data, and the platform logs. Compare with a recent completed candle rather than the oldest visible bar. These display controls cannot create missing calculation data or repair a custom program.
This order separates data from presentation. Changing colours cannot create missing ATR data, and downloading more history cannot repair a line colour that is invisible on the selected background. See MetaQuotes’ indicator controls.
Other custom indicators can deliberately hide Data Window output or leave plotting values empty. Follow their documented output rules before treating every blank as an installation failure.
A numerical check without using the current candle
Use an invented completed candle with close 1.25000 and ATR 0.00080. At the documented multipliers of 2 and 4, the inner distance is 0.00160 and the outer distance is 0.00320. The four expected values for those hypothetical inputs are:
| Band | Calculation | Value |
|---|---|---|
| Upper outer | 1.25000 + 4 × 0.00080 | 1.25320 |
| Upper inner | 1.25000 + 2 × 0.00080 | 1.25160 |
| Lower inner | 1.25000 − 2 × 0.00080 | 1.24840 |
| Lower outer | 1.25000 − 4 × 0.00080 | 1.24680 |
These figures check the arithmetic only. They are not market observations or a measured result from this release. For your actual chart, use the close and ATR for the same completed candle, symbol, timeframe and period. The unfinished candle can change with incoming prices; a switch to another timeframe changes the input data.
Record a repeatable display check
Save the indicator filename/version, terminal build, symbol, timeframe, three inputs and completed candle timestamp with the values you inspected. That record lets you repeat the comparison after a setting change. A visually plausible chart alone does not establish correct calculations, a valid entry or an appropriate stop.
A band is a reference distance, not an order and not a lot-size model. Inspect monetary exposure separately with the forex position size calculator or the gold and index calculator. For software that can submit orders, use the separate MT5 EA guide.
Troubleshooting
| Symptom | What to check |
|---|---|
| Indicator absent from Navigator | Correct data folder; extracted EX5; MQL5/Indicators; refresh or restart |
| Loading fails | ATRPeriod ≥ 2, StopATR > 0, and TargetATR > StopATR; inspect the platform logs |
| No lines on the chart | History and ATR data available; visible line colours; indicator listed on this chart |
| Current values keep changing | Normal for the unfinished candle; inspect a completed candle instead |
| Values differ after changing timeframe | Expected: this indicator follows the chart timeframe |
| Nothing trades automatically | Expected: the indicator only draws reference lines |
To remove it, open Indicators List, select the indicator and choose Delete. Removing ATR Risk Bands only removes its display; it cannot close or change positions because it has no trading function.
Continue with the right tool
Read the ATR explanation and worked examples or browse the full indicator library. For software that can place orders, follow the separate EA installation and activation guide.
If you need a compatible demo platform, compare broker eligibility, platforms and costs. The download is free and does not depend on using a referral link. Broker reviews may contain marked affiliate links from which we can receive a commission.
Checked 8 September 2026 against the downloadable source and official platform documentation. Display calculations and installation checks do not establish a profitable trading strategy.
