SuperSR 6_v2

Download script
Author: FxFisherman.com
SuperSR 6_v2

This tool is designed to automatically identify and plot key price levels on your trading chart, specifically focusing on "Support" and "Resistance" zones. By analyzing historical price movement, the script helps traders visualize where the market has previously reacted, potentially signaling areas where the price might stall or reverse in the future.

How the Logic Works

The script operates by scanning through past price data to identify specific geometric patterns known as "fractals." These are essentially local peaks and valleys in the market's movement.

Identifying Resistance (Ceilings) To find resistance levels, the tool looks for a "peak" where the highest price of a specific candle is higher than the candles immediately surrounding it (both to its left and right). Once a peak is found, the script checks the distance between this new peak and the previous established resistance level.

  • The Logic: If the new peak is significantly far away from the old one (based on a user-defined "Contract Step"), the tool treats it as a new, valid resistance level and marks it on your chart in Red.
  • Consistency: If the new peak is too close to the previous one, the script ignores it to prevent clutter, maintaining the most significant historical price point.

Identifying Support (Floors) The tool uses the exact same logic but in reverse to find support levels. It looks for "valleys"—points where the lowest price of a candle is lower than those around it.

  • The Logic: When a new valley is identified, the script calculates the distance from the previous support point. If that distance meets the required threshold, the tool establishes it as a new support level and marks it in Blue.
  • Consistency: Similar to resistance, if the new valley is too close to the existing support, the script keeps the previous level to ensure the chart remains clean and readable.

Key Functional Features

  • Dynamic Filtering: By using a "Contract Step," the script ensures that only major structural changes are highlighted. This prevents the chart from being overwhelmed by minor price fluctuations, allowing you to see the "big picture" of market structure.
  • Precision Adjustments: The tool includes a precision factor that slightly offsets the markers from the actual peak/valley. This provides a small visual buffer, making it easier to see clearly where these levels sit on the candles.
  • Visual Clarity: The script automatically distinguishes between Support (Blue) and Resistance (Red), providing an immediate visual cue of the market's boundaries as it develops over time.
Miscellaneous
Implements a curve of type %1
10 Views
0 Downloads
0 Favorites
SuperSR 6_v2
//+------------------------------------------------------------------+
//|                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;
//---- buffers
double v1[];
double v2[];
double val1;
double val2;
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
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=Bars;
   int shift;
   bool fractal;
   double price;
   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