private void llTestPattern_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) { if ((ModifierKeys & Keys.Shift) == 0) { if (m_result == null) return; var c = new CalendarPatternTestDisplay(); c.Create(m_result); c.DisplayInShowForm("Test seasonal pattern"); } else { //#if DEBUG // var tickers = CIXCustomListEventDataControl.GetTickersFromFile(); // var list = CalendarAnalysisHelper.FindNextTrades(tickers); // if (list != null) // { // var grid = list.DisplayInGrid("Trade Search"); // grid.SetHeaderClickSort(); // } //#endif } }
public void Create(IList<SwapsSummaryRow> rows_) { if (m_grid != null) return; setImages(); // kick off live curves CarbonSubscriber.Instance().Initiate(); m_grid = new MainGrid {Dock = DockStyle.Fill}; tableLayoutPanel1.Controls.Add(m_grid, 0, 1); if (rows_ != null) { m_originalList = rows_; rebuildWorkingSet(); m_grid.Create(m_workingSet); } else loadRowsAsync(); cbAlwaysDisplay.CheckedChanged += (x, y) => { cmbAlwaysPlot.Enabled = cbAlwaysDisplay.Checked; reChart(); }; cmbAlwaysPlot.AddItems(typeof(StatCols), true); cmbAlwaysPlot.SelectedIndex = 0; for (int i =0;i<cmbAlwaysPlot.Items.Count;++i) if (cmbAlwaysPlot.Items[i].DisplayText.Equals("Level")) { cmbAlwaysPlot.SelectedIndex = i; break; } cmbAlwaysPlot.ValueChanged += (x, y) => reChart(); { m_scatter = new StatContScatter {Dock = DockStyle.Fill}; utBottomRight.Tabs[1].TabPage.Controls.Add(m_scatter); m_scatter.Create(() => m_workingSet); } // initially hide multiregressor stuff utBottomRight.Tabs[2].Visible = false; multiRegressionCompare1.SetPopupContainer(ultraPopupControlContainer1); m_chartArgs.PropertyChanged += (x, y) => { reChart(); }; dateRangeSelect1.Create(m_chartArgs); m_grid.StatCellClicked += (x, y) => { if (y.Button == System.Windows.Forms.MouseButtons.Left) { m_lastClicked = y; m_scatter.Selected = y.SelectedRows; if (y.SelectedRows.Count()==1 && y.GetSelectedColsAsEnum().First().Value == StatCols.RSquared) { RegressionHelper.ShowRegression(y.SelectedRows.First()); } if (y.SelectedRows.Count()==1 && y.GetSelectedColsAsEnum().First().Value == StatCols.DeMark) { // do nothing when click on DeMark column } else { reChart(); if(utBottomRight.Tabs[2].Visible && y.SelectedRows.Count()==1 && y.GetSelectedColsAsEnum().First().Value==StatCols.Residuals) { utBottomRight.Tabs[2].Text = string.Format("{0} regressor comparison", y.SelectedRows.First().Inst); multiRegressionCompare1.Create(y.SelectedRows.First()); } } } else if (y.Button == System.Windows.Forms.MouseButtons.Right && y.SelectedRows.Count()==1 ) { if (m_contextMenu == null) m_contextMenu = new ContextMenuStrip(); m_contextMenu.Items.Clear(); { var item = y.SelectedRows.First(); m_contextMenu.Items.Add( new MenuItems.GenericMenuItem(item, async (swapSummaryRow_) => { if (swapSummaryRow_.OriginatingConfig != null) await UserListCache.Instance().Remove(swapSummaryRow_.OriginatingConfig); }, string.Format("Remove '{0}' from products", item.Inst)) ); m_contextMenu.Items.Add( new MenuItems.GenericMenuItem(item, (swapSummaryRow_) => { var result = CalendarAnalysisHelper.FindSeasonalPattern(swapSummaryRow_.GetInstrument().A_Prices, new CalendarMovesArgs() { StartYear = 2011 }); var gui = new CalendarPatternTestDisplay(); gui.Create(result); gui.DisplayInShowForm(string.Format("{0} calendar analysis", swapSummaryRow_.Inst)); }, string.Format("'{0}' calendar analysis..", item.Inst)) ); } if (m_contextMenu.Items.Count > 0) m_contextMenu.Show(Cursor.Position); } }; }
protected override void OnClick(EventArgs e) { var c = new CalendarPatternTestDisplay(); c.Create(Item.GetSource()); c.DisplayInShowForm(Item.Instrument); }