Support and Resistance_v3

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

This tool is designed to automatically identify and visualize key price levels on your trading chart, specifically focusing on "Support" and "Resistance" zones. These are critical areas where the market often reacts, potentially reversing direction or slowing down significantly.

How the Logic Works

The script operates by scanning historical price data to find specific turning points in the market's movement. It utilizes a mathematical method to detect peaks and valleys:

  • Identifying Resistance (Red Markers): The logic looks for "Upper Fractals"—points where the price reaches a local peak and begins to trend downward. When the script detects one of these highs, it places a marker on the chart. If no new peak is found at a specific moment, the script maintains the level of the previous high, creating a continuous horizontal reference point.
  • Identifying Support (Blue Markers): Simultaneously, the logic scans for "Lower Fractals"—points where the price hits a local trough and begins to move upward. When these lows are identified, they are marked on the chart as support levels. Similar to the resistance logic, if no new low is detected, the script carries forward the previous support level.

Visual Output

Instead of cluttering your screen with complex lines, the tool uses distinct dots to represent these levels:

  • Red Dots: Represent identified Resistance levels (ceiling prices where the market may struggle to break through).
  • Blue Dots: Represent identified Support levels (floor prices where the market may find a base to bounce from).

By automatically plotting these levels, the script allows you to see the "skeleton" of the market structure, helping you visualize where price action has historically stalled or pivoted without having to manually draw lines on every candle.

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

//+------------------------------------------------------------------+ 
//|                                       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