Beispiel #1
0
        private void FillControlValues()
        {
            if (Linked)
            {
                int dataCount = _chart.StockData.TimeSeries.DataPoints.Count;
                textBoxStock.Text        = _chart.Stock.StockSymbol;
                textBoxValue.Text        = _chart.StockData.TimeSeries.DataPoints[dataCount - 1].Close.ToString();
                textBoxVolatility2W.Text = "";
                textBoxVolatility4W.Text = "";
                textBoxVolatility2M.Text = "";

                if (_chart.Interval == Api.Interval.Daily)
                {
                    if (dataCount > 10)
                    {
                        textBoxVolatility2W.Text = (Indicators.GetAnualVolatility(_chart.StockData, dataCount - 1, 10, PricePoint.Close) * 100).ToString("0.0") + "%";
                    }
                    if (dataCount > 20)
                    {
                        textBoxVolatility4W.Text = (Indicators.GetAnualVolatility(_chart.StockData, dataCount - 1, 20, PricePoint.Close) * 100).ToString("0.0") + "%";
                    }
                    if (dataCount > 40)
                    {
                        textBoxVolatility2M.Text = (Indicators.GetAnualVolatility(_chart.StockData, dataCount - 1, 40, PricePoint.Close) * 100).ToString("0.0") + "%";
                    }
                }
            }
        }