Exemple #1
0
        private async void RefreshParameters()
        {
            DateTime dt = File.GetLastWriteTime(Application.StartupPath + "\\assets.txt").Date;

            if (DateTime.Now.Date != dt)
            {
                toolStripStatusLabel.Text = "Обновляем дивидендную доходность...";
                await DividendTask(assets);

                //  list = assets.ToList().OrderBy(x => x.Name).ToList();
                DoTable(list);

                toolStripStatusLabel.Text = "Обновляем ликвидность...";
                await LiqTask(assets);

                DoTable(list);

                toolStripStatusLabel.Text = "Обновляем волатильность и среднюю доходность...";

                List <Asset>[] l = ClassAssistant.FillQueue(assets);
                await VolatilityTask(dataPath, l, trackBar_period.Value);

                DoTable(list);

                dataGridView1.AllowUserToOrderColumns = true;
                toolStripStatusLabel.Text             = "Обновление выполнено";
            }
            RefreshAllPeriods();
        }
Exemple #2
0
        private async void RefreshAllPeriods()
        {
            Asset[]        newassets = assets;
            List <Asset>[] l         = ClassAssistant.FillQueue(newassets);

            for (int i = 3; i < 13; i++)
            {
                if ((File.GetLastWriteTime(Program.path + "\\" + i + ".txt").Date != DateTime.Now.Date) || !File.Exists(Program.path + "\\" + i + ".txt"))
                {
                    await VolatilityTask(dataPath, l, i);

                    ClassAssistant.SaveData(Program.path + "\\" + i + ".txt", newassets);
                }
            }
            isCalculate = true;
        }