CandRelation_v2
Download scriptThis tool is designed to provide traders with a visual breakdown of how price action is structured within each individual candle. Instead of just looking at the raw price, it analyzes the proportions of a candle to help you understand the balance between momentum and rejection.
The logic works by breaking down every candle into three distinct components:
1. Upper Shadow Analysis The script calculates the size of the "upper tail" or wick relative to the entire range of the candle. This helps identify how much price was pushed upward but ultimately rejected. A large proportion here might suggest significant selling pressure at higher levels.
2. Lower Shadow Analysis Similarly, the script measures the "lower tail" or wick. By comparing this to the total candle size, it highlights how much price dropped before being pushed back up. This is useful for spotting areas where buyers stepped in to support the price.
3. Body Proportion The script also calculates the size of the actual "body" (the space between the opening and closing prices). By measuring this against the total range, it shows how much of the candle's movement was sustained and finalized as a trend, rather than just being a temporary fluctuation.
How to interpret the data: The indicator translates these measurements into three separate lines on a sub-window chart. Each line represents one of these proportions (Upper Shadow, Body, and Lower Shadow) as a percentage of the total candle height. By observing these percentages over time, you can more easily see whether the market is characterized by strong, decisive movements (large bodies) or high volatility and indecision (long shadows).
//+------------------------------------------------------------------+
//| CandRelation_v2.mq4 |
//| Copyright © 2008, Àëåêñåé Ñåðãååâ |
//+------------------------------------------------------------------+
#property indicator_separate_window
#property indicator_buffers 3
#property indicator_color1 Green
#property indicator_color2 Blue
#property indicator_color3 Crimson
#property indicator_level1 0.3
#property indicator_level2 0.5
#property indicator_level3 0.7
#property indicator_maximum 1
#property indicator_minimum 0
//---- buffers
double Buf1[];
double Buf2[];
double Buf3[];
int init()
{
SetIndexStyle(0,DRAW_LINE); SetIndexBuffer(0,Buf1);
SetIndexStyle(1,DRAW_LINE); SetIndexBuffer(1,Buf2);
SetIndexStyle(2,DRAW_LINE); SetIndexBuffer(2,Buf3);
IndicatorDigits(Digits+2);
return(0);
}
int deinit() { return(0); }
int start()
{
int counted_bars=IndicatorCounted();
if (counted_bars<0) return(-1);
if (counted_bars>0) counted_bars--;
int lim=Bars-counted_bars+1;
double HS, LS, BD, CC;
for(int i=0; i<lim; i++)
{
CC=MathMax(High[i]-Low[i], Point);
HS=(High[i]-MathMax(Open[i], Close[i]))/CC; // äîëÿ âåðõíåé òåíè â ñâå÷å
LS=(MathMin(Open[i], Close[i])-Low[i])/CC; // äîëÿ íèæíåé òåíè â ñâå÷å
BD=(MathAbs(Open[i]-Close[i]))/CC;// äîëÿ òåëà ñâå÷è â òåíè
Buf1[i]=HS; Buf2[i]=BD; Buf3[i]=LS;
}
return(0);
}
//+------------------------------------------------------------------+
Comments