SuperSR7
Download scriptThis script is designed to automatically identify and plot key price levels on your trading chart, specifically focusing on "Support" and "Resistance" zones. Instead of cluttering the screen with every minor price movement, the logic filters out market noise to highlight only the most significant structural turning points.
How it Works
1. Identifying Structural Peaks (Fractals) The core logic scans historical price data to find specific "fractal" patterns. These are points where the price reaches a local high or low relative to the candles immediately surrounding them.
- For Resistance, it looks for a peak that is higher than its neighbors on both the left and right sides.
- For Support, it looks for a trough that is lower than its neighbors on both the left and right sides.
2. The "Gap" Filter (Avoiding Clutter) A unique feature of this script is its ability to ignore minor fluctuations. It calculates the distance (the "gap") between a newly discovered fractal peak/trough and the previous level identified by the script.
- If the new point is too close to the previous one, the script ignores it.
- It only updates the Support or Resistance line if the price has moved significantly enough (based on your customizable settings) to be considered a "new" structural level.
3. Trend Persistence The script carries these levels forward across the chart. If a new valid fractal is not found that meets the required distance, the script maintains the previous level's position. This creates continuous, clear lines that help traders visualize where the market has historically struggled to break through.
Key Visual Indicators
- Red Arrows/Lines: These represent Resistance. They mark historical "ceilings" where price has faced selling pressure.
- Blue Arrows/Lines: These represent Support. They mark historical "floors" where price has faced buying pressure.
Summary for the Trader
By using this logic, you can see a "map" of the market's structural boundaries. It identifies major turning points while automatically filtering out insignificant price "wiggles," allowing you to focus on the significant zones where price action is most likely to react.
//+------------------------------------------------------------------+
//| SuperSR 6.mq4 |
//| Copyright © 2006 Scorpion@fxfisherman.com |
//+------------------------------------------------------------------+
#property copyright "FxFisherman.com"
#property link "http://www.fxfisherman.com"
#property indicator_chart_window
#property indicator_buffers 2
#property indicator_color1 Red
#property indicator_color2 Blue
extern int Contract_Step=150;
extern int Precision=10;
extern int Shift_Bars=1;
extern int Bars_Count= 1000;
//---- buffers
double v1[];
double v2[];
int init()
{
IndicatorBuffers(2);
SetIndexArrow(0, 159);
SetIndexStyle(0,DRAW_ARROW,STYLE_SOLID,1,Red);
SetIndexDrawBegin(0,-1);
SetIndexBuffer(0, v1);
SetIndexLabel(0,"Resistance");
SetIndexArrow(1, 159);
SetIndexStyle(1,DRAW_ARROW,STYLE_SOLID,1,Blue);
SetIndexDrawBegin(1,-1);
SetIndexBuffer(1, v2);
SetIndexLabel(1,"Support");
watermark();
return(0);
}
int start()
{
double gap;
double contract = (Contract_Step + Precision) * Point;
int i;
int shift;
bool fractal;
double price;
i = Bars_Count;
while(i>=0)
{
shift = i + Shift_Bars;
// Resistance
price = High[shift+2];
fractal = price >= High[shift+4] &&
price >= High[shift+3] &&
price > High[shift+1] &&
price > High[shift];
gap = v1[i+1] - price;
if (fractal && (gap >= contract || gap < 0))
{
v1[i] = price + (Precision * Point);
}else{
v1[i] = v1[i+1];
}
// Support
price = Low[shift+2];
fractal = price <= Low[shift+4] &&
price <= Low[shift+3] &&
price < Low[shift+1] &&
price < Low[shift];
gap = price - v2[i+1];
if (fractal && (gap >= contract || gap < 0))
{
v2[i] = price - (Precision * Point);
}else{
v2[i] = v2[i+1];
}
i--;
}
return(0);
}
//+------------------------------------------------------------------+
void watermark()
{
ObjectCreate("fxfisherman", OBJ_LABEL, 0, 0, 0);
ObjectSetText("fxfisherman", "fxfisherman.com", 11, "Lucida Handwriting", RoyalBlue);
ObjectSet("fxfisherman", OBJPROP_CORNER, 2);
ObjectSet("fxfisherman", OBJPROP_XDISTANCE, 5);
ObjectSet("fxfisherman", OBJPROP_YDISTANCE, 10);
return(0);
}
Comments