Size of Candle ( Close , Open )

How to display the size of Candle i.e. difference between Close & Open above or below the candle in chart ?

@SHANTVCI one way to do it is using the PlotText() function:

bi = Barindex();
fvb = FirstVisiblevalue( bi );
lvb = LastVisiblevalue( bi );

fontSize = 7;
offset = 20;
Plot( C, "Close", colorDefault, styleCandle );
// this will draw the numbers on each bar and therefore the text labels overlap easily
PlotTextSetFont( "", "Tahoma", fontSize, BarCount - 1, 0, -1 );
// plot text only for the visible bars
for( i = fvb; i <= lvb; i++ )
{
    diff = C[i] - O[i];

    if( diff > 0 )
        PlotText( StrFormat( "%2.2f", diff ), i, H[i], colorGreen, colorDefault, offset );
    else
        PlotText( StrFormat( "%2.2f", diff ), i, L[i], colorRed, colorDefault, -offset );
}
10 Likes

Thanks a lot. It solves my problem. You are great.

1 Like