For High, Low, Close lines, line labels (drawTextRelative) intended to be displayed in the chart margin (bar +2) relative to the line and current bar are instead remaining at a fixed x-axis point (as if drawTextAbsolute was used).
For example: For a line drawn at the value of the prior day's high.
var vHigh = getValueAbsolute("High", vIndex, vSymbol);
The label is coded as:
drawTextRelative(2, vHigh, " H ", Color.black, Color.lime, Text.BOLD | Text.FRAME | Text.BOTTOM | Text.ONTOP, null, 10, "High");
Instead of what I want, this places the text box at bar 2 after the period the vHigh value is first obtained (beginning of the day), and that's it. It's in the wrong location, and it never moves. What I want to do is have the text box always display in the chart margin on bar 2 to the right of the associated line, always relative to the current bar. I also can't find a text flag that will cause the text box to display on the line centerline; it only displays TOP or BOTTOM.
Any suggestions? Thanks in advance.
For example: For a line drawn at the value of the prior day's high.
var vHigh = getValueAbsolute("High", vIndex, vSymbol);
The label is coded as:
drawTextRelative(2, vHigh, " H ", Color.black, Color.lime, Text.BOLD | Text.FRAME | Text.BOTTOM | Text.ONTOP, null, 10, "High");
Instead of what I want, this places the text box at bar 2 after the period the vHigh value is first obtained (beginning of the day), and that's it. It's in the wrong location, and it never moves. What I want to do is have the text box always display in the chart margin on bar 2 to the right of the associated line, always relative to the current bar. I also can't find a text flag that will cause the text box to display on the line centerline; it only displays TOP or BOTTOM.
Any suggestions? Thanks in advance.
Comment