GM all,
I was trying to find Symbols having data say less than 100 candles i.e newly listed stocks.
How can I do the same.
Any help would be greatly appreciated.
GM all,
I was trying to find Symbols having data say less than 100 candles i.e newly listed stocks.
How can I do the same.
Any help would be greatly appreciated.
Addcolumn(qty=Cum(1),"Candles");
Filter = qty < 100;
Qty=Cum(1) gave nil results. I tried Cum(C), it gave a total of closing prices.
Addcolumn(qty=Cum(C),"Candles");
Qty2=Qty/C;
Filter = qty2 < 100 ;
This filters approx candles less then 100. Though not the right way, it solved the purpose.
Thanks.
Try this...........................
@maheshrekhani, try this for more detailed exploration results:
// https://forum.amibroker.com/t/finding-new-symbols/39637
// Update your database
// Unselect "Pad & Align" in the analysis dialog - select Daily periodicity
dt = DateTime();
bc = BarCount;
firstBarDT = dt[0];
lastBarDT = dt[bc - 1];
lastBarinRange = Status( "lastbarinrange" ) ;
Filter = bc <= 100 AND lastbarinRange;
// ALTERNATIVELY - comment out the above line
// edit the following line with the date of the last bar in range of your exploration that should be equal to the last update in the database
// set the "to date" field accordingly; write the date formatted as per your Windows OS date settings)
// this ensure to exclude also any "old" delisted stocks with less that 100 bars (order by "Last date" column to verify)
// and then uncomment the following 2 lines:
// lastDate = StrToDateTime("2025-01-08");
// Filter = bc <= 100 AND lastbarinRange AND lastDate == lastBarDT;
AddTextColumn( FullName(), "Company", 1, colorDefault, colorDefault, 300 );
AddColumn( bc, "Barcount", 1 );
AddColumn( firstBarDT, "First date", formatDateTimeISO );
AddColumn( lastBarDT, "Last date", formatDateTimeISO );
// Order by more recent stocks on top
if( Status( "actionEx" ) == actionExplore )
SetSortColumns( 4, 3 );
For example, here is the oartial oputput checking all the Norgate US stocks:
Thanks Beppe, It works perfectly.