コード例 #1
0
ファイル: SgtMraForm.cs プロジェクト: rfuj0927/sgt
        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();
            });
        }
コード例 #2
0
ファイル: AnalysisEngine.cs プロジェクト: rfuj0927/sgt
 public AnalysisEngine(MraParams p, IDataQuerier q, CustomTickerHistoryDataQuerier c)
 {
     this.mMraParams                      = p;
     this.mReferenceDataQuerier           = q;
     this.mCustomTickerHistoryDataQuerier = c;
 }