Exemplo n.º 1
0
        void UpdateDataRange()
        {
            if (_quoteData == null)
            {
                return;
            }

            DateTime ds    = DateTime.FromOADate(rs.LowerValue);
            Quote    quote = _quoteData.FirstOrDefault(p => p.Date >= ds);

            if (quote == null)
            {
                return;
            }

            financialChart1.BeginUpdate();
            _quoteData.ReferenceValue = quote.Close;

            if (_comparisonSymbols != null)
            {
                foreach (var kv in _comparisonSymbols)
                {
                    quote = kv.Value.DataSource.FirstOrDefault(p => p.Date >= ds);
                    if (quote != null)
                    {
                        kv.Value.DataSource.ReferenceValue = quote.Close;
                        kv.Value.Series.Rebind();
                        kv.Value.MovingAverage.Rebind();
                    }
                }
            }

            fs.Rebind();
            ma.Rebind();
            UpdateYRange();
            financialChart1.EndUpdate();
        }