Welcome Forex EA downloads & MT4/MT5 auto-trading resources — EAs, Gold EAs, quant tools and real-world automation.
Sign In Sign Up

MT4 Supply and Demand Area Indicator Download | Forex Indicator Download - MetaTrader 4 Resources - MetaTrader 4 Resources

author EAcpu | 5 reads | 0 comments |

The Supply and Demand Zone indicator in the MetaTrader 4 platform is one of the essential tools for technical analysis . It attracts strong supply and demand areas.

This Supply and Demand indicator for MT4 automatically identifies past strong demand zones (support zones) or strong supply zones (resistance zones) and highlights them using colored bars.

Supply and demand area specification table

The specifications of " Supply and Demand Area Indicators " are as shown in the following table:

Indicator categories: MT4 Support and Resistance Indicators Supply and Demand MT4 Indicators
MT4 indicator levels
Platforms: MetaTrader 4 Indicators
Trading Skills: Intermediate
Indicator Types: Inverse MT4 Indicator
Time frame: Multi Time Frame MT4 Indicators
Trading Style: Intraday MT4 Indicators
Trading Tools: Forward Markets MT4 Indicators Stock Market MT4 Indicators Cryptocurrency MT4 Indicators Forex MT4 Indicators

The code provided is intended for educational purposes to demonstrate concepts and logic and is not intended to be a final or ready-to-use version.

 //+------------------------------------------------------------------+
//|Supply and demand area indicators- core implementation|
//|all rights reservedTradingFinder.com - 2023-2025 |
//+------------------------------------------------------------------+

// Structure to store area information
struct   Blocks   {
datetime   BlockStartTime ;    // Zone start time
int        BlockType ;         // 1=support level,2=resistance level
double     BlockHigh ;         // price ceiling
double     BlockLow ;          // lower price level
datetime   BlockEndTime ;      // When a zone fails
bool       BlockTouched ;      // Zone retested
color      BlockColor ;        // Visual color
} ;

// Main input parameters(Simplified)
input   bool    ShowSupport      =   true ;           // Show support area
input   bool    ShowResistance   =   true ;           // Show resistance zone
input   color   ColorSupport     =   C '34,177,76' ;   // Support color
input   color   ColorResist      =   C '237,28,36' ;   // Resistance color

// Global variables
Blocks   blocks [ ] ;
datetime   Level2Time [ ] ;    //Market structure point
double     Level2Price [ ] ;   // Price of structure point

//+------------------------------------------------------------------+
//|Check if a new candle has formed or if the chart has moved|
//+------------------------------------------------------------------+
bool   Timer1Check ( )   {
static   datetime   Timer1   =   0 ;
if ( Timer1 == 0   ||   Timer1 != iTime ( Symbol ( ) , PERIOD_CURRENT , 0 ) )   {
Timer1   =   iTime ( Symbol ( ) , PERIOD_CURRENT , 0 ) ;
return   true ;
}
return   false ;
}

//+------------------------------------------------------------------+
//|Create new areas based on market structure points|
//+------------------------------------------------------------------+
void   CreateNewBlock ( int   index ,   int   structPoint )   {
blocks [ index ] .BlockStartTime   =   Level2Time [ structPoint ] ;
blocks [ index ] .BlockEndTime   =   D '2030.12.31' ;   //Default end time (far in the future)

// Determine support or resistance based on price action
if ( Level2Price [ structPoint ]   <   Level2Price [ structPoint -1 ] )
blocks [ index ] .BlockType   =   1 ;   // Support zone
else
blocks [ index ] .BlockType   =   2 ;   // Resistance zone

int   candle   =   iBarShift ( Symbol ( ) , PERIOD_CURRENT , Level2Time [ structPoint ] ) ;

//Set price level based on type
if ( blocks [ index ] . BlockType   ==   1 )   {
blocks [ index ] .BlockLow   =   iLow ( Symbol ( ) , PERIOD_CURRENT , candle ) ;
blocks [ index ] .BlockHigh   =   MathMax ( iOpen ( Symbol ( ) , PERIOD_CURRENT , candle ) ,
iClose ( Symbol ( ) , PERIOD_CURRENT , candle ) ) ;
blocks [ index ] .BlockColor   =   ColorSupport ;
}   else   {
blocks [ index ] .BlockHigh   =   iHigh ( Symbol ( ) , PERIOD_CURRENT , candle ) ;
blocks [ index ] .BlockLow   =   MathMin ( iOpen ( Symbol ( ) , PERIOD_CURRENT , candle ) ,
iClose ( Symbol ( ) , PERIOD_CURRENT , candle ) ) ;
blocks [ index ] .BlockColor   =   ColorResist ;
}

// Create a visible rectangle for the area
string   name   =   "Zone-"   +   TimeToString ( blocks [ index ] . BlockStartTime ) ;
RectangleCreate ( 0 ,   name ,   0 ,
blocks [ index ] . BlockStartTime ,   blocks [ index ] . BlockLow ,
blocks [ index ] . BlockEndTime ,   blocks [ index ] . BlockHigh ,
blocks [ index ] . BlockColor ,   STYLE_SOLID ,   1 ,   true ) ;
}

//+------------------------------------------------------------------+
//|Check if the area has been touched or invalidated|
//+------------------------------------------------------------------+
void   CheckZoneStatus ( int   zoneIndex )   {
// Implementation details...
// 1. Check if the price deviates from the zone
// 2. Check if the price returns to test the area
// 3. Check if the price breaks out (invalidate the zone)
}

//+------------------------------------------------------------------+
//|Main function-identify and update areas|
//+------------------------------------------------------------------+
void   Main ( )   {
// Get market structure points (simplified)
GetMarketStructure ( Level2Time ,   Level2Price ) ;

// Process each structure point
for ( int   i = 0 ;   i < ArraySize ( Level2Time ) ;   i ++ )   {
// Check if there is already an area at this point
bool   exists   =   false ;
for ( int   j = 0 ;   j < ArraySize ( blocks ) ;   j ++ )   {
if ( Level2Time [ i ]   ==   blocks [ j ] . BlockStartTime )   {
exists   =   true ;
break ;
}
}

// If you need to create a new area
if ( ! exists )   {
int   index   =   ArraySize ( blocks ) ;
ArrayResize ( blocks ,   index + 1 ) ;
CreateNewBlock ( index ,   i ) ;
}
}

// Update the status of an existing region
for ( int   i = 0 ;   i < ArraySize ( blocks ) ;   i ++ )   {
CheckZoneStatus ( i ) ;
}
}

Indicator Overview

Supply and demand zones are formed based on past price action and are displayed on the chart using colored bars . The bars remain on the chart until they are automatically populated.

The Color Bars MT4 Support and Resistance Indicator is divided into two categories:

  • If price doesn't hit the market, it means less supply or demand levels .
  • When the price reaches supply or demand levels , its significance increases and the probability of price reversal rises from these levels.

Uptrend Conditions

The price chart of the AUD/NZD currency pair is shown on the 5 minute time frame. In this indicator, the price reaches the demand zone (support zone) and shows signs of reversal, such as bullish formation , engulfing candlestick (green).

This signal can indicate potential price reversals coming from demand zones and provide suitable entry points for buy trades .

Bullish Trend in Supply and Demand Zones Indicator
Supply and Demand Zones Indicator Bullish Trend Price Reversal from Demand Zones

downtrend conditions

The image below shows the Bitcoin Cash (BTC/USD) price chart on the one-hour time frame.

Price reaches a supply zone (resistance zone) and shows signs of trend reversal, such as doji and bearish formation engulfing patterns in this zone.

Supply and Demand Zones Indicator in a Bearish Trend
Supply and Demand Zones Indicator Price Reversals from Supply Zones in Bearish Trend

Indicator Settings

The figure below shows the adjustable parameter supply and demand area indicator :

Supply and Demand Zones Indicator Settings
Image showing adjustable settings for supply and demand area indicators
  • Show support zone: show support zone
  • Display resistance area: display resistance area
  • Program touch area: display touch area
  • Show untouched area: Show untouched area
  • Show the last area. 0 means display all: Display all zones
  • Hide the union owned by two regions: Hide the overlap of two regions
  • Color Unaffected Support: Color of untouched support areas
  • Color Untouched Resistor: Color of untouched resistance area
  • Color touch support: Color of touch support area
  • Show the first market period: Show the first market period
  • Show market cycle 2: Show market cycle 2
  • First cycle market color: the color of the first market cycle
  • Second cycle market color: the color of the second market cycle

C onclusion

The Supply and Demand indicator in The MetaTrader 4 is a powerful tool for identifying key support and resistance zones .

This MT4 Support and Resistance Indicator identifies demand zones (potential buying areas) and supply zones (potential selling areas), recognizes key reversal points , and identifies appropriate entry and exit zones .

(1)

📦 Download attachments/Download Files

Verification code Refresh