//symbollist.mq4 = example on how to retrieve symbols list from symbols.sel file
#property copyright "Copyright © 2010, sangmane"
#property link      "sangmane@forexfactory.com"

int start()
{
	int fh = FileOpenHistory("symbols.sel",FILE_BIN|FILE_READ);
	if(fh>0) {
		int symbolCount = (FileSize(fh)-4) / 0x80;
		string temp, symbolList[];		
		ArrayResize(symbolList,symbolCount);
		int i=0;
		FileSeek(fh,4,SEEK_SET);
		while(!IsStopped()) {
			temp = FileReadString(fh,12);
			if(FileIsEnding(fh)) break;
			symbolList[i] = StringSubstr(temp,0,StringFind(temp,"\x00",0));
			i++;
			FileSeek(fh,0x80-12,SEEK_CUR);
		}
		FileClose(fh);
		string s;
		for(i=0; i<symbolCount; i++)
			s = s+(i+1)+". "+symbolList[i]+"\n";
		Comment(s);
	}
	return(0);
}
//+------------------------------------------------------------------+