You do not need to do such complication because PlotText and PlotTextSetFont function do have an y-offset argument. And the distance keeps the same no matter which price value and symbol.
Plot( C, "Price", colorDefault, styleCandle );
yoff = 20; // y-offset for PlotText
fntsize = 9;// fontsize of text of PlotText
bi = Barindex();
fvb = FirstVisibleValue( bi );
lvb = LastVisibleValue( bi );
for( i = fvb; i <= lvb; i++ ) {
PlotText( "" + 1, i, L[i], colorRed, -1, -yoff );
PlotText( "" + 2 , i, L[i], colorRed, -1, -2*yoff );
PlotText( "" + 3 , i, L[i], colorRed, -1, -3*yoff );
PlotText( "" + 1, i, H[i], colorGreen, -1, yoff-fntsize );
PlotText( "" + 2 , i, H[i], colorGreen, -1, 2*yoff-fntsize );
PlotText( "" + 3 , i, h[i], colorGreen, -1, 3*yoff-fntsize );
}