コード例 #1
0
        private void SaveDividendData()
        {
            if (Field == TickType.IB_DIVIDENDS)
            {
                if (StringValue != null)
                {
                    string[] tokens = StringValue.Split(new char[] { ',' });
                    if (tokens.Length >= 4)
                    {
                        double   dividendsPastYear;
                        double   dividendsNextYear;
                        DateTime exDate;
                        double   dividend;

                        if (double.TryParse(tokens[0], out dividendsPastYear))
                        {
                            DividendsPastYear = dividendsPastYear;
                        }
                        if (double.TryParse(tokens[1], out dividendsNextYear))
                        {
                            DividendsNextYear = dividendsNextYear;
                        }
                        if (TWSUtilities.TryParseTWSDate(tokens[2], out exDate))
                        {
                            ExDate = exDate;
                        }
                        if (double.TryParse(tokens[3], out dividend))
                        {
                            Dividend = dividend;
                        }
                    }
                }
            }
        }