Examples of StockData


Examples of de.vogella.birt.stocks.model.StockData

      day.set(Calendar.SECOND, 0);
      day.set(Calendar.MILLISECOND, 0);
      day.set(Calendar.YEAR, 2009);
      day.set(Calendar.MONTH, 0);
      day.set(Calendar.DAY_OF_MONTH, i);
      StockData data = new StockData();
      data.setOpen(begin);
      double close = Math.round(begin + Math.random() * begin * 0.1);
      data.setClose(close);
      data.setLow(Math.round(Math.min(begin, begin - Math.random() * begin * 0.1)));
      data.setHigh(Math.round(Math.max(begin, close) + Math.random() * 2));
      data.setVolume(1000 + (int) (Math.random() * 500));
      begin = close;
      data.setDate(day.getTime());
      history.add(data);
    }
    return history;
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.