'open file' changes

now it finds how many stocks there are instead of just assuming 10