Dear Friends,
Below is the code mentioned by Tomasz on programtically adding exploration results to list.
http://www.amibroker.com/kb/2014/11/13/how-to-add-exploration-results-to-a-watchlist/
listnum = 10; // we use watchlist 10 for storing results
// erase the watchlist when we process very first symbol
if ( Status( "stocknum" ) == 0 )
{
// retrieve watchlist members
oldlist = CategoryGetSymbols( categoryWatchlist, listnum );
// iterate through the list and remove tickers
for ( i = 0; ( sym = StrExtract( oldlist, i ) ) != ""; i++ )
{
CategoryRemoveSymbol( sym, categoryWatchlist, listnum );
}
}
// sample exploration code
Filter = ROC( Close, 1 ) > 3 AND Volume > 1000000;
AddColumn( Close, "Close" );
AddColumn( ROC( Close, 1 ), "ROC" );
AddColumn( Volume, "Volume" );
// check how many times Filter variable was true in the tested range
// if non-zero value detected, add current symbol to a watchlist
if ( LastValue( Cum( Filter AND Status( "barinrange" ) ) ) )
CategoryAddSymbol( "", categoryWatchlist, listnum );
The strange part is for any intraday timeframe, for that matter 15 mins with "1 recent days" setting, the exploration results is NOT getting added to a List. But for the "1 recent Bars" or "From-toDates", it works and puts the result tickers in list.
Please note that the output in all the cases in exploration is correct. i.e the results set is not blank and its correct as per Range setting..
Can anyone suggest why its not working. I need to run the exploration with "1 recent days" but the list is not getting populated..So I tested the code that Tomasz mentioned and found the same issue with "1 recent days"
I have checked the forum but there was no such issue/help/resolution with this setting. Can someone please suggest possible solution or educate me on possible error at my end.