private void Events_OpenPositionsChangedEvent(string exchange, string symbol, int openPositions) { var stock = JobbingStocks.FirstOrDefault(s => s.Exchange == exchange && symbol == s.Symbol); if (stock != null) { stock.OpenPositionsCount = openPositions; } }
private void Events_StockLastPriceChangeEvent(string exchange, string symbol, decimal lastPrice) { var stock = JobbingStocks.FirstOrDefault(s => s.Exchange == exchange && symbol == s.Symbol); if (stock != null) { stock.CurrentPrice = lastPrice; } }
private void Events_TargetStopLossChangeEvent(string exchange, string symbol, decimal targetPrice, decimal stopLossPrice) { var stock = JobbingStocks.FirstOrDefault(s => s.Exchange == exchange && symbol == s.Symbol); if (stock != null) { stock.TargetPrice = targetPrice; stock.StopLossPrice = stopLossPrice; } }
private void Events_TargetStopLossHitEvent(string exchange, string symbol, int targetHitCount, int stopLossHitCount) { var stock = JobbingStocks.FirstOrDefault(s => s.Exchange == exchange && symbol == s.Symbol); if (stock != null) { stock.TargetHitCount = targetHitCount; stock.StopLossHitCount = stopLossHitCount; } }
private void Events_JobbingStatusChangedEvent(string exchange, string symbol, string status) { JobbingStatus jobbingStatus = JobbingStatus.NotStarted; if (Enum.TryParse(status, out jobbingStatus)) { var stock = JobbingStocks.FirstOrDefault(s => s.Exchange == exchange && symbol == s.Symbol); if (stock != null) { stock.Status = jobbingStatus; } } }