VSA-wick0[1].3

Download script
Author: Seavo
VSA-wick0[1].3

This tool is designed to analyze price action by focusing specifically on the "wicks"—the thin lines that extend above and below the main bodies of candlesticks on a trading chart. In market analysis, these wicks often represent price rejection or volatility where the market moved significantly in one direction but failed to sustain that momentum.

Core Functionality

The primary purpose of this script is to measure the distance between the closing price of a candle and its highest and lowest points (the extreme highs and lows). By isolating these values, it helps traders visualize how much "push back" occurred during a specific timeframe.

Key Features and Logic:

  • Wick Measurement: The script calculates two distinct measurements for every candle:

    1. The distance from the closing price to the top of the wick (Upper Wick).
    2. The distance from the closing price to the bottom of the wick (Lower Wick).
  • Net Wick Analysis (Toggleable): Depending on your settings, the tool can display these measurements in two different ways:

    • Individual View: It shows the upper and lower wicks as separate data points, allowing you to see exactly how much price was rejected at both the top and bottom independently.
    • Net Wick View: It combines both measurements into a single "Net Wick" value. This tells you the total size of the wick movement relative to the closing price, providing a snapshot of total price exhaustion or volatility for that period.
  • ATR Integration (Optional): The script includes an optional feature that incorporates the Average True Range (ATR). When enabled, it overlays a dynamic line based on a multiplier of current market volatility. This allows you to compare the actual size of the wicks against the "normal" expected volatility of the market, helping to identify whether a specific price rejection is unusually large or standard for current conditions.

Visual Representation

The data is presented in a separate window below your main chart. It uses histogram bars to clearly show the magnitude of these movements, making it easy to spot periods where price action becomes erratic or where significant "hidden" pressure is being exerted against the prevailing trend.

Price Data Components
Series array that contains the highest prices of each barSeries array that contains close prices for each barSeries array that contains the lowest prices of each bar
Indicators Used
Indicator of the average true range
Miscellaneous
Implements a curve of type %1
10 Views
1 Downloads
0 Favorites
VSA-wick0[1].3
//+------------------------------------------------------------------+

//| Wick.mq4 |

//| Seavo |

//| http://www.forexfactory.com/member.php?u=17692 |

// Simple mod by DRT 5/30/2009 to show hi-lo-close wick, without open.

//+------------------------------------------------------------------+

#property copyright "Seavo"

#property link "http://www.forexfactory.com/member.php?u=17692"

#property indicator_separate_window

#property indicator_buffers 4

#property indicator_color1 GreenYellow
#property indicator_color2 Black
#property indicator_color3 Silver
#property indicator_color4 Silver

//---- external variables
extern bool ShowAtr = false;
extern int AtrPeriod = 14;
extern double  kAtr = 0.62;

extern bool ShowNetWick = true;


//---- buffers

double ExtMapBuffer1[];
double ExtMapBuffer2[];
double ExtMapBuffer3[];
double ExtMapBuffer4[];
//+------------------------------------------------------------------+

//| Custom indicator initialization function |

//+------------------------------------------------------------------+

int init()

{

//---- indicators

SetIndexStyle(0,DRAW_HISTOGRAM);
SetIndexBuffer(0,ExtMapBuffer1);

SetIndexStyle(1,DRAW_HISTOGRAM);
SetIndexBuffer(1,ExtMapBuffer2);
if (ShowAtr)
{
SetIndexStyle(2,DRAW_LINE);
SetIndexBuffer(2,ExtMapBuffer3);

SetIndexStyle(3,DRAW_LINE);
SetIndexBuffer(3,ExtMapBuffer4);
}
string short_name = "DRT VSAWick";

IndicatorShortName(short_name);

//----

return(1);

}

//+------------------------------------------------------------------+

//| Custor indicator deinitialization function |

//+------------------------------------------------------------------+

int deinit()

{

//----

//----

return(0);

}

//+------------------------------------------------------------------+

//| Custom indicator iteration function |

//+------------------------------------------------------------------+

int start()

{

int counted_bars=IndicatorCounted();

//---- check for possible errors

if (counted_bars<0) return(-1);

//---- last counted bar will be recounted

if (counted_bars>0) counted_bars--;

int pos=Bars-counted_bars;



//---- main calculation loop
double dResult1;
double dResult2;
double dResult3;
double dResult4;
while(pos>=0)

{
// if (iOpen(NULL, 0, pos) > iClose(NULL, 0, pos)){   
//    dResult1 = iHigh(NULL, 0, pos) - iOpen(NULL, 0, pos);
//   }  //downbar
// if (iOpen(NULL, 0, pos) <= iClose(NULL, 0, pos)){   
   dResult1 = iHigh(NULL, 0, pos) - iClose(NULL, 0, pos);
//    }  //upbar
// if (iOpen(NULL, 0, pos) > iClose(NULL, 0, pos)){
   dResult2 = iLow(NULL, 0, pos) - iClose(NULL, 0, pos);
//    }  //downbar
// if (iOpen(NULL, 0, pos) <= iClose(NULL, 0, pos)){
//    dResult2 = iLow(NULL, 0, pos) - iOpen(NULL, 0, pos);
//   }  //upbar
if (ShowAtr){
   dResult3 = iATR(NULL,0,AtrPeriod, pos)*kAtr ;
   dResult4 = (0 - iATR(NULL,0,AtrPeriod, pos)*kAtr );

   ExtMapBuffer3[pos]= dResult3 ;
   ExtMapBuffer4[pos]= dResult4 ;

   }

 if (ShowNetWick)
   {
      double dResultNet =  dResult1 +dResult2;
      if (dResultNet>0) {  //dResult1= dResultNet;
                           ExtMapBuffer1[pos]= dResultNet ;
                         }
      else                 ExtMapBuffer2[pos]= dResultNet ;
   }
  else
   {
   ExtMapBuffer1[pos]= dResult1 ;
   ExtMapBuffer2[pos]= dResult2 ;
   }
   

pos--;

}

//----

return(0);

}

//+------------------------------------------------------------------+

Comments