public Guid CreateMarketOrder(DateTime time, TickerType tickerType, MarketOrderState orderState, double bidPrice, double askPrice, BarItem barItem) { Guid marketOrderId = Guid.NewGuid(); MarketOrder marketOrder = new MarketOrder(tickerType); marketOrder.OpenOrder(time, orderState, bidPrice, askPrice, barItem.Time); marketOrders.Add(marketOrderId, marketOrder); if (lastTickerOrder.ContainsKey(tickerType.Symbol)) { lastTickerOrder[tickerType.Symbol] = marketOrderId; } else { lastTickerOrder.Add(tickerType.Symbol, marketOrderId); } return(marketOrderId); }