Two functions can be used to accomplish this, GFXDrawText or PlotText. The following example appears under PlotText in the AFL Functions Reference:
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( "Buy\n@" + C[ i ], i, L[ i ]-dist[i], colorGreen );
if( Sell[i] ) PlotText( "Sell\n@" + C[ i ], i, H[ i ]+dist[i], colorRed, colorYellow );
}
PlotShapes( Buy * shapeUpArrow + Sell * shapeDownArrow, IIf( Buy, colorGreen, colorRed ) );
Copy and Paste it - with slight modification it should serve your purpose.
David K.
--- In amibroker@xxxxxxxxx ps.com, Deepak Patade <iamdeepakpatade@ ...>
wrote:
>
> how can i write the value on chart for a signal generated.
> i want it at the spot where there is a arrow on the chart and not at the
> left top corner.
> So whever a buy/sell is generated it writes the value at that point
> Tried writeval, but it writes at the corner
>