wick0.2
Download scriptThis tool is designed to provide traders with a visual representation of price "wicks"—the thin lines on a candlestick that indicate how far the price pushed in a specific direction before retreating. By isolating these movements, the script helps identify the reach of market sentiment and volatility independently of the candle's main body.
Core Functionality
The script analyzes every candle on your chart to measure two primary types of movement:
- Upper Wick Measurement: The tool calculates the distance between the highest point reached during a period and the top of the candle's body. This helps visualize how much "buying pressure" or upward reaching occurred before the price pulled back.
- Lower Wick Measurement: Simultaneously, it measures the distance between the lowest point reached and the bottom of the candle's body. This highlights "selling pressure" or downward dipping that failed to sustain a breakout.
Visual Representation
The data is displayed in a separate window below your main price chart using two distinct visual formats:
- Histograms: These represent the primary measurements of the upper and lower wicks. They allow you to see at a glance the relative size of the "rejections" occurring in real-time.
- Trend Lines: Depending on your settings, the tool can also provide additional data points that help contextualize these movements against general market volatility.
Optional Volatility Tracking
The script includes an optional feature that allows you to overlay Average True Range (ATR) data. When enabled, this provides a secondary layer of information, showing the overall average movement of the market over a specific number of periods. This allows you to compare the size of a specific "wick" against the normal volatility of the market, helping you determine if a price movement is unusual or standard for current conditions.
How it Helps Traders
By focusing specifically on wicks, this tool filters out the "noise" of the candle bodies and highlights areas of price rejection. It is particularly useful for identifying:
- Exhaustion Points: Where the price tried to push significantly in one direction but was quickly pushed back.
- Support and Resistance: Identifying price levels where wicks consistently form, suggesting a barrier that the market is struggling to break through.
- Market Momentum: Comparing the relative size of upper vs. lower wicks to gauge which side of the market (bulls or bears) is currently more aggressive.
//+------------------------------------------------------------------+
//| Wick.mq4 |
//| Seavo |
//| http://www.forexfactory.com/member.php?u=17692 |
//+------------------------------------------------------------------+
#property copyright "Seavo"
#property link "http://www.forexfactory.com/member.php?u=17692"
#property indicator_separate_window
#property indicator_buffers 4
#property indicator_color1 Red
#property indicator_color2 Blue
#property indicator_color3 White
#property indicator_color4 White
//---- external variables
extern bool ShowAtr = false;
extern int AtrPeriod = 14;
//---- 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);
SetIndexStyle(2,DRAW_LINE);
SetIndexBuffer(2,ExtMapBuffer3);
SetIndexStyle(3,DRAW_LINE);
SetIndexBuffer(3,ExtMapBuffer4);
string short_name = "Wick";
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);
}
if (iOpen(NULL, 0, pos) <= iClose(NULL, 0, pos)){
dResult1 = iHigh(NULL, 0, pos) - iClose(NULL, 0, pos);
}
if (iOpen(NULL, 0, pos) > iClose(NULL, 0, pos)){
dResult2 = iLow(NULL, 0, pos) - iClose(NULL, 0, pos);
}
if (iOpen(NULL, 0, pos) <= iClose(NULL, 0, pos)){
dResult2 = iLow(NULL, 0, pos) - iOpen(NULL, 0, pos);
}
if (ShowAtr){
dResult3 = iATR(NULL,0,AtrPeriod, pos);
dResult4 = (0 - iATR(NULL,0,AtrPeriod, pos));
}
ExtMapBuffer1[pos]= dResult1 ;
ExtMapBuffer2[pos]= dResult2 ;
ExtMapBuffer3[pos]= dResult3 ;
ExtMapBuffer4[pos]= dResult4 ;
pos--;
}
//----
return(0);
}
//+------------------------------------------------------------------+
Comments