Support & Resistance Indicator for MetaTrader 5: What It Is, How It Works, and Its Benefits
Friday, August 14, 2026Support and resistance are two of the most important concepts in technical analysis. Traders use these price levels to identify areas where the market may react, reverse, pause, or continue its movement. However, manually identifying support and resistance levels can be time-consuming, especially when the market is moving quickly.
The Support & Resistance Indicator for MetaTrader 5 is designed to help traders automatically identify and display potential support and resistance areas based on Fractals. Instead of manually searching through historical candles, the indicator continuously processes market data and maintains the most recently identified support and resistance levels directly on the chart.
This article explains what the indicator is, how it works, how to read it, and what benefits it can provide when used as part of a technical analysis strategy.
1. What Is the Support & Resistance Indicator?
The Support & Resistance Indicator is a custom MT5 indicator that uses the built-in Fractals indicator as its primary source of information.
The purpose of the indicator is simple:
- Identify potential resistance points using upper fractals.
- Identify potential support points using lower fractals.
- Display the identified levels on the price chart.
- Keep the latest identified support and resistance price available across subsequent candles.
In the source code, the indicator creates two primary buffers:
double SellBuffer[];
double BuyBuffer[];
These buffers are responsible for storing and displaying the support and resistance values calculated by the indicator.
The indicator is configured to run directly in the main chart window, meaning traders can see the calculated levels together with the normal candlesticks.
2. What Is a Fractal?
To understand how this indicator works, it is important to understand the concept of a Fractal.
A market fractal is a price pattern that identifies a local turning point. In general, an upper fractal occurs around a local high, while a lower fractal occurs around a local low.
An upper fractal can be interpreted as an area where buying momentum previously pushed the market upward, but the price subsequently failed to continue higher. This makes the area potentially useful as a resistance reference.
A lower fractal represents the opposite situation. The market previously moved downward but then found buying pressure around that area. Therefore, the level can potentially act as support.
The important point is that a fractal is based on historical price structure. It does not guarantee that price will reverse from the level in the future.
3. How Does the Indicator Work?
The indicator first creates a handle for the MT5 Fractals indicator:
FRA_Handle = iFractals(NULL, 0);
This tells MetaTrader 5 to use the Fractals indicator for the current symbol and current timeframe.
If MetaTrader cannot create the Fractals handle, the indicator stops initialization and reports an error. This is important because the support and resistance calculations depend on the Fractals data.
Reading the Fractal Data
The indicator then copies the upper and lower fractal information into two arrays:
CopyBuffer(FRA_Handle, 0, 0, to_copy, FRAUp);
CopyBuffer(FRA_Handle, 1, 0, to_copy, FRALo);
The first buffer contains upper fractal information, while the second contains lower fractal information.
The indicator then checks every relevant candle and determines whether a fractal exists.
When an upper fractal is detected, the indicator stores the candle's high price:
if (upVel && upVel != EMPTY_VALUE)
{
BuyBuffer[bar] = high[bar];
}
Similarly, when a lower fractal is detected, it stores the candle's low price:
if (loVel && loVel != EMPTY_VALUE)
{
SellBuffer[bar] = low[bar];
}
This process allows the indicator to extract important price points from the fractal structure.
4. How Does It Maintain the Support and Resistance Levels?
One of the useful characteristics of this indicator is that it does not simply display a value on the candle where the fractal occurs and then immediately remove it.
Instead, when a new fractal is not detected, the indicator carries forward the previous value:
BuyBuffer[bar] = BuyBuffer[bar + 1];
and:
SellBuffer[bar] = SellBuffer[bar + 1];
This means that the latest detected support or resistance price can continue to be represented across subsequent candles until another relevant fractal replaces it.
Conceptually, this creates a continuously updated reference level.
5. Support and Resistance in Practical Trading
Support is generally considered an area where selling pressure may decrease and buying pressure may increase. When price approaches support, traders may watch for evidence that buyers are becoming active.
Resistance is generally considered an area where buying pressure may decrease and selling pressure may increase. When price approaches resistance, traders may watch for evidence of rejection or a potential reversal.
The indicator provides these levels automatically, allowing traders to focus more on price behavior around the levels rather than spending time manually identifying every previous swing point.
6. How to Use the Indicator
Using the indicator is straightforward.
Step 1: Open MetaTrader 5
Open your MetaTrader 5 platform and select the financial instrument you want to analyze. The indicator can be used on different markets and timeframes, depending on the trader's strategy.
Step 2: Select a Timeframe
Select the desired timeframe, such as M15, M30, H1, H4, or another timeframe.
The fractal calculations are based on the timeframe currently being displayed. Therefore, changing the timeframe can change the location of the identified support and resistance levels.
Step 3: Attach the Indicator
Add the Support & Resistance indicator to the chart.
The indicator will calculate the Fractals data and begin displaying the corresponding support and resistance information.
Step 4: Observe Price Reaction
Do not use the level simply because it exists. Instead, observe how price behaves when it approaches the level.
For example, if price approaches a resistance level and produces several rejection candles, this may provide additional evidence that sellers are active.
Likewise, if price approaches a support level and produces bullish rejection or strong buying momentum, traders may consider this additional evidence that the support area is being defended.
7. Using Support and Resistance for Entries
The indicator can be used as a reference for potential trade entries, but the level itself should not automatically be treated as a trading signal.
For a potential buy setup, a trader may look for:
- Price approaching a support level.
- A rejection of lower prices.
- A bullish candlestick pattern.
- Increasing buying momentum.
- Confirmation from another technical indicator or market structure.
For a potential sell setup, a trader may look for:
- Price approaching a resistance level.
- A rejection of higher prices.
- A bearish candlestick pattern.
- Increasing selling momentum.
- Confirmation from another technical indicator or market structure.
This approach is generally more reliable than entering a trade solely because price has reached a support or resistance level.
8. Using the Indicator for Stop Loss Placement
Support and resistance can also be useful when determining potential stop-loss locations.
For example, if a trader opens a buy position near support, the trader may consider placing the stop loss below the relevant support structure rather than placing it at an arbitrary distance.
For a sell position near resistance, the stop loss may be considered above the relevant resistance structure.
However, the appropriate stop-loss distance depends on the market's volatility, timeframe, trading strategy, spread, and risk management rules.
The indicator itself does not calculate a recommended stop-loss or take-profit value. It simply provides a price-structure reference that traders can incorporate into their own risk-management decisions.
9. Using the Indicator for Breakout Trading
Support and resistance levels can also be used for breakout analysis.
Suppose price repeatedly approaches a resistance level. Eventually, price may break above that level with strong momentum.
Instead of treating every touch as a sell signal, a breakout trader may wait for price to move above the resistance and then look for confirmation that the breakout is genuine.
The same concept applies to support. If price breaks below an established support level, traders may monitor the market for bearish continuation.
In some situations, a broken resistance level can later become support, while a broken support level can later become resistance. This behavior is commonly referred to as a role reversal.
10. Multi-Timeframe Analysis
One of the strongest ways to use support and resistance is through multi-timeframe analysis.
For example, a trader could use a higher timeframe such as H4 to understand the larger market structure and then use H1 or M15 to search for more precise entry opportunities.
A support or resistance level that appears significant on a higher timeframe may be more important than a level that exists only on a very low timeframe.
However, higher-timeframe levels do not guarantee a reversal. Markets can break significant levels when momentum, volatility, or fundamental factors are strong enough.
11. Benefits of This Indicator
The Support & Resistance Indicator provides several practical benefits.
Automatic Level Detection
The indicator automatically processes fractal information, reducing the need to manually identify every local high and low.
Visual Market Structure
The displayed levels help traders understand where important historical price reactions have occurred.
Time Saving
Instead of manually scanning many candles, traders can use the indicator as an initial reference when analyzing a chart.
Useful for Different Strategies
The levels can be incorporated into reversal strategies, breakout strategies, trend-following strategies, price-action analysis, and multi-timeframe analysis.
Works Directly on the MT5 Chart
Because the indicator is designed for MetaTrader 5's main chart window, traders can analyze the calculated levels together with candlestick price action.
12. Important Limitations
Although the indicator can be useful, traders should understand its limitations.
First, Fractals are based on historical price information. A newly forming market structure may not immediately be confirmed as a fractal.
Second, support and resistance are not guaranteed reversal points. Price can break through any historical level.
Third, the indicator does not analyze economic news, market sentiment, liquidity, fundamental events, or unexpected volatility.
Fourth, using an indicator alone is generally not enough to create a complete trading system.
For these reasons, traders should combine the indicator with appropriate risk management and, when appropriate, other forms of technical or fundamental analysis.
13. Understanding the Buy and Sell Buffer Names
An important technical detail in the source code is that the buffer names are called BuyBuffer and SellBuffer. These names describe how the developer organized the data internally, but they should not automatically be interpreted as direct buy and sell trading signals.
The indicator is fundamentally designed to represent support and resistance information.
A support level does not necessarily mean "buy now," and a resistance level does not necessarily mean "sell now."
Instead, these levels should be treated as areas where traders should pay closer attention to price action.
14. Why Confirmation Is Important
Suppose the indicator identifies a support level at a particular price. Price reaches the level, but instead of bouncing upward, it continues falling strongly.
This demonstrates why the level should not be treated as an automatic trading signal.
A more complete trading process could be:
- Identify the support or resistance level.
- Wait for price to approach the level.
- Observe price action around the level.
- Look for confirmation.
- Define the trade's stop-loss level.
- Calculate the acceptable position size based on risk.
- Define the potential reward or take-profit objective.
- Only then consider executing the trade.
This process transforms the indicator from a simple visual tool into one component of a more structured trading methodology.
15. Final Conclusion
The Support & Resistance Indicator for MetaTrader 5 is a useful technical-analysis tool that automatically identifies price levels using the MT5 Fractals calculation.
Its primary purpose is to make important historical price areas easier to observe. Upper fractals are used to identify potential resistance information, while lower fractals are used to identify potential support information. Once a level is identified, the indicator carries the latest value forward until another relevant fractal updates the structure.
The biggest benefit is convenience. Traders do not have to manually inspect every historical candle to locate potential swing points. The indicator provides a continuously updated reference that can be used alongside candlestick analysis, market structure, trend analysis, breakout strategies, and multi-timeframe analysis.
However, it is important to remember that support and resistance are areas of interest, not guaranteed trading signals. Markets can reject a level, consolidate around it, or break through it completely.
Therefore, the best way to use this indicator is as part of a complete trading plan. Combine the identified levels with price action, trend direction, market structure, volatility, confirmation signals, and disciplined risk management.
When used in this way, the Support & Resistance Indicator can become a valuable tool for helping traders answer one of the most important questions in technical analysis:
"Where are the important price areas that the market may react to next?"
By automatically highlighting these areas, the indicator can help make chart analysis more structured, consistent, and efficient.
16. FullSource Code
//+------------------------------------------------------------------+
//| Support_and_Resistance.mq5 |
//| Copyright © 2005, Дмитрий |
//| |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2006, MetaQuotes Software Corp."
#property link "http://www.metaquotes.net/"
//---- номер версии индикатора
#property version "1.12"
//---- отрисовка индикатора в главном окне
#property indicator_chart_window
//---- для расчета и отрисовки индикатора использовано два буфера
#property indicator_buffers 2
//---- использовано всего два графических построения
#property indicator_plots 2
//+----------------------------------------------+
//| объявление констант |
//+----------------------------------------------+
#define RESET 0 // Константа для возврата терминалу команды на пересчет индикатора
//+----------------------------------------------+
//| Параметры отрисовки медвежьего индикатора |
//+----------------------------------------------+
//---- отрисовка индикатора 1 в виде символа
#property indicator_type1 DRAW_ARROW
//---- в качестве цвета уровней поддержки использован розовый цвет
#property indicator_color1 clrDarkGreen
//---- толщина линии индикатора 1 равна 1
#property indicator_width1 1
//---- отображение метки поддержки
#property indicator_label1 "Support"
//+----------------------------------------------+
//| Параметры отрисовки бычьго индикатора |
//+----------------------------------------------+
//---- отрисовка индикатора 2 в виде символа
#property indicator_type2 DRAW_ARROW
//---- в качестве цвета уровней сопротивления использован зеленый цвет
#property indicator_color2 clrMaroon
//---- толщина линии индикатора 2 равна 1
#property indicator_width2 1
//---- отображение метки сопротивления
#property indicator_label2 "Resistance"
//+----------------------------------------------+
//| Входные параметры индикатора |
//+----------------------------------------------+
//+----------------------------------------------+
//---- объявление динамических массивов, которые будут в
// дальнейшем использованы в качестве индикаторных буферов
double SellBuffer[];
double BuyBuffer[];
//---
int StartBars;
int FRA_Handle;
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int OnInit() {
//---- инициализация глобальных переменных
StartBars = 6;
//---- получение хендла индикатора iFractals
FRA_Handle = iFractals(NULL, 0);
if (FRA_Handle == INVALID_HANDLE) {
Print(" Не удалось получить хендл индикатора iFractals");
return (INIT_FAILED);
}
//---- превращение динамического массива в индикаторный буфер
SetIndexBuffer(0, SellBuffer, INDICATOR_DATA);
//---- осуществление сдвига начала отсчета отрисовки индикатора 1
PlotIndexSetInteger(0, PLOT_DRAW_BEGIN, StartBars);
//--- создание метки для отображения в DataWindow
PlotIndexSetString(0, PLOT_LABEL, "Support");
//---- символ для индикатора
PlotIndexSetInteger(0, PLOT_ARROW, 158);
//---- индексация элементов в буфере как в таймсерии
ArraySetAsSeries(SellBuffer, true);
//---- превращение динамического массива в индикаторный буфер
SetIndexBuffer(1, BuyBuffer, INDICATOR_DATA);
//---- осуществление сдвига начала отсчета отрисовки индикатора 2
PlotIndexSetInteger(1, PLOT_DRAW_BEGIN, StartBars);
//--- создание метки для отображения в DataWindow
PlotIndexSetString(1, PLOT_LABEL, "Resistance");
//---- символ для индикатора
PlotIndexSetInteger(1, PLOT_ARROW, 158);
//---- индексация элементов в буфере как в таймсерии
ArraySetAsSeries(BuyBuffer, true);
//---- Установка формата точности отображения индикатора
IndicatorSetInteger(INDICATOR_DIGITS, _Digits);
//---- имя для окон данных и лэйба для субъокон
string short_name = "Support & Resistance";
IndicatorSetString(INDICATOR_SHORTNAME, short_name);
//--- завершение инициализации
return (INIT_SUCCEEDED);
}
//+------------------------------------------------------------------+
//| Custom indicator iteration function |
//+------------------------------------------------------------------+
int OnCalculate(const int rates_total,
const int prev_calculated,
const datetime & time[],
const double & open[],
const double & high[],
const double & low[],
const double & close[],
const long & tick_volume[],
const long & volume[],
const int & spread[]) {
double bidPrice = SymbolInfoDouble(_Symbol, SYMBOL_BID);
double askPrice = SymbolInfoDouble(_Symbol, SYMBOL_ASK);
// Calculate the price directly between Bid and Ask
double midPrice = (bidPrice + askPrice) / 2.0;
//---- проверка количества баров на достаточность для расчета
if (BarsCalculated(FRA_Handle) < rates_total || rates_total < StartBars) return (RESET);
//---- объявления локальных переменных
int to_copy, limit, bar;
double FRAUp[], FRALo[], upVel, loVel;
//---- расчеты необходимого количества копируемых данных
//---- и стартового номера limit для цикла пересчета баров
if (prev_calculated > rates_total || prev_calculated <= 0) // проверка на первый старт расчета индикатора
{
to_copy = rates_total; // расчетное количество всех баров
limit = rates_total - StartBars - 1; // стартовый номер для расчета всех баров
} else {
to_copy = rates_total - prev_calculated + 3; // расчетное количество только новых баров
limit = rates_total - prev_calculated + 2; // стартовый номер для расчета новых баров
}
//---- индексация элементов в массивах как в таймсериях
ArraySetAsSeries(FRAUp, true);
ArraySetAsSeries(FRALo, true);
ArraySetAsSeries(high, true);
ArraySetAsSeries(low, true);
//---- копируем вновь появившиеся данные в массивы
if (CopyBuffer(FRA_Handle, 0, 0, to_copy, FRAUp) <= 0) return (RESET);
if (CopyBuffer(FRA_Handle, 1, 0, to_copy, FRALo) <= 0) return (RESET);
//---- основной цикл расчета индикатора
for (bar = limit; bar >= 0; bar--) {
BuyBuffer[bar] = EMPTY_VALUE;
SellBuffer[bar] = EMPTY_VALUE;
//----
upVel = FRAUp[bar];
loVel = FRALo[bar];
//----
if (upVel && upVel != EMPTY_VALUE) {
BuyBuffer[bar] = high[bar];
} else {
BuyBuffer[bar] = BuyBuffer[bar + 1];
}
if (loVel && loVel != EMPTY_VALUE) {
SellBuffer[bar] = low[bar];
} else {
SellBuffer[bar] = SellBuffer[bar + 1];
}
}
//----
return (rates_total);
}
//+------------------------------------------------------------------+





