コード例 #1
0
        public enum BuyOrSellEnum { Buy, Sell }; //declare BuyOrSellEnum

        /// <summary>
        /// Constructor for BuyOrSell object
        /// </summary>
        /// <param name="stockNameIn">Name of stock that is bought or sold</param>
        /// <param name="quantityIn">Nuber of shares bought</param>
        /// <param name="pricePerStockIn">Price per share</param>
        /// <param name="BORSIn">Whether the stock was bought or sold</param>
        public BuyOrSell_M(string stockNameIn, int quantityIn, double pricePerStockIn, BuyOrSellEnum BORSIn)
        {
            StockName      = stockNameIn;
            Quantity       = quantityIn;
            PricePerStock  = pricePerStockIn;
            BuyOrSellState = BORSIn;
        }
コード例 #2
0
 public Trade(Stock stock, DateTime timestamp, Double sharesQuantity, BuyOrSellEnum buyOrSellIndicator, Double price)
 {
     this.Stock              = stock;
     this.Timestamp          = timestamp;
     this.SharesQuantity     = sharesQuantity;
     this.BuyOrSellIndicator = buyOrSellIndicator;
     this.Price              = price;
 }
コード例 #3
0
        /// <summary>
        /// Constructor for BuyOrSell object
        /// </summary>
        /// <param name="stock">Stock object that is being bought or sold</param>
        /// <param name="quanittyIn">Number of shares bought</param>
        /// <param name="BORSIn">Whether the stock was bought or sold</param>
        public BuyOrSell_M(Stock_M stock, int quanittyIn, BuyOrSellEnum BORSIn)
        {
            StockName     = stock.Name;
            PricePerStock = stock.Price;

            Quantity = quanittyIn;

            BuyOrSellState = BORSIn;
        }