Forums › ProRealTime English forum › ProRealTime platform support › drawtext left alignment › Reply To: drawtext left alignment
07/26/2024 at 5:03 PM
#235812
You can take advantage of these new graphical instructions (actually they were added over 1 year ago, in V11):
1 2 3 4 5 6 7 8 9 10 11 12 13 |
Xshift : defines an abscissa coordinate in pixel offset from the anchor point Yshift : defines an ordinate coordinate in vertical pixel offset from the anchor point Index : Defines an abscissa coordinate in barindex (classic way) Value : Set an ordinate coordinate in price/value (classic way) bottomright : bottom-right corner of the chart, the offset values will always be negative to shift left (X axis) and positive to shift up (Y axis). bottomleft : bottom-left corner of the graph - the offset values will always be positive in order to shift to the right (X axis) and up (Y axis). topright : top-right corner of the graph - the offset values will always be negative in order to shift to the left (X axis) and down (Y axis). topleft : top-left corner of the graph - the offset values will always be positive in order to shift to the right (X axis) and negative in order to shift down (Y axis). right : middle-right point of the graph - the shift values will always be negative to shift to the left (X axis) and can be positive or negative to shift up(+)/down(-) (Y axis) left : middle-left point of the graph - the shift values will always be positive to shift to the right (X axis) and can be positive or negative to shift up(+)/down(-) (Y axis) top : middle-top point of the graph - the shift values can be positive or negative for shift right(+)/left(-) (X axis) and will always be negative to shift down (Y axis) bottom : middle-low point of the graph - the shift values can be positive or negative for shift to the right(+)/left(-) (X-Axis) and will always be positive in order to shift up (Y-Axis) middle : middle point of the graph - the shift values can be positive or negative for shift to the right(+)/left(-) (X-Axis) and can be positive or negative for shift up(+)/down(-) (Y-Axis) |
so that your code could be written as (see attached pic):
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
defparam DRAWONLASTBARONLY = true ////Drawtext CENTERED at barindex //drawtext("asdadsfadfasdffasfasfd",BarIndex, 1 ) //drawtext("asdfa sfd asdfaf" ,BarIndex, 2) //drawtext("asd fasfd" ,BarIndex, 3) //-------------------------------------------------------------------------------------------------------------------- drawrectangle(-370,0,-235,-20) anchor(TopRight) coloured("YellowGreen") bordercolor("Black") drawtext ("asdadsfadfasdffasfasfd", -305 ,-10) anchor(TopRight) coloured("Black") // drawrectangle(-370,-20,-235,-40) anchor(TopRight) coloured("Silver") bordercolor("Black") drawtext ("asdfa sfd asdfaf", -323 ,-30) anchor(TopRight) coloured("Black") // drawrectangle(-370,-40,-235,-60) anchor(TopRight) coloured("PapayaWhip") bordercolor("Black") drawtext ("asd fasfd", -341 ,-50) anchor(TopRight) coloured("Black") //-------------------------------------------------------------------------------------------------------------------- RETURN 0, 4 |