public void Create(CalendarAnalysisResult result_) { m_analysisResult = result_; reloadChart(); lineChartDataDisplay1.Chart.ChartDataClicked -= handleChartDataClicked; lineChartDataDisplay1.Chart.ChartDataClicked += handleChartDataClicked; boundInfraGrid1.Bind(m_range); boundInfraGrid1.AddClickHandler("TradeDirection", (x, y) => { var row = y.ListObject as CalendarAnalysisTradeRange; if (row == null) return; switch (row.TradeDirection) { case TradeDirection.Long: row.TradeDirection = TradeDirection.Short; break; case TradeDirection.Short: row.TradeDirection = TradeDirection.Flat; break; case TradeDirection.Flat: row.TradeDirection = TradeDirection.Long; break; } }); boundInfraGrid1.AddClickHandler("DeleteImage", (x, y) => { if (m_mode == ListeningMode.Listening) return; var row = y.ListObject as CalendarAnalysisTradeRange; if (row == null) return; if ((ModifierKeys & Keys.Shift) != 0) { var stats = CalendarAnalysisHelper.GetTradeRuleHistoricalStats(row, m_analysisResult); if (stats == null) return; var list = new BindingList<CalendarAnalysisTradeRangeResult> {stats}; var grid = new SI.Controls.BoundInfraGrid(); grid.Bind(list); grid.DisplayInShowForm("blah"); } else { m_range.Remove(row); } }); }
public void Create() { BbgTalk.Core.GUI_INVOKE_CONTROL = this; m_countryBondSource = m_countryBondSource; mainGrid.Create(m_localList); mainGrid.StatCellClicked += handleCellClicked; // smart markings on fit y axis swccVsFit.SetYAxixTickStyle(Infragistics.UltraChart.Shared.Styles.AxisTickStyle.Smart); // no labels on different x axis swccChange.Chart.Axis.X.Labels.ItemFormat = Infragistics.UltraChart.Shared.Styles.AxisItemLabelFormat.None; focusSwitchControl1.SelectedFocus = m_countryBondSource.Focus; focusSwitchControl1.FocusChanged += (x, y) => m_countryBondSource.Focus = y.Focus; rebuildLocalList(); m_countryBondSource.PropertyChanged += (a, b) => { switch (b.PropertyName) { case "Focus": reloadAllStats(); break; } }; m_countryBondSource.DisplayArgs.PropertyChanged += (a, b) => { switch (b.PropertyName) { case "StartTenor": case "EndTenor": reloadSmoothCurves(); break; case "ZScore1": case "ZScore2": reloadFocusZScores(false); break; } }; m_countryBondSource.DisplayArgs.GetClusterArgs(0).PropertyChanged += (a, b) => reloadClusterFlyZScores(0, false); m_countryBondSource.DisplayArgs.GetClusterArgs(1).PropertyChanged += (a, b) => reloadClusterFlyZScores(1, false); tbFlyZ1_1.Bind(m_countryBondSource.DisplayArgs.GetClusterArgs(0), "ZScore1", new Validators.IntValidator()); tbFlyZ1_2.Bind(m_countryBondSource.DisplayArgs.GetClusterArgs(0), "ZScore2", new Validators.IntValidator()); tbFlyZ2_1.Bind(m_countryBondSource.DisplayArgs.GetClusterArgs(1), "ZScore1", new Validators.IntValidator()); tbFlyZ2_2.Bind(m_countryBondSource.DisplayArgs.GetClusterArgs(1), "ZScore2", new Validators.IntValidator()); tbfocusZ1.Bind(m_countryBondSource.DisplayArgs, "ZScore1", new Validators.IntValidator()); tbHighLowWindow.Bind(m_countryBondSource.DisplayArgs, "HighLowAvgWindow", new Validators.IntValidator()); tbStartTenor.Bind(m_countryBondSource.DisplayArgs, "StartTenor", new Validators.IntValidator()); tbEndTenor.Bind(m_countryBondSource.DisplayArgs, "EndTenor", new Validators.IntValidator()); tbRepoRate.Bind(m_countryBondSource, "RepoRate", new Validators.DoubleValidator(null)); #if DEBUG mainGrid.AddClickHandler("Bond", (a, b) => { var line = b.ListObject as BondAnalysisLine; if (line == null) return; SI.Common.CBBExecute.Execute(string.Format("<home><blp-0>{0} <GOVT> <go> FLDS <go>", line.UnderlyingBond.Isin)); }); mainGrid.AddClickHandler("ModifiedDuration", (a, b) => { var line = b.ListObject as BondAnalysisLine; if (line == null) return; var dt = line.ValuesAsDataTable((BondField[])Enum.GetValues(typeof(BondField))); var grid = new SI.Controls.BoundInfraGrid(); grid.Bind(dt); grid.DisplayInShowForm(string.Format("{0} underlying values", line.Bond)); }); #endif mainGrid.AddClickHandler("ImageIncludeInFit", (a, b) => { var line = b.ListObject as BondAnalysisLine; if (line == null) return; line.IncludeInFit = !line.IncludeInFit; reloadSmoothCurves(); }); reloadAllStats(); }
public static void CompareResults(Strat[] strats_) { var results = new BindingList<Backtest.SimResultGen<Strat>>(); foreach(var s in strats_) { var we = getWE(s); if (we.Value == null) continue; var eval = we.Value; var wts = we.Key; results.Add(new Backtest.SimResultGen<Strat>(s, wts, eval)); } var grid = new SI.Controls.BoundInfraGrid(); grid.Bind(results); grid.AddClickHandler("Sharpe", (a, b) => { ((Backtest.SimResultGen<Strat>)b.ListObject).Perf.Display(); }); grid.AddClickHandler("NumRebals", (a, b) => { ((Backtest.SimResultGen<Strat>)b.ListObject).Weights.DisplayInGrid("Weights"); }); grid.AddClickHandler("Stat", (a, b) => { ((Backtest.SimResultGen<Strat>)b.ListObject).WtsAnalyzer.Display("weights analysis"); }); grid.Grid.DisplayLayout.Bands[0].Columns["Param3"].Hidden = true; grid.Grid.DisplayLayout.Bands[0].Columns["Param4"].Hidden = true; grid.DisplayInShowForm("Comparison of results"); }
private void handleDDClicked(object sender, SI.Controls.RowClickedEventArgs e_) { PerfRow pr = (PerfRow)e_.ListObject; ReturnsEval.DataSeriesEvaluator eval = m_comp.FindEval(pr.StrategyName.Name); SI.Controls.BoundInfraGrid grid = new SI.Controls.BoundInfraGrid(); grid.Bind(eval.Daily.DrawDowns, typeof(ReturnsEval.DrawDown)); grid.DisplayInShowForm(string.Format("{0} drawdowns", pr.StrategyName)); }