Author: mandorr@gmail.com
Diapazon

This tool is designed to provide traders with a clear visual representation of price action by identifying specific volatility boundaries and the central balance point of the market. It simplifies how you perceive price extremes over a set timeframe, helping you see where the "ceiling" and "floor" are located.

How it Works

The indicator functions by scanning the historical data of the chart based on a user-defined period (the number of previous bars it looks at). It performs three primary calculations:

  • Upper Boundary: The script identifies the highest price reached within the specified lookback period. This creates a "ceiling" line on your chart, showing you the recent peak of market activity.
  • Lower Boundary: Simultaneously, it identifies the lowest price reached during that same period. This creates a "floor" line, marking the recent valley of market movement.
  • Median Point: It then calculates the exact midpoint between these two boundaries. This is represented as a dotted line, which helps identify the equilibrium or the "fair value" where the price sits between its extremes.

Visual Output and Data

On your trading screen, you will see three distinct lines:

  1. The Upper Bound: A solid line tracking the highest highs.
  2. The Lower Bound: A solid line tracking the lowest lows.
  3. The Median: A dotted line marking the halfway point between the high and low.

Additionally, the tool provides a real-time data summary in the corner of your chart. It calculates the current Range, which is the distance between the highest and lowest points of the period expressed in pips. This gives you an immediate sense of how much the market has been fluctuating recently.

Purpose for the Trader

By visualizing these boundaries, the indicator allows you to see price action in terms of "zones." Instead of just seeing random candles, you can identify whether the price is currently pushing against a resistance level (the ceiling), approaching a support level (the floor), or trading in a neutral state near the median.

Miscellaneous
Implements a curve of type %1
9 Views
0 Downloads
0 Favorites
Diapazon
// Äèàïàçîí.mq4
// Èíäèêàòîð
 
#property copyright "mandorr@gmail.com"
#property indicator_chart_window
#property indicator_buffers 3
#property indicator_color1 SkyBlue
#property indicator_color2 SkyBlue
#property indicator_color3 SkyBlue
 
extern int period=24;        // Ïåðèîä (êîëè÷åñòâî áàðîâ äèàïàçîíà)
extern int CountBars=1000;   // Êîëè÷åñòâî îòîáðàæàåìûõ áàðîâ
 
double buffer0[];
double buffer1[];
double buffer2[];
 
void init()
   {
   SetIndexStyle(0,DRAW_LINE,STYLE_SOLID,2);
   SetIndexBuffer(0,buffer0);
   SetIndexLabel(0,"Âåðõíÿÿ ãðàíèöà");
   SetIndexDrawBegin(0,0);
 
   SetIndexStyle(1,DRAW_LINE,STYLE_SOLID,2);
   SetIndexBuffer(1,buffer1);
   SetIndexLabel(1,"Íèæíÿÿ ãðàíèöà");
   SetIndexDrawBegin(1,0);
 
   SetIndexStyle(2,DRAW_LINE,STYLE_DOT,1);
   SetIndexBuffer(2,buffer2);
   SetIndexLabel(2,"Ìåäèàíà");
   SetIndexDrawBegin(2,0);
   }
 
void deinit()
   {
   Comment("");
   }
 
void start()
   {
   for (int i=0;i<=CountBars-1;i++)
      {
      buffer0[i]=High[Highest(NULL,0,MODE_HIGH,period,i)];
      buffer1[i]=Low [Lowest (NULL,0,MODE_LOW ,period,i)];
      buffer2[i]=(buffer0[i]+buffer1[i])/2;
      }
   double range=(buffer0[0]-buffer1[0])/Point;
   Comment("Äèàïàçîí: "+DoubleToStr(range,0)+" ï.");
   }

Comments