private void button2_Click(object sender, EventArgs e) { string path = @"i:\dzh2\data\"; DZHSymbol sy = new DZHSymbol("SH", "600759"); DZHQuoteReader dr = new DZHQuoteReader(path); DZHQuote aQuote = dr.RequestQuote(sy); DZHTickReader dr1 = new DZHTickReader(path); List <DZHTick> ticks = dr1.RequestTicks(sy); DZHTick tick = new DZHTick(); tick.Price = aQuote.LastClose; ticks.Insert(0, tick); Single totalBuyAmount = 0, totalSellAmount = 0; for (int i = 1; i < ticks.Count(); i++) { if (ticks[i].Price > ticks[i - 1].Price) { totalBuyAmount += ticks[i].Amount - ticks[i - 1].Amount; } if (ticks[i].Price < ticks[i - 1].Price) { totalSellAmount += ticks[i].Amount - ticks[i - 1].Amount; } } this.textBox1.Text = totalBuyAmount.ToString(); this.textBox2.Text = totalSellAmount.ToString(); }