label

forge.drawfunctionSince Forge API 1
Signaturepython
forge.draw.label(bar: int | Point,price: float | None = None,text: str = '',*,style: Mapping[str, Any] | None = None,where: str | None = None,color: Color | str | None = None,text_color: Color | str | None = None,size: str | None = None,bold: bool | None = None,italic: bool | None = None,align: str | None = None,font: str | None = None,id: str | None = None) -> Drawing

Write text on the chart at a price (where="at_price") or on a bar.

Parameters

NameTypeDefault
barint | Point
pricefloat | NoneNone
textstr''
styleMapping[str, Any] | NoneNone
wherestr | NoneNone
colorColor | str | NoneNone
text_colorColor | str | NoneNone
sizestr | NoneNone
boldbool | NoneNone
italicbool | NoneNone
alignstr | NoneNone
fontstr | NoneNone
idstr | NoneNone

above_bar and below_bar labels sit on the bar and take no price. Defaults: where "at_price", color theme.accent, text_color theme.text, size "normal", bold and italic off, align "center", font "default". style takes the same names as a mapping; a name is given once, in style or as a keyword. Give id to draw the same label again: a live id replaces the earlier drawing.