Support and Resistance (Barry)_v1

Download script
Author: Click here: Barry Stander
Support and Resistance (Barry)_v1

This tool is designed to automatically identify and visualize key price boundaries on your trading charts, specifically focusing on "Support" and "Resistance" levels. These are critical zones where the price has historically shown a tendency to stall, reverse, or react significantly.

How the Logic Works

The script operates by scanning historical price data to detect specific structural turning points in the market. It accomplishes this through the following steps:

1. Identifying Peak and Trough Points The logic looks for "Fractals"—these are specific price points where a high or low is higher (or lower) than the surrounding candles. Essentially, it searches for the "peaks" and "valleys" of the market movement.

2. Defining Resistance (Sell Zones) The script identifies upper peaks in the price action. When it detects a new high point that meets its criteria, it marks this as a Resistance level. This signifies a ceiling where sellers may enter the market or buyers may be pushed back down. On your chart, these are displayed as red indicators.

3. Defining Support (Buy Zones) Simultaneously, the script identifies lower troughs in the price action. When it detects a new low point, it marks this as a Support level. This signifies a "floor" where buyers may step in to prevent further decline or where sellers might be exhausted. These are displayed as blue indicators on your chart.

4. Maintaining Continuous Levels One of the key features of this logic is its ability to carry these levels forward. Rather than just marking a single point in time, the script ensures that once a significant support or resistance level is established, that value remains consistent until a new, stronger peak or trough is formed. This allows you to see continuous horizontal trends on your chart, making it easier to visualize where the "walls" of the market are currently located.

Summary for Traders

By automating the detection of these levels, the script removes the guesswork from identifying price boundaries. It highlights where the market has previously struggled to break through, allowing you to better anticipate potential reversals and make more informed decisions on where to place your entries or take-profit targets.

Indicators Used
Fractals
Miscellaneous
Implements a curve of type %1
15 Views
0 Downloads
0 Favorites
Support and Resistance (Barry)_v1
/*-----------------------------+
|			       |
| Shared by www.Aptrafx.com    |
|			       |
+------------------------------*/

//+------------------------------------------------------------------+
//|                Support and Resistance                            |
//|                Copyright © 2004  Barry Stander                   |
//|                http://myweb.absa.co.za/stander/4meta/            |
//+------------------------------------------------------------------+
#property copyright "Click here: Barry Stander"
#property link      "http://myweb.absa.co.za/stander/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);
 
//---- drawing settings
 SetIndexArrow(0, 119);
 SetIndexArrow(1, 119);
  
   SetIndexStyle(0,DRAW_ARROW,STYLE_DOT,1,Red);
   SetIndexDrawBegin(0,i-1);
   SetIndexBuffer(0, v1);
   SetIndexLabel(0,"Resistance");
    

   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