Exemple #1
0
        private void Reset()
        {
            foreach (var option in Options)
            {
                var details = _tradingService.GetMarketDetails(option.Epic);

                option.Update(details);
            }

            CurrentPrice = Options.Average(o => o.CurrentPrice);

            Update();
        }
        private void AddMarket(BrowseMarketModel item)
        {
            var detail = _tradingService.GetMarketDetails(item.Epic);

            if (_marketId == null)
            {
                _marketId = detail.instrument.marketId;
            }

            if (_marketId != detail.instrument.marketId)
            {
                MessageBox.Show($"Add option based on {_marketId} market.", "Wrong market");
                return;
            }

            SelectedMarkets.Add(item);

            ValidateCommand.RaiseCanExecuteChanged();
        }