I use AFL formula (from this forum!) that updates the Watchlist from file (csv):
_SECTION_BEGIN("Import_pliku");
listnumTI = 2; //Watchlist
file_path = "C:\\TradeIdeasPro\\ami.csv";
// erase the watchlist when we process very first symbol
if ( Status( "stocknum" ) == 0 )
{
// retrieve watchlist members
oldlist = CategoryGetSymbols( categoryWatchlist, listnumTI );
// iterate through the list and remove tickers
for ( i = 0; ( sym = StrExtract( oldlist, i ) ) != ""; i++ )
{
CategoryRemoveSymbol( sym, categoryWatchlist, listnumTI );
}
}
fh = fopen( file_path, "r");
if( fh )
{
linecounter=0;
while( ! feof( fh ) )
{
line=fgets(fh); /
if(linecounter>0)
{
importsymbol=StrExtract(line,0);
symbol=StrReplace(importsymbol,"\"",""); //delete "" from tickere made by TradeIdeas
CategoryAddSymbol(symbol, categoryWatchlist, listnumTI );
}
else
{
}
linecounter++;
}
}
else
{
printf("ERROR: file can not be found (does not exist)");
}
fclose(fh);
_SECTION_END();
It works perfect on one computer and updates the Watchlist, however it doesn't work on the other computer - when I run exploration, it doesn't update (add) tickers to watchlist. No errors apear. File path is correct. I use the same csf file exported from TradeIdeas.
Are there any settings that can lead to this problem? Amibroker runs on Windows10, 64bit, run as administrator.
Thanks in advance for suggestions.