Author: IZZY
VTS_VG_G1

This tool is a technical analysis indicator designed to provide traders with a visual representation of market volatility and price boundaries. It functions by calculating specific "thresholds" around the current market price, helping users identify potential zones of support and resistance based on historical movement.

Core Logic Overview

The script operates by analyzing two primary components of market data: current price action and volatility. Here is a breakdown of how it processes this information:

1. Volatility Measurement The tool utilizes an Average True Range (ATR) calculation. In simple terms, the ATR measures how much the market typically moves up or down over a set number of candles. By combining this with a multiplier, the script establishes a "buffer zone" around the price. This ensures that the indicator reacts to the actual intensity of the market rather than just moving with every small fluctuation.

2. Dynamic Boundary Creation The logic creates two initial boundaries for every point on the chart:

  • Lower Bound: A calculation that subtracts the volatility buffer from the current closing price.
  • Upper Bound: A calculation that adds the volatility buffer to the current closing price.

3. Progressive Filtering (Smoothing) Instead of simply plotting these raw boundaries—which can often appear jagged and difficult to read—the script applies a progressive filtering process. It compares each new boundary point against its predecessor to find the highest "peak" and the lowest "valley."

This comparison happens across seven different layers. As the data moves through these layers, it effectively "smooths out" the noise of the market. The result is a series of nested lines that highlight significant price extremes while filtering out minor, insignificant price movements.

Visual Output

The final result on your chart is a set of multi-layered lines. These lines represent refined price levels where volatility and price history intersect. Traders can use these visuals to identify structural trends, potential reversal areas, or zones where the market is showing significant strength or weakness based on its historical volatility.

Indicators Used
Indicator of the average true range
13 Views
0 Downloads
0 Favorites
VTS_VG_G1
//+------------------------------------------------------------------+
//|                                                          VTS.mq4 |
//|                                                             IZZY |
//|                                                                  |
//+------------------------------------------------------------------+
#property copyright "IZZY"
#property link      ""

#define MAXBARSCOUNT 15000

#property indicator_chart_window
#property indicator_buffers 8
#property indicator_color1 Aqua
#property indicator_color2 Magenta
#property indicator_color3 Aqua
#property indicator_color4 Magenta
#property indicator_color5 Aqua
#property indicator_color6 Magenta
#property indicator_color7 Aqua
#property indicator_color8 Magenta
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
//extern int Sb = 300;
extern int    PeriodAtr = 10;
extern double kATR      = 2.0;

double VTS[MAXBARSCOUNT];
double VTS1[MAXBARSCOUNT];
double VTS2[MAXBARSCOUNT];
double VTS3[MAXBARSCOUNT];
double VTS4[MAXBARSCOUNT];
double VTS5[MAXBARSCOUNT];
double VTS6[MAXBARSCOUNT];
double VTS7[MAXBARSCOUNT];

int init()
  {
//---- indicators
   IndicatorBuffers(8);
   SetIndexBuffer(0, VTS);
   SetIndexBuffer(1, VTS1);
   SetIndexBuffer(2, VTS2);
   SetIndexBuffer(3, VTS3);
   SetIndexBuffer(4, VTS4);
   SetIndexBuffer(5, VTS5);
   SetIndexBuffer(6, VTS6);
   SetIndexBuffer(7, VTS7);

//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custor indicator deinitialization function                       |
//+------------------------------------------------------------------+
int deinit()
  {
//---- 
   
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+

int start()
  {
   int    counted_bars=IndicatorCounted();
//---- 
   
int    StartBars = Bars - counted_bars+2;
   //if (StartBars<Sb) StartBars = Sb;
   for(int i = StartBars; i>=0; i--){
       VTS[i] = (Close[i]-kATR*iATR(NULL,0,PeriodAtr,i));
       VTS1[i]= (Close[i]+kATR*iATR(NULL,0,PeriodAtr,i));
       }
   for(i = StartBars-1; i>0; i--){
       VTS2[i]= MathMax(VTS[i],VTS[i+1]);
       VTS3[i]= MathMin(VTS1[i],VTS1[i+1]);
       VTS4[i]= MathMax(VTS2[i],VTS2[i+1]);//VTS2[i+1];
       VTS5[i]= MathMin(VTS3[i],VTS3[i+1]);//VTS3[i+1];
       VTS6[i]= MathMax(VTS4[i],VTS4[i+1]);//VTS4[i+1];
       VTS7[i]= MathMin(VTS5[i],VTS5[i+1]);//VTS5[i+1];

       }
   
//----
   return(0);
  }
//+------------------------------------------------------------------+

Comments