You can experiment by adding the following two lines to the end of the script:
Filter = Buy OR Sell; AddTextColumn(WriteIf(Buy, "Buy", "Sell"), "Action"); Using an exploration with that will show only the stocks that have a buy or a sell signal for the bar of the exploration. If you want to see all stocks (i.e. even those that have no signal for the bar), then change the lines to: Filter = 1; AddTextColumn(WriteIf(Buy, "Buy", WriteIf(Sell, "Sell", "No Signal")), "Action"); Documentation for all the methods used above can be found here: http://www.amibroker.com/guide/afl/afl_index.php?m=1 Mike --- In [email protected], "Vinay Gakkhar." <[EMAIL PROTECTED]> wrote: > > Dear Mike, > > Can you please also write the AddColumn so that if one runs the > exploration in automatic analysis, one gets either uparrow or downarrow or > noarrow? > > Thanks, > > vgakkhar > > On Sun, 31 Aug 2008 09:36:20 +0530, Mike <[EMAIL PROTECTED]> wrote: > > > Hi, > > > > No need for using BarIndex or LastValue. As Bill suggested earlier, > > just set the Buy/Sell and use PlotShapes to draw all the arrows at > > the Buy/Sell signal. Cross is the correct function to use for your > > signals. > > > > periods = Param("Periods", 21, 2, 200, 1 ); > > ROCpds = ROC( C, periods ); > > ROCadj = periods * EMA( ROC( C, 1 ), periods ); > > > > Buy = Cross( ROCadj, ROCpds ); > > Sell = Cross( ROCpds, ROCadj ); > > > > Plot( ROCadj, "ROCadj "+periods, colorRed, styleThick ); > > Plot( ROCpds, "ROC "+periods, colorBrightGreen ); > > > > PlotShapes( IIF( Buy, shapeUpArrow, shapeNone ), colorBrightGreen ); > > PlotShapes( IIF( Sell, shapeDownArrow, shapeNone ), colorRed ); > > > > Mike > > > > --- In [email protected], "aboaziz_sa" <aboaziz_sa@> wrote: > >> > >> this will do! > >> > >> > >> > >> crossup= Cross( ROCadj , ROC( C, periods )) ; > >> crossdown= Cross( ROC( C, periods ), ROCadj ) ; > >> x = LastValue(ValueWhen(crossup, BarIndex(), 1)); > >> PlotShapes(IIf(BarIndex() == x, shapeUpArrow, Null), > > colorBrightGreen); > >> y = LastValue(ValueWhen(crossdown, BarIndex(), 1)); > >> PlotShapes(IIf(BarIndex() == y, shapeDownArrow, Null), colorRed); > >> > > > > >
