예제 #1
0
        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;
            }
        }
예제 #2
0
        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);
            }
        }
예제 #3
0
파일: MainForm.cs 프로젝트: ifzz/FDK
        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);
            }
        }
예제 #4
0
        void CreateNewQuote()
        {
            var entry = new FullSymbolEntry(this.m_symbol.Text);

            this.quotes.Items.Add(entry);
        }
예제 #5
0
파일: ServerDialog.cs 프로젝트: ifzz/FDK
 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;
     }
 }
예제 #6
0
파일: NewQuoteDialog.cs 프로젝트: ifzz/FDK
 void CreateNewQuote()
 {
     var entry = new FullSymbolEntry(this.m_symbol.Text);
     this.quotes.Items.Add(entry);
 }