Exemple #1
0
        private void DoTrade(string stockSymbol, double price, int quantity, TradeIndicators tradeType)
        {
            var stock = GetStock(stockSymbol);

            if (stock == null)
            {
                throw new ArgumentException($"{stockSymbol} is not a tradable stock.");
            }

            var trade = new Trade(stock, tradeType, price, quantity);

            _trade.AddTrade(trade);
        }
 public async Task <ActionResult <Trade> > PostTrade(Trade Trade)
 {
     return(await _trade.AddTrade(Trade));
 }