private void bbExportHistory_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { XtraFolderBrowserDialog dialog = new XtraFolderBrowserDialog(); if (dialog.ShowDialog() != DialogResult.OK) { return; } GridControl gc = new GridControl(); GridView view = new GridView(); gc.ViewCollection.Add(view); gc.MainView = view; gc.DataSource = new BindingSource() { DataSource = typeof(DependencyArbitrageHistoryItem) }; gc.BindingContext = new BindingContext(); gc.ForceInitialize(); view.PopulateColumns(); ArbitrageHelper.Items.ForEach(i => i.SaveHistory()); ArbitrageHelper.Items.ForEach(i => { StatisticalArbitrageStrategy info = new StatisticalArbitrageStrategy(); info.Assign(i); info.LoadHistory(); gc.DataSource = info.History; gc.ExportToXlsx(dialog.SelectedPath + "\\" + info.GetExportFileName() + ".xlsx"); }); System.Diagnostics.Process.Start(dialog.SelectedPath); }
private void biAllHistoryChart_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { StatisticalArbitrageStrategy info = (StatisticalArbitrageStrategy)this.gridView1.GetFocusedRow(); DependencyArbitrageChartForm form = new DependencyArbitrageChartForm(); StatisticalArbitrageStrategy all = new StatisticalArbitrageStrategy(); all.Assign(info); all.LoadHistory(); form.Text = "All History: " + info.TradingPair; form.Arbitrage = all; form.Show(); form.Activate(); }