PlotText
- write text on the chart

Indicators
(AmiBroker 4.80)


SYNTAX PlotText( ''text'', x, y, color, bkcolor = colorDefault, yoffset = 0 )
RETURNS NOTHING
FUNCTION This function writes text in specified co-ordinates.

where:

  • x - is x-coordinate in bars (like in LineArray)
  • y - is y-coordinate in dollars
  • color is text color
  • bkcolor is background color
  • yoffset (new in 5.80) is a Y-axis offset in pixels

If bkcolor is NOT specified (or equal to colorDefault) text is written with TRANSPARENT background, any other value causes solid background with specified background color.

EXAMPLE Plot(C,"Price", colorBlack, styleLine );
Plot(MA(C,20),"MA20", colorRed );

Buy=Cross( C, MA(C,20 ) );
Sell= Cross( MA( C, 20 ), C );

dist =
1.5*ATR(10);

for( i = 0; i < BarCount; i++ )
{
if( Buy[i] ) PlotText( "Buyn@" + C[ i ], i, L[ i ]-dist[i], colorGreen );
if( Sell[i] ) PlotText( "Selln@" + C[ i ], i, H[ i ]+dist[i], colorRed, colorYellow );
}

PlotShapes( Buy * shapeUpArrow + Sell * shapeDownArrow, IIf( Buy, colorGreen, colorRed ) );
SEE ALSO PLOT() function , PlotTextSetFont() function

References:

The PlotText function is used in the following formulas in AFL on-line library:

More information:

See updated/extended version on-line.