DynamicRSqChannel
Download scriptThe DynamicRS+Channel is a technical analysis tool designed to visually identify significant price structural shifts and establish a dynamic "buffer zone" or channel around the prevailing market trend. Instead of relying on standard moving averages which smooth out data, this script focuses on capturing precise pivots in price action.
How the Logic Works
The core mechanism of this indicator is based on identifying extreme price points—specifically new highs and new lows—while filtering out minor "noise" or insignificant fluctuations. Here is the step-by-step breakdown of how it processes market data:
- Trend Identification: The script constantly monitors the relationship between the current price and the previous price bar. It looks for moments where the market breaks out significantly in one direction.
- The Filter Mechanism: To prevent the indicator from reacting to every tiny wiggle in the market, it uses a user-defined "Filter" setting. This acts as a sensitivity threshold. A price movement is only recognized as a new structural point if it exceeds this specific distance.
- Dynamic Level Tracking:
- If the price moves significantly lower than the previous high (beyond the filter), the indicator updates its primary reference line to that new low.
- If the price moves significantly higher than the previous low (beyond the filter), it updates its primary reference line to that new high.
- If the price stays within the "neutral zone" defined by the filter, the indicator maintains its current level, effectively ignoring the minor movement.
- Channel Creation: Once the primary reference line is established based on the logic above, the script automatically projects two outer boundaries. These boundaries are created by adding and subtracting the filter distance from the primary line.
Visual Representation
The result on your chart is a three-line system:
- The Core Line: Represents the most recent significant price pivot.
- The Upper Boundary: Created by adding the filter value to the core line.
- The Lower Boundary: Created by subtracting the filter value from the core line.
Summary for Traders
Essentially, this tool creates a " коридор" (corridor) that follows the market's momentum. It helps traders visualize the current range of price action and identifies when the market has made a meaningful move to a new structural level, providing a clearer picture of trend boundaries than a standard static line.
//+------------------------------------------------------------------+
//| DynamicRS+Channel.mq4 |
//| Copyright © 2007, Nick A. Zhilin |
//| rebus58@mail.ru |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2007, Nick A. Zhilin"
#property link "rebus58@mail.ru"
extern int Filter=15;
#property indicator_chart_window
#property indicator_buffers 3
#property indicator_color1 Yellow
#property indicator_color2 Red
#property indicator_color3 Aqua
//---- buffers
double ExtMapBuffer1[];
double ExtMapBuffer2[];
double ExtMapBuffer3[];
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{
IndicatorShortName("DynamicRS+Channel");
//---- indicators
SetIndexStyle(0,DRAW_LINE);
SetIndexBuffer(0,ExtMapBuffer1);
SetIndexStyle(1,DRAW_LINE);
SetIndexBuffer(1,ExtMapBuffer2);
SetIndexStyle(2,DRAW_LINE);
SetIndexBuffer(2,ExtMapBuffer3);
//----
return(0);
}
//+------------------------------------------------------------------+
//| DynamicRS+Channel |
//+------------------------------------------------------------------+
int start()
{
//----
int counted_bars=IndicatorCounted();
if(counted_bars<0) return(-1);
if(counted_bars>0) counted_bars--;
int i=Bars-counted_bars;
if(counted_bars==0) i-=1+1;
while(i>=0)
{
if(High[i]<High[i+1] && High[i]<ExtMapBuffer1[i+1]-Filter*Point)
ExtMapBuffer1[i]=High[i];
else if(Low[i]>Low[i+1] && Low[i]>ExtMapBuffer1[i+1]+Filter*Point)
ExtMapBuffer1[i]=Low[i];
else
ExtMapBuffer1[i]=ExtMapBuffer1[i+1];
ExtMapBuffer2[i]=ExtMapBuffer1[i]+Filter*Point;
ExtMapBuffer3[i]=ExtMapBuffer1[i]-Filter*Point;
i--;
}
//----
return(0);
}
//+------------------------------------------------------------------+
Comments