コード例 #1
0
        public IStopLimitOrder TryGetStopLimitOrder(uint exchangeOrderId)
        {
            if (!StopLimitOrders.ContainsKey(exchangeOrderId))
            {
                return(null);
            }

            return(StopLimitOrders[exchangeOrderId]);
        }
コード例 #2
0
        public IStopLimitOrder NewStopLimitOrder(string symbol, int clientId, double triggerPrice, double limitPrice, int quantity, WayEnum way)
        {
            if (!ClientStopLimitOrders.ContainsKey(clientId))
            {
                ClientStopLimitOrders.Add(clientId, new EditableList <IStopLimitOrder>());
            }

            var trigger  = new BestPriceTrigger(symbol, triggerPrice, way);
            var toReturn = new StopLimitOrder(symbol, quantity, limitPrice, triggerPrice, way, clientId, trigger);

            toReturn.SetExchangeOrderId(globalItemCounter);
            StopLimitOrders.Add(globalItemCounter, toReturn);
            ClientStopLimitOrders[clientId].Add(toReturn);
            toReturn.RegisterOrderRepositoryDeleteHandler(HandleDeletedStopLimitOrder);

            globalItemCounter++;
            return(toReturn);
        }
コード例 #3
0
 private void HandleDeletedStopLimitOrder(IStopLimitOrder stopLimitOrder)
 {
     stopLimitOrder.UnRegisterOrderRepositoryDeleteHandler();
     StopLimitOrders.Remove(stopLimitOrder.ExchangeOrderId);
     ClientStopLimitOrders[stopLimitOrder.ClientId].Remove(stopLimitOrder);
 }