/// <summary>
        /// Gets a List of open orders represented as ReadModel
        /// </summary>
        /// <param name="traderId"></param>
        /// <param name="includeTrades"></param>
        /// <returns></returns>
        public object GetOpenOrders(TraderId traderId, bool includeTrades = false)
        {
            List <OrderReadModel> orders = _orderRepository.GetOpenOrders(traderId.Id.ToString(CultureInfo.InvariantCulture));

            for (int i = 0; i < orders.Count; i++)
            {
                IList <object>             trades = _tradeRepository.GetTradesByorderId(orders[i].OrderId);
                Tuple <decimal, DateTime?> data   = CalculateAveragePrice(trades);
                orders[i].AveragePrice = data.Item1;
                if (orders[i].Status == OrderState.Complete.ToString())
                {
                    orders[i].ClosingDateTime = data.Item2;
                }
                if (includeTrades)
                {
                    orders[i].Trades = trades;
                }
            }
            return(orders);
        }
 public object QueryTrades(string orderId)
 {
     return(_tradeRepository.GetTradesByorderId(orderId));
 }