void GetQuotes(DataFeed feed, string symbol) { this.CheckCancel(); this.Log("Getting quotes for {0}", symbol); var bars = new PairBars(feed, symbol, BarPeriod.S1, timeStamp, -1); foreach (var element in bars) { if ((null != element.Bid) && (null != element.Ask)) { var entry = new FullSymbolEntry(symbol) { Bid = element.Bid.Close, Ask = element.Ask.Close, }; this.quotes.Add(entry); this.Log("Quotes for symbol {0} have been got: {1}/{2}", symbol, entry.Bid, entry.Ask); } else { this.Log("Quotes for symbol {0} are not available", symbol); } break; } }
void RefreshData() { this.m_calculatorTabPropertyGrid.SelectedObject = this.calculator; this.m_symbolsTabPropertyGrid.SelectedObject = null; this.m_quotesTabPropertyGrid.SelectedObject = null; this.m_accountsTabPropertyGrid.SelectedObject = null; this.m_trades.Items.Clear(); this.m_accounts.Items.Clear(); this.m_quotes.Items.Clear(); this.m_symbols.Items.Clear(); this.m_currencies.Items.Clear(); foreach (var element in this.calculator.Symbols) { this.m_symbols.Items.Add(element); } foreach (var element in this.calculator.Prices) { var item = new FullSymbolEntry(element.Key) { Bid = element.Value.Bid, Ask = element.Value.Ask }; this.m_quotes.Items.Add(item); } foreach (var element in calculator.Accounts) { this.m_accounts.Items.Add(element); } foreach (var element in this.calculator.Currencies) { this.m_currencies.Items.Add(element); } }
void CreateNewQuote() { var entry = new FullSymbolEntry(this.m_symbol.Text); this.quotes.Items.Add(entry); }