public void Reset() { Way = WayEnum.NotSet; Quantity = 0; Symbol = string.Empty; ClientId = 0; }
public void Update(MarketOrderDto other) { Symbol = other.Symbol; Quantity = other.Quantity; Way = other.Way; ClientId = other.ClientId; }
public MarketOrder(string symbol, int quantity, WayEnum way, int clientId) : base(symbol, quantity, 0, way, clientId) { if (way == WayEnum.Buy) Price = double.MaxValue; else if (way == WayEnum.Sell) Price = double.MinValue; }
public void Reeset() { Symbol = String.Empty; Quantity = 0; Price = 0; Way = WayEnum.NotSet; ExchangeOrderId = 0; ClientId = 0; }
private void SetFields(StopLimitOrderDto stopLimitOrder) { symbol = stopLimitOrder.Symbol; quantity = stopLimitOrder.Quantity; limitPrice = stopLimitOrder.LimitPrice; triggerPrice = stopLimitOrder.TriggerPrice; way = stopLimitOrder.Way; exchangeOrderId = stopLimitOrder.ExchangeOrderId; }
public void Reset() { ExchangeOrderId = 0; Quantity = 0; Symbol = string.Empty; Price = 0; ExecutionTime = DateTimeOffset.MinValue; Way = WayEnum.NotSet; }
public void Update(ExecutionDto other) { ExchangeOrderId = other.ExchangeOrderId; Quantity = other.Quantity; Symbol = other.Symbol; Price = other.Price; ExecutionTime = other.ExecutionTime; Way = other.Way; }
public void Update(LimitOrderDto other) { Symbol = other.Symbol; Quantity = other.Quantity; Price = other.Price; Way = other.Way; ExchangeOrderId = other.ExchangeOrderId; ClientId = other.ClientId; }
public NewLimitOrderViewModel(IClient exchangeApi) { this.exchangeApi = exchangeApi; LimitOrderTypes = new List<string> {"Limit order", "Stop limit order"}; Ways = new List<WayEnum> { WayEnum.Buy, WayEnum.Sell }; selectedLimitOrderType = LimitOrderTypes[0]; selectedWay = WayEnum.Buy; SetupCommandsAndBehaviour(); }
public void Update(StopLimitOrderDto other) { Symbol = other.Symbol; Quantity = other.Quantity; LimitPrice = other.LimitPrice; TriggerPrice = other.TriggerPrice; Way = other.Way; ExchangeOrderId = other.ExchangeOrderId; ClientId = other.ClientId; }
public StopLimitOrder(string symbol, int quantity, double limitPrice, double triggerPrice, WayEnum way, int clientId, IBestPriceTrigger trigger) { this.way = way; this.symbol = symbol; this.exchangeOrderId = 0; this.clientId = clientId; this.triggerPrice = triggerPrice; this.limitPrice = limitPrice; this.quantity = quantity; Trigger = trigger; }
public MarketOrder(string symbol, int quantity, WayEnum way, int clientId) : base(symbol, quantity, 0, way, clientId) { if (way == WayEnum.Buy) { Price = double.MaxValue; } else if (way == WayEnum.Sell) { Price = double.MinValue; } }
public LimitOrder(string symbol, int quantity, double price, WayEnum way, int clientId) { this.symbol = symbol; this.quantity = quantity; this.price = price; this.way = way; this.clientId = clientId; this.exchangeOrderId = 0; ModifiedHandlers = new List <Action <ILimitOrder, int, double> >(); DeletedHandlers = new List <Action <ILimitOrder> >(); FilledHandlers = new List <Action <ILimitOrder> >(); }
public LimitOrder(string symbol, int quantity, double price, WayEnum way, int clientId) { this.symbol = symbol; this.quantity = quantity; this.price = price; this.way = way; this.clientId = clientId; this.exchangeOrderId = 0; ModifiedHandlers = new List<Action<ILimitOrder, int, double>>(); DeletedHandlers = new List<Action<ILimitOrder>>(); FilledHandlers = new List<Action<ILimitOrder>>(); }
public NewLimitOrderViewModel(IClient exchangeApi) { this.exchangeApi = exchangeApi; LimitOrderTypes = new List <string> { "Limit order", "Stop limit order" }; Ways = new List <WayEnum> { WayEnum.Buy, WayEnum.Sell }; selectedLimitOrderType = LimitOrderTypes[0]; selectedWay = WayEnum.Buy; SetupCommandsAndBehaviour(); }
public ILimitOrder NewLimitOrder(string symbol, int clientId, double price, int quantity, WayEnum way) { if (!ClientOrders.ContainsKey(clientId)) ClientOrders.Add(clientId, new EditableList<ILimitOrder>()); ILimitOrder toReturn = new LimitOrder(symbol, quantity, price, way, clientId); toReturn.SetExchangeOrderId(globalItemCounter); LimitOrders.Add(toReturn.ExchangeOrderId, toReturn); ClientOrders[clientId].Add(toReturn); toReturn.RegisterDeleteNotificationHandler(HandleDeletedLimitOrder); toReturn.RegisterFilledNotification(HandleDeletedLimitOrder); globalItemCounter++; return toReturn; }
public void SubmitMarketOrder(string symbol, int quantity, WayEnum way) { if (!isStarted) { return; } messageConnection.SendMessage(new ClientToServerMessage { ClientId = clientId, MarketOrder = new MarketOrderDto { Quantity = quantity, Symbol = symbol, Way = way }, MessageType = ClientToServerMessageTypeEnum.PlaceMarketOrder }); }
public void SubmitLimitOrder(string symbol, double price, int quantity, WayEnum way) { if (!isStarted) { return; } messageConnection.SendMessage(new ClientToServerMessage { ClientId = clientId, LimitOrder = new LimitOrderDto { ClientId = clientId, Price = price, Quantity = quantity, Symbol = symbol, Way = way }, MessageType = ClientToServerMessageTypeEnum.PlaceLimitOrder }); }
public void SubmitLimitOrder(string symbol, double price, int quantity, WayEnum way) { if (!isStarted) return; messageConnection.SendMessage(new ClientToServerMessage { ClientId = clientId, LimitOrder = new LimitOrderDto { ClientId = clientId, Price = price, Quantity = quantity, Symbol = symbol, Way = way }, MessageType = ClientToServerMessageTypeEnum.PlaceLimitOrder }); }
private void SetFields(LimitOrderDto limitOrder) { Symbol = limitOrder.Symbol; Quantity = limitOrder.Quantity; Price = limitOrder.Price; Way = limitOrder.Way; OrderType = "Limit order"; OrderId = limitOrder.ExchangeOrderId; }
public void SubmitStopLimitOrder(string symbol, double triggerPrice, double limitPrice, int quantity, WayEnum way) { if (!isStarted) { return; } messageConnection.SendMessage(new ClientToServerMessage { ClientId = clientId, StopLimitOrder = new StopLimitOrderDto { Symbol = symbol, Quantity = quantity, Way = way, TriggerPrice = triggerPrice, LimitPrice = limitPrice, ClientId = clientId }, MessageType = ClientToServerMessageTypeEnum.PlaceStopLimitOrder }); }
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; }
public IMarketOrder NewMarketOrder(string symbol, int clientId, int quantity, WayEnum way) { IMarketOrder toReturn = new MarketOrder(symbol, quantity, way, clientId); toReturn.SetExchangeOrderId(globalItemCounter); globalItemCounter++; return toReturn; }
public BestPriceTrigger(string symbol, double triggerPrice, WayEnum way) { Symbol = symbol; TriggerPrice = triggerPrice; Way = way; }
public IMarketOrder NewMarketOrder(string symbol, int clientId, int quantity, WayEnum way) { IMarketOrder toReturn = new MarketOrder(symbol, quantity, way, clientId); toReturn.SetExchangeOrderId(globalItemCounter); globalItemCounter++; return(toReturn); }
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); }
public ILimitOrder NewLimitOrder(string symbol, int clientId, double price, int quantity, WayEnum way) { if (!ClientOrders.ContainsKey(clientId)) { ClientOrders.Add(clientId, new EditableList <ILimitOrder>()); } ILimitOrder toReturn = new LimitOrder(symbol, quantity, price, way, clientId); toReturn.SetExchangeOrderId(globalItemCounter); LimitOrders.Add(toReturn.ExchangeOrderId, toReturn); ClientOrders[clientId].Add(toReturn); toReturn.RegisterDeleteNotificationHandler(HandleDeletedLimitOrder); toReturn.RegisterFilledNotification(HandleDeletedLimitOrder); globalItemCounter++; return(toReturn); }
private void SetFields() { Symbol = limitOrder.Symbol; Quantity = limitOrder.Quantity; Price = limitOrder.Price; Way = limitOrder.Way; }
public void SubmitMarketOrder(string symbol, int quantity, WayEnum way) { if (!isStarted) return; messageConnection.SendMessage(new ClientToServerMessage { ClientId = clientId, MarketOrder = new MarketOrderDto { Quantity = quantity, Symbol = symbol, Way = way }, MessageType = ClientToServerMessageTypeEnum.PlaceMarketOrder }); }
public void SubmitStopLimitOrder(string symbol, double triggerPrice, double limitPrice, int quantity, WayEnum way) { if (!isStarted) return; messageConnection.SendMessage(new ClientToServerMessage { ClientId = clientId, StopLimitOrder = new StopLimitOrderDto { Symbol = symbol, Quantity = quantity, Way = way, TriggerPrice = triggerPrice, LimitPrice = limitPrice, ClientId = clientId }, MessageType = ClientToServerMessageTypeEnum.PlaceStopLimitOrder }); }
private void SetFields(StopLimitOrderDto stopLimitOrder) { Symbol = stopLimitOrder.Symbol; Quantity = stopLimitOrder.Quantity; TriggerPrice = stopLimitOrder.TriggerPrice; LimitPrice = stopLimitOrder.LimitPrice; OrderId = stopLimitOrder.ExchangeOrderId; Way = stopLimitOrder.Way; }