private void regressButton_OnClick(object sender, EventArgs e) { MraParams p = new MraParams(); p.fromDt = fromDateTimePicker.Value; p.toDt = toDateTimePicker.Value; p.yVariable = new VariablePair(ySymbolTextBox.Text, (SeriesType)Enum.Parse(typeof(SeriesType), ySeriesTypeComboBox.Text)); p.returnType = (ReturnType)Enum.Parse(typeof(ReturnType), returnTypeComboBox.Text); foreach (DataGridViewRow row in xParamsDgv.Rows) { if (string.IsNullOrEmpty((string)row.Cells[0].Value)) { continue; } p.xVariables.Add(new VariablePair((string)row.Cells[0].Value, (SeriesType)Enum.Parse(typeof(SeriesType), (string)row.Cells[1].Value))); } mRegressionResults.Clear(); resultsDgv.Invalidate(); Task.Run(() => { IDataQuerier sourceDataQuerier; if (bbgSourceRadioButton.Checked) { sourceDataQuerier = new BbgDataApiDataQuerier(); } else { sourceDataQuerier = new EikonDataApiDataQuerier(EIKON_DATA_API_KEY); } AnalysisEngine analysisEngine = new AnalysisEngine(p, sourceDataQuerier, new CustomTickerHistoryDataQuerier(mCustomTickerHistoryFilePath)); analysisEngine.AProgressChanged += OnProgressChanged; analysisEngine.AAddRegressionResult += OnAddRegressionResult; analysisEngine.Run(); }); }
public AnalysisEngine(MraParams p, IDataQuerier q, CustomTickerHistoryDataQuerier c) { this.mMraParams = p; this.mReferenceDataQuerier = q; this.mCustomTickerHistoryDataQuerier = c; }