public void QuarterlyPriceUpdate() { StockReader ares = GameObject.Find("StockList").GetComponent <StockReader>(); for (int i = 0; i < 11; i++) { System.Random randomNumber = new System.Random(); double percentage = randomNumber.NextDouble() * .6 + .7; //news.QuarterlyReports(name); lists.getReader(i).SetPrice(lists.getReader(i).GetPrice() * (double)((ares.getPercentage() / 35) * percentage)); } }
// Update is called once per frame void Update() { tick++; if (tick >= 360) { for (int i = 0; i < 11; i++) { int buy = buying(lists.getReader(i).getWeight(), lists.getReader(i).GetPrice(), lists.getReader(i).dayBeforePrice(), lists.getReader(i).thirtyDayAverage(), lists.getReader(i).weekHigh(), lists.getReader(i).weekLow()); int sell = selling(lists.getReader(i).getWeight(), lists.getReader(i).GetPrice(), lists.getReader(i).dayBeforePrice(), lists.getReader(i).thirtyDayAverage(), lists.getReader(i).weekHigh(), lists.getReader(i).weekLow()); double priceChange = 5 * Math.Pow(Math.Sqrt(buy - sell), 3); lists.getReader(i).SetPrice((double)priceChange); } tick = 0; } //if (tick }