The code, that I linked to in my previous reply, can be modified to
print the date instead of the purchase price, as follows. Specifically,
use DateTimeToStr function.
Plot( C, "Price", colorDarkGrey, styleLine );
Plot( MA( C, 20 ), "MA20", colorRed );
Buy = Cross( C, MA( C, 20 ) );
Sell = Cross( MA( C, 20 ), C );
dist = 1.5 * ATR( 10 );
dates = DateTime();
for ( i = 0; i < BarCount; i++ )
{
if ( Buy[i] )
{
PlotText( "Buy\n" + DateTimeToStr( dates[i] ), i, L[ i ] -
dist[i], colorGreen );
}
if ( Sell[i] )
{
PlotText( "Sell\n" + DateTimeToStr( dates[i]), i, H[ i ] +
dist[i], colorRed );
}
}
PlotShapes( Buy * shapeUpArrow + Sell * shapeDownArrow, IIf( Buy,
colorGreen, colorRed ) );
Mike
--- In [email protected], "prasantaroy36" <prasantaro...@...>
wrote:
>
>
>
> --- In [email protected], reinsley reinsley@ wrote:
> >
> >
> >
> > http://www.amibroker.org/userkb/2009/02/21/plotting-trades-on-chart/
> >
> > to give you a good start...
> >
> > BR
> >
> > Le 01/05/2010 16:22, prasantaroy36 a écrit :
> > >
> > >
> > >
> > > --- In [email protected]
<mailto:amibroker%40yahoogroups.com>,
> > > "prasantaroy36" <prasantaroy36@> wrote:
> > > >
> > > > I want to plottext buy & sell date beside buy & sell arrow. So,
what
> > > is the afl logic for this? Pl, help
> > > >
> > >
> > > pl,provide code.
> > >
> > > Thanks
> > >
> > >
> >
>
>
> Thanks Reinsley & mike. I am a layman & can't unable to convert it as
per my requirement. So,Pl, help this as copy & paste type.
>
> Thanks
>