New Listings AFL

Dear Forum,

While this may seem to be pretty straightforward am a bit stuck with the Filter part
Here is the code that I am using

_SECTION_BEGIN("New listings Shortlists");

periodnew = Param("Period New",50,1,1560);

startdate = ParamDate( "Start date", Now(0));
enddate = ParamDate( "End date", Now(0));
dn = datenum();
wd = DayOfWeek();
wdnum =LastValue(wd);
tuetosat = 0<wd>=6;
mon = wd==1;


datewindow = dn >= startdate-3 AND dn <= enddate;

bi = BarIndex();


Filter = bi<2 AND datewindow;

AddColumn (C,"C",1.2);

The afl filters out the stocks that are newly listed. bi<2 measn that the listing is over last 2 trading sessions. The datewindow filter is there to see that the trade has gone through recently as there maybe condiditions where bi<2 but being sparsley traded, it throws up the tickers of the past. in there lies another filter that I wish to bring in

I am attaching the screenshot of exploration output

As you can see many tickers have a dash '-' as part of the construction. Exchanges allow trading in non-equity instruments like Bonds of various maturities as displayed by various series as suffix to the ticker. Basically what I wish to have is a filter that moves out all the tickers that have '-' dash in them.

Use StrFind function AFL Function Reference - STRFIND

Filter = bi<2 AND datewindow AND StrFind(Name(), "-" )==0;
2 Likes

Worked out as expected. Many thanks...