Support and Resistance_v2

Download script
Author: Support and Resistance Barry_Stander_4@yahoo.com
Support and Resistance_v2

This tool is designed to help traders identify key price levels on a financial chart by automatically highlighting areas of "Support" and "Resistance." In trading, these are the invisible barriers where price tends to stall, reverse, or break out.

How the Logic Works

The script functions by scanning the historical price data of the currency pair or asset you are viewing. It specifically looks for structural turning points in the market using a methodology known as "Fractals."

1. Identifying Resistance (Price Ceilings) The script searches for specific peaks where the price moved upward and then pulled back. When it detects one of these high-point formations, it marks it as a level of Resistance. On your chart, these are represented by red markers. These points suggest areas where sellers have historically stepped in to push the price back down.

2. Identifying Support (Price Floors) Simultaneously, the script scans for "troughs"—points where the price moved downward and then bounced back up. It identifies these as levels of Support. These are displayed as blue markers on your chart and represent zones where buyers have historically entered the market to prevent the price from falling further.

3. Maintaining Continuity A key feature of this logic is its ability to "carry over" information. Rather than showing isolated dots that disappear, the script ensures that once a new Support or Resistance level is established, that value is maintained consistently across the visual display. This allows you to see a continuous line of reference, helping you visualize these horizontal boundaries more clearly as they evolve over time.

Summary for the Trader

Instead of you having to manually hunt for every peak and valley in the past, this script automates that process. It paints the chart with clear visual cues:

  • Red markers indicate where the market has historically struggled to break upward (Resistance).
  • Blue markers indicate where the market has historically struggled to fall through (Support).

By using this, you can more easily see the "landscape" of the market, helping you decide where it might be safer to enter a trade or where you should be cautious about potential price reversals.

Indicators Used
Fractals
Miscellaneous
Implements a curve of type %1
9 Views
0 Downloads
0 Favorites
Support and Resistance_v2
//+------------------------------------------------------------------+ 
//|                                       Support and Resistance.mq4 | 
//+------------------------------------------------------------------+
//|                Support and Resistance                            |
//|                Copyright © 2004/5     Barry Stander              |
//|                http://www.4Africa.net/4meta/                     |
//+------------------------------------------------------------------+

#property copyright "Support and Resistance             Barry_Stander_4@yahoo.com"
#property link      "http://www.4Africa.net/4meta/"
#property indicator_chart_window
#property indicator_buffers 2
#property indicator_color1 Red
#property indicator_color2 Blue

//---- buffers
double v1[];
double v2[];
double val1;
double val2;
int i;
  
int init()
  {

  IndicatorBuffers(2);
 
   SetIndexArrow(0, 119);
   SetIndexStyle(0,DRAW_ARROW,STYLE_DOT,1,Red);
   SetIndexDrawBegin(0,i-1);
   SetIndexBuffer(0, v1);
   SetIndexLabel(0,"Resistance");
   
   SetIndexArrow(1, 119);
   SetIndexStyle(1,DRAW_ARROW,STYLE_DOT,1,Blue);
   SetIndexDrawBegin(1,i-1);
   SetIndexBuffer(1, v2);
   SetIndexLabel(1,"Support");
 
   return(0);
  }

int start()
  {
  
  i=Bars;
while(i>=0)
 {
   
   val1 = iFractals(NULL, 0, MODE_UPPER,i);
    if (val1 > 0) 
     v1[i]=High[i];
    else
     v1[i] = v1[i+1];
  
   val2 = iFractals(NULL, 0, MODE_LOWER,i);
    if (val2 > 0) 
     v2[i]=Low[i];
    else
     v2[i] = v2[i+1];

     i--;
 }   

 return(0);
}
 
//+------------------------------------------------------------------+

Comments