variables:
percentage(0),
high_low_range_current(0),
volume_to_previous(0),
high_low_range_to_previous(0),
text_percentage(-1),
text_percentage_prev(-1),
text_HL_range_current(-1),
text_HL_range_to_prev(-1),
text_volume_to_prev(-1),
str_val("");
if ( h <> l ) then
percentage = (c-l)/(h-l)
else
percentage = 0;
high_low_range_current = h - l;
if ( currentbar > 1 ) then
if ( (h[1]-l[1]) > 0 ) then
high_low_range_to_previous = (h-l)/(h[1]-l[1])
else
high_low_range_to_previous = 0;
if ( currentbar > 1 ) then
if ( volume[1] <> 0 ) then
volume_to_previous = volume/volume[1]
else
volume_to_previous = 0;
value3 = getappinfo(aihighestdispvalue);
value4 = getappinfo(ailowestdispvalue);
str_val = "close of bar - % of HL range = " + NumToStr(percentage, 2) + "%";
TextMoveTo(text_percentage, d, time_s, value3 - (value3-value4)/4, str_val, 0, 0);
str_val = "close of previous bar - % of HL range = " + NumToStr(percentage[1], 2) + "%";
TextMoveTo(text_percentage_prev, d, time_s, value3 - (value3-value4)/4, str_val, 0, 1);
str_val = "HL range current bar = " + NumToStr(high_low_range_current, 2) + "pts";
TextMoveTo(text_HL_range_current, d, time_s, (value3+value4)/2, str_val, 0, 1);
str_val = "HL range to previous bar = " + NumToStr(high_low_range_to_previous, 2) + "%";
TextMoveTo(text_HL_range_to_prev, d, time_s, (value3+value4)/2, str_val, 0, 0);
str_val = "Volume to previous bar = " + NumToStr(volume_to_previous, 2) + "%";
TextMoveTo(text_volume_to_prev, d, time_s, value4 + (value3-value4)/4, str_val, 0, 1);