public void loadIndex(File f[])
	{
		index = new Vector<Price>();
		Parameter param = Parameter.getInstance();
		
		String datefmt = param.getParam("index date format");
		if (datefmt == null)
		{
			System.err.println("ERROR: Please specify date format");
			System.exit(1);
		}	
		String separator = param.getParam("index separator");
		if (separator == null)
		{
			System.err.println("ERROR: Please specify data separator");
			System.exit(1);
		}
		if (separator.compareToIgnoreCase("space") == 0)
			separator = " ";
		String pripos = param.getParam("index price position");
		if (pripos == null)
		{
			System.err.println("ERROR: Please specify price position");
			System.exit(1);
		}
		String volpos = param.getParam("index volume position");
		if (volpos == null)
		{
			System.err.println("ERROR: Please specify volume position");
			System.exit(1);
		}
		
		
		
		BufferedReader reader;	
		String line = null;	

       try
       {
    	   reader =
    		   new BufferedReader(new FileReader(f[0]));

    	   // skipping first line
    	   line = reader.readLine();
    	   
    	   while ((line = reader.readLine()) != null)
       		{
    		   String[] input = line.split(separator);
    		   
    		   
    		   SimpleDateFormat dateparser = new SimpleDateFormat(datefmt, new Locale("en"));
    		   Date d = dateparser.parse(input[0]);

    		   index.add(new Price(d, 
    				   Double.valueOf(input[Integer.valueOf(pripos)]),
    				   Double.valueOf(input[Integer.valueOf(volpos)])));
       		}
    	   
    	   Collections.sort(index);

    	   //DEBUG -- prints read data
    	   //for (int i = 0; i < index.size(); i++)
    	   //{
    	   //   	System.out.println(index.get(i).p);
    	   //}
    	   
    	   
       } catch (Exception e)
       {
    	   System.err.print("Error opening file: " + f[0].getAbsolutePath() + "\n");
    	   System.err.print("Message: " + e.getMessage() + "\n\n");
     	   System.exit(1);
       }
       	       	
	}