If you have any suggestions on how to make it better, I'd love to hear them.
*edit : added "delete" command. That'll teach me to post before testing.
**edit : plot "low" instead of "high" two times. Off to find more coffee.
Code: Select all
{
Put a label for the high and low of the previous candle
}
Inputs:
showLabels(1),
showRecentHigh(1),
showRecentLow(1);
Variables:
Offset(.03);
if (LastBarOnChart = True) and (showLabels = 1) then
begin
if (showRecentHigh = 1) then
begin
Text_Delete(1);
Value1=Text_new(Date,Time,(High[1] + Offset),numToStr(high[1], 2));
Text_SetColor(1,color_black);
Text_SetBGColor(1,color_green);
Text_SetSize(1, 10);
end;
if (showRecentLow = 1) then
begin
Text_Delete(2);
Value2=Text_new(Date,Time,(Low[1] - Offset),numToStr(low[1], 2));
Text_SetColor(2,color_black);
Text_SetBGColor(2,color_red);
Text_SetSize(2, 10);
end;
end;