public static string[] HoldingListToPersonalAccount(Clinched stock)
        {
            string[] hadStock = new string[6];

            hadStock[0] = stock.Number;
            hadStock[1] = stock.Name;
            hadStock[2] = ((stock.TotalCost / stock.TotalUnit) / 1000).ToString();
            hadStock[3] = stock.TotalUnit.ToString();
            hadStock[4] = stock.AverageCost.ToString();
            foreach (QuoteStock quoteStock in QuoteStock.quoteStockList)
            {
                if (stock.Number == quoteStock.Number)
                {
                    hadStock[5] = (quoteStock.Close * 1000 * stock.TotalUnit - stock.TotalCost).ToString();
                }
            }

            return(hadStock);
        }
        public static void AddToHoldingList(Clinched buyingStock)
        {
            StatusOfAccount Had = StatusOfAccount.HADNT;

            foreach (Clinched haveStock in StockAccount.SynchronizeAccount.holdingList)
            {
                if (haveStock.Number == buyingStock.Number)
                {
                    haveStock.TotalCost  += Factory.ToRounding(buyingStock.HoldingCost * buyingStock.HoldingUnit * 1000, 2);
                    haveStock.TotalUnit  += buyingStock.HoldingUnit;
                    haveStock.AverageCost = Factory.ToRounding(haveStock.TotalCost / haveStock.TotalUnit, 2);
                    Had = StatusOfAccount.HAD;
                }
            }
            if (Had == StatusOfAccount.HADNT)
            {
                StockAccount.SynchronizeAccount.holdingList.Add(buyingStock);
            }
            StockAccount.SynchronizeAccount.MaxShowhand -= (int)(buyingStock.HoldingCost * buyingStock.HoldingUnit * 1000);
        }
        public static void ClearHoldingList(Clinched sellingStock)
        {
            int Count = 0;

            foreach (Clinched haveStock in StockAccount.SynchronizeAccount.holdingList)
            {
                if (haveStock.Number == sellingStock.Number)
                {
                    haveStock.TotalCost -= Factory.ToRounding(sellingStock.HoldingCost * sellingStock.HoldingUnit, 2);
                    haveStock.TotalUnit -= sellingStock.HoldingUnit;
                    if (haveStock.TotalUnit > 0)
                    {
                        haveStock.AverageCost = Factory.ToRounding(haveStock.TotalCost / haveStock.TotalUnit, 2);
                    }
                    else
                    {
                        haveStock.HoldStatus = HoldStatus.DELETE;
                    }
                    StockAccount.SynchronizeAccount.Gross += (int)Factory.ToRounding(Factory.ToRounding((sellingStock.HoldingCost - haveStock.AverageCost / 1000) * sellingStock.HoldingUnit * 1000, 2), 0);
                }
                Count++;
            }
            StockAccount.SynchronizeAccount.MaxShowhand += (int)(sellingStock.HoldingCost * sellingStock.HoldingUnit * 1000);
        }