Example #1
0
        private void dataGrid_CellContentDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            try
            {
                common.controls.baseDataGridView resultDataGrid = this.CurrentDataGridView;
                if (resultDataGrid == null)
                {
                    return;
                }
                string stockCode = resultTab.SelectedTab.Name;

                if (resultDataGrid.CurrentRow == null)
                {
                    return;
                }
                AppTypes.TimeRanges      timeRange    = AppTypes.TimeRangeFromCode(resultDataGrid.Columns[e.ColumnIndex].DataPropertyName);
                data.baseDS.stockCodeRow stockCodeRow = application.dataLibs.FindAndCache(myDataSet.stockCode, stockCode);
                if (stockCodeRow == null)
                {
                    return;
                }

                string strategyCode = resultDataGrid.CurrentRow.Cells[0].Value.ToString();
                ShowTradeTransactions(stockCodeRow, strategyCode, timeRange, cbTimeScale.myValue);
            }
            catch (Exception er)
            {
                this.ShowError(er);
            }
        }
Example #2
0
        private void dataGrid_CellContentDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            try
            {
                common.controls.baseDataGridView resultDataGrid = this.CurrentDataGridView;
                if (resultDataGrid == null)
                {
                    return;
                }
                string stockCode = resultTab.SelectedTab.Name;

                if (resultDataGrid.CurrentRow == null)
                {
                    return;
                }
                AppTypes.TimeRanges          timeRange    = AppTypes.TimeRangeFromCode(resultDataGrid.Columns[e.ColumnIndex].DataPropertyName);
                databases.tmpDS.stockCodeRow stockCodeRow = DataAccess.Libs.myStockCodeTbl.FindBycode(stockCode);
                if (stockCodeRow == null)
                {
                    return;
                }

                string     strategyCode = resultDataGrid.CurrentRow.Cells[0].Value.ToString();
                DataParams dataParam    = new DataParams(timeScaleCb.myValue.Code, timeRange, 0);
                ShowTradeTransactions(stockCodeRow, strategyCode, dataParam);
            }
            catch (Exception er)
            {
                this.ShowError(er);
            }
        }
Example #3
0
        private void addToWatchListMenuItem_Click(object sender, EventArgs e)
        {
            try
            {
                common.controls.baseDataGridView resultDataGrid = this.CurrentDataGridView;
                if (resultDataGrid == null)
                {
                    return;
                }

                string           stockCode     = resultTab.SelectedTab.Name;
                StringCollection strategyCodes = new StringCollection();
                for (int idx = 0; idx < resultDataGrid.SelectedRows.Count; idx++)
                {
                    if (resultDataGrid.SelectedRows[idx] == null)
                    {
                        continue;
                    }
                    application.Strategy.StrategyMeta meta = application.Strategy.StrategyLibs.FindMetaByName(resultDataGrid.SelectedRows[idx].Cells[0].Value.ToString());
                    strategyCodes.Add(meta.Code);
                }
                if (strategyCodes.Count > 0)
                {
                    this.AddStockToWatchList(stockCode, strategyCodes, timeScaleCb.myValue);
                }
            }
            catch (Exception er)
            {
                this.ShowError(er);
            }
        }
        private void profitDetailMenu_Click(object sender, EventArgs e)
        {
            try
            {
                common.controls.baseDataGridView resultDataGrid = this.CurrentDataGridView;
                if (resultDataGrid == null || resultDataGrid.CurrentRow == null || resultDataGrid.CurrentCell == null)
                {
                    return;
                }
                if (resultDataGrid.CurrentCell.ColumnIndex <= 0)
                {
                    return;
                }

                string stockCode = resultTab.SelectedTab.Name;
                data.tmpDS.stockCodeRow stockCodeRow = DataAccess.Libs.myStockCodeTbl.FindBycode(stockCode);
                if (stockCodeRow == null)
                {
                    return;
                }
                application.Strategy.Meta meta = application.Strategy.Libs.FindMetaByName(resultDataGrid.CurrentRow.Cells[0].Value.ToString());

                int colId = resultDataGrid.CurrentCell.ColumnIndex;
                AppTypes.TimeRanges timeRange = AppTypes.TimeRangeFromCode(resultDataGrid.Columns[colId].DataPropertyName);
                ShowTradeTransactions(stockCodeRow, meta.Code, timeRange, timeScaleCb.myValue);
            }
            catch (Exception er)
            {
                this.ShowError(er);
            }
        }
Example #5
0
        private void openMenuItem_Click(object sender, EventArgs e)
        {
            try
            {
                common.controls.baseDataGridView resultDataGrid = this.CurrentDataGridView;
                if (resultDataGrid == null)
                {
                    return;
                }

                string stockCode = resultTab.SelectedTab.Name;
                data.baseDS.stockCodeRow stockCodeRow = application.dataLibs.FindAndCache(myDataSet.stockCode, stockCode);
                if (stockCodeRow != null)
                {
                    return;
                }

                AppTypes.TimeRanges timeRange = AppTypes.TimeRangeFromCode(resultDataGrid.Columns[resultDataGrid.ColumnCount - 1].Name);
                ShowStock(stockCodeRow, timeRange, cbTimeScale.myValue);
            }
            catch (Exception er)
            {
                this.ShowError(er);
            }
        }
Example #6
0
        private static void SetDataGrid(common.controls.baseDataGridView grid, DataTable tbl)
        {
            grid.DataSource = tbl;

            DataGridViewCellStyle amountCellStyle = new System.Windows.Forms.DataGridViewCellStyle();

            amountCellStyle.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight;
            amountCellStyle.Format    = "N" + common.system.GetPrecisionFromMask(Settings.sysMaskLocalAmt);
            amountCellStyle.NullValue = null;

            grid.Columns.Clear();
            for (int idx = 0; idx < tbl.Columns.Count; idx++)
            {
                DataGridViewTextBoxColumn column = new System.Windows.Forms.DataGridViewTextBoxColumn();
                grid.Columns.Add(column);
                column.DataPropertyName = tbl.Columns[idx].ColumnName;
                if (idx == 0)
                {
                    column.HeaderText = "Strategy";
                    column.Width      = 100;
                    column.Frozen     = true;
                }
                else
                {
                    column.HeaderText       = tbl.Columns[idx].Caption;
                    column.Width            = 90;
                    column.DefaultCellStyle = amountCellStyle;
                }
                column.Name = idx.ToString();
            }
            grid.AllowUserToAddRows    = false;
            grid.AllowUserToDeleteRows = false;
            AdjustTestGridSize(grid);
        }
        private void DoRankingDB()
        {
            this.myValueType = ValueTypes.Amount;
            this.Amount2PercentDenominator = Settings.sysStockTotalCapAmt;

            resultTab.TabPages.Clear();
            StringCollection stockCodeList = codeListLb.myValues;
            StringCollection timeRangeList = timeRangeLb.myCheckedValues;

            string[] strategyList = common.system.Collection2List(strategyClb.myCheckedValues);
            progressBar.Value = 0; progressBar.Minimum = 0; progressBar.Maximum = stockCodeList.Count * timeRangeList.Count;

            EstimateOptions estimateOption = new EstimateOptions();

            for (int stockCodeId = 0; stockCodeId < stockCodeList.Count; stockCodeId++)
            {
                string    stockCode      = stockCodeList[stockCodeId].ToString();
                DataTable testRetsultTbl = CreateDataTable(timeRangeList, strategyList);
                common.controls.baseDataGridView resultGrid = CreateResultGrid(stockCode, testRetsultTbl);

                for (int colId = 0; colId < timeRangeList.Count; colId++)
                {
                    try
                    {
                        progressBar.Value++;
                        Application.DoEvents();
                        this.ShowReccount(progressBar.Value.ToString() + "/" + progressBar.Maximum.ToString());

                        AppTypes.TimeRanges      timeRange    = AppTypes.TimeRangeFromCode(timeRangeList[colId]);
                        application.AnalysisData analysisData = new application.AnalysisData(timeRange, timeScaleCb.myValue, stockCode,
                                                                                             commonClass.DataAccessMode.WebService);
                        for (int rowId = 0; rowId < strategyList.Length; rowId++)
                        {
                            testRetsultTbl.Rows[rowId][colId + 1] = 0;
                            //Analysis cached data so we MUST clear cache to ensure the system run correctly
                            application.Strategy.Data.ClearCache();
                            application.Strategy.Data.TradePoints advices = application.Strategy.Libs.Analysis(analysisData, strategyList[rowId]);
                            if (advices != null)
                            {
                                testRetsultTbl.Rows[rowId][colId + 1] =
                                    application.Strategy.Libs.EstimateTrading_Profit(analysisData, application.Strategy.Libs.ToTradePointInfo(advices), estimateOption);
                            }
                        }
                    }
                    catch (Exception er)
                    {
                        this.WriteError(stockCodeList[stockCodeId] + " : " + timeRangeList[colId] + " : " + strategyList[colId], er.Message);
                        //this.ShowError(er);
                    }
                }
            }
        }
        private void allProfitDetailMenu_Click(object sender, EventArgs e)
        {
            try
            {
                using (new DataAccess.PleaseWait())
                {
                    common.controls.baseDataGridView resultDataGrid = this.CurrentDataGridView;
                    if (resultDataGrid == null)
                    {
                        return;
                    }

                    string stockCode = resultTab.SelectedTab.Name;
                    data.tmpDS.stockCodeRow stockCodeRow = DataAccess.Libs.myStockCodeTbl.FindBycode(stockCode);
                    if (stockCodeRow == null)
                    {
                        return;
                    }

                    if (resultDataGrid.SelectedRows.Count > 0)
                    {
                        for (int rowId = 0; rowId < resultDataGrid.SelectedRows.Count; rowId++)
                        {
                            application.Strategy.Meta meta = application.Strategy.Libs.FindMetaByName(resultDataGrid.SelectedRows[rowId].Cells[0].Value.ToString());
                            for (int idx = 1; idx < resultDataGrid.ColumnCount; idx++)
                            {
                                AppTypes.TimeRanges timeRange = AppTypes.TimeRangeFromCode(resultDataGrid.Columns[idx].DataPropertyName);
                                ShowTradeTransactions(stockCodeRow, meta.Code, timeRange, timeScaleCb.myValue);
                            }
                        }
                    }
                    else
                    {
                        if (resultDataGrid.CurrentRow != null)
                        {
                            application.Strategy.Meta meta = application.Strategy.Libs.FindMetaByName(resultDataGrid.CurrentRow.Cells[0].Value.ToString());
                            for (int idx = 1; idx < resultDataGrid.ColumnCount; idx++)
                            {
                                AppTypes.TimeRanges timeRange = AppTypes.TimeRangeFromCode(resultDataGrid.Columns[idx].DataPropertyName);
                                ShowTradeTransactions(stockCodeRow, meta.Code, timeRange, timeScaleCb.myValue);
                            }
                        }
                    }
                }
            }
            catch (Exception er)
            {
                this.ShowError(er);
            }
        }
Example #9
0
        private common.controls.baseDataGridView CreateResultGrid(string stockCode, DataTable testRetsultTbl)
        {
            common.controls.baseDataGridView dataGridView = new common.controls.baseDataGridView();
            resultTab.TabPages.Add(stockCode, stockCode);
            TabPage page = resultTab.TabPages[stockCode];

            page.Controls.Add(dataGridView);
            dataGridView.Location = new Point(0, 0);
            dataGridView.Size     = new Size(page.Width, page.Height);
            dataGridView.Anchor   = AnchorStyles.Bottom | AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right;
            dataGridView.ReadOnly = true;
            SetDataGrid(dataGridView, testRetsultTbl);
            CreateContextMenu(dataGridView);
            return(dataGridView);
        }
Example #10
0
        private void profitEstimateMenu_Click(object sender, EventArgs e)
        {
            try
            {
                common.controls.baseDataGridView resultDataGrid = this.CurrentDataGridView;
                if (resultDataGrid == null)
                {
                    return;
                }

                string stockCode    = resultTab.SelectedTab.Name;
                string strategyCode = "";
                data.baseDS.stockCodeRow stockCodeRow = application.dataLibs.FindAndCache(myDataSet.stockCode, stockCode);
                if (stockCodeRow == null)
                {
                    return;
                }

                if (resultDataGrid.SelectedRows.Count > 0)
                {
                    for (int rowId = 0; rowId < resultDataGrid.SelectedRows.Count; rowId++)
                    {
                        strategyCode = resultDataGrid.SelectedRows[rowId].Cells[0].Value.ToString();
                        for (int idx = 1; idx < resultDataGrid.ColumnCount; idx++)
                        {
                            AppTypes.TimeRanges timeRange = AppTypes.TimeRangeFromCode(resultDataGrid.Columns[idx].DataPropertyName);
                            ShowTradeTransactions(stockCodeRow, strategyCode, timeRange, cbTimeScale.myValue);
                        }
                    }
                }
                else
                {
                    if (resultDataGrid.CurrentRow != null)
                    {
                        strategyCode = resultDataGrid.CurrentRow.Cells[0].Value.ToString();
                        for (int idx = 1; idx < resultDataGrid.ColumnCount; idx++)
                        {
                            AppTypes.TimeRanges timeRange = AppTypes.TimeRangeFromCode(resultDataGrid.Columns[idx].DataPropertyName);
                            ShowTradeTransactions(stockCodeRow, strategyCode, timeRange, cbTimeScale.myValue);
                        }
                    }
                }
            }
            catch (Exception er)
            {
                this.ShowError(er);
            }
        }
Example #11
0
        private void CreateContextMenu(common.controls.baseDataGridView gridView)
        {
            ContextMenuStrip contextMenuStrip = new ContextMenuStrip();
            ToolStripItem    menuItem;

            menuItem        = contextMenuStrip.Items.Add(openMenuItem.Text);
            menuItem.Click += new System.EventHandler(openMenuItem_Click);

            menuItem        = contextMenuStrip.Items.Add(profitEstimateMenu.Text);
            menuItem.Click += new System.EventHandler(profitEstimateMenu_Click);

            //menuItem = contextMenuStrip.Items.Add(addToWatchListMenuItem.Text);
            //menuItem.Click += new System.EventHandler(addToWatchListMenuItem_Click);

            gridView.ContextMenuStrip = contextMenuStrip;
        }
Example #12
0
        private void Percent2Amount(common.controls.baseDataGridView dataGrid)
        {
            DataTable dataTbl = (DataTable)dataGrid.DataSource;
            decimal   val     = 0;

            for (int rowId = 0; rowId < dataTbl.Rows.Count; rowId++)
            {
                for (int colId = 1; colId < dataTbl.Columns.Count; colId++)
                {
                    if (!decimal.TryParse(dataTbl.Rows[rowId][colId].ToString(), out val))
                    {
                        continue;
                    }
                    dataTbl.Rows[rowId][colId] = (val * this.Amount2PercentDenominator) / 100;
                }
            }
        }
Example #13
0
        private void Percent2Amount(common.controls.baseDataGridView dataGrid)
        {
            DataTable dataTbl = (DataTable)dataGrid.DataSource;
            decimal   val     = 0;

            for (int rowId = 0; rowId < dataTbl.Rows.Count; rowId++)
            {
                for (int colId = 1; colId < dataTbl.Columns.Count; colId++)
                {
                    if (!decimal.TryParse(dataTbl.Rows[rowId][colId].ToString(), out val))
                    {
                        continue;
                    }
                    dataTbl.Rows[rowId][colId] = (val * this.Amount2PercentDenominator) / 100;
                }
            }
            dataGrid.DefaultCellStyle.Format = "N" + common.system.GetPrecisionFromMask(Settings.sysMaskLocalAmt);
        }
Example #14
0
        private void DoRanking()
        {
            this.myValueType = ValueTypes.Amount;
            this.Amount2PercentDenominator = application.Settings.sysStockTotalCapAmt;

            resultTab.TabPages.Clear();
            StringCollection stockCodeList = stockCodeSelectLb.myValues;
            StringCollection strategyList  = strategyClb.myCheckedValues;
            StringCollection timeRangeList = timeRangeLb.myCheckedValues;

            progressBar.Value = 0; progressBar.Minimum = 0; progressBar.Maximum = stockCodeList.Count * timeRangeList.Count;
            for (int stockCodeId = 0; stockCodeId < stockCodeList.Count; stockCodeId++)
            {
                string    stockCode      = stockCodeList[stockCodeId].ToString();
                DataTable testRetsultTbl = CreateDataTable(timeRangeList, strategyList);
                common.controls.baseDataGridView resultGrid = CreateResultGrid(stockCode, testRetsultTbl);

                for (int colId = 0; colId < timeRangeList.Count; colId++)
                {
                    AppTypes.TimeRanges timeRange = AppTypes.TimeRangeFromCode(timeRangeList[colId]);
                    decimal             profit    = 0;

                    application.Data analysisData = new application.Data(timeRange, cbTimeScale.myValue, stockCode);
                    for (int rowId = 0; rowId < strategyList.Count; rowId++)
                    {
                        profit = 0;
                        //Analysis cached data so we MUST clear cache to ensure the system run correctly
                        Strategy.Data.ClearCache();
                        Strategy.TradePoints advices = Strategy.Libs.Analysis(analysisData, strategyList[rowId]);
                        if (advices != null)
                        {
                            myTmpDS.tradeEstimate.Clear();
                            Strategy.Libs.EstimateTrading(analysisData, advices, new Strategy.Libs.EstimateOptions(), myTmpDS.tradeEstimate);
                            profit = (myTmpDS.tradeEstimate.Count == 0 ? 0 : profit = myTmpDS.tradeEstimate[myTmpDS.tradeEstimate.Count - 1].profit);
                        }
                        testRetsultTbl.Rows[rowId][colId + 1] = profit;
                    }
                    progressBar.Value++;
                    Application.DoEvents();
                }
            }
            FormResize();
        }
Example #15
0
        private void profitDetailMenu_Click(object sender, EventArgs e)
        {
            try
            {
                common.controls.baseDataGridView resultDataGrid = this.CurrentDataGridView;
                if (resultDataGrid == null || resultDataGrid.CurrentRow == null || resultDataGrid.CurrentCell == null)
                {
                    return;
                }

                //TUAN - 29 Sept 2012 fix bug profit detail and all profit details
                if (resultDataGrid.CurrentCell.ColumnIndex < 0)
                {
                    return;
                }
                //TUAN - 29 Sept 2012 fix bug profit detail and all profit details

                string stockCode = resultTab.SelectedTab.Name;
                databases.tmpDS.stockCodeRow stockCodeRow = DataAccess.Libs.myStockCodeTbl.FindBycode(stockCode);
                if (stockCodeRow == null)
                {
                    return;
                }
                application.Strategy.StrategyMeta meta = application.Strategy.StrategyLibs.FindMetaByName(resultDataGrid.CurrentRow.Cells[0].Value.ToString());

                //TUAN - 29 Sept 2012 fix bug profit detail and all profit details
                int colId = resultDataGrid.CurrentCell.ColumnIndex == 0 ? 1 : resultDataGrid.CurrentCell.ColumnIndex;
                //TUAN - 29 Sept 2012 fix bug profit detail and all profit details
                DataParams dataParam = new DataParams(timeScaleCb.myValue.Code, AppTypes.TimeRangeFromCode(resultDataGrid.Columns[colId].DataPropertyName), 0);
                ShowTradeTransactions(stockCodeRow, meta.Code, dataParam);
            }
            catch (Exception er)
            {
                this.ShowError(er);
            }
        }
Example #16
0
        private void openMenuItem_Click(object sender, EventArgs e)
        {
            try
            {
                string stockCode = resultTab.SelectedTab.Name;

                if (this.CurrentDataGridView == null)
                {
                    return;
                }
                AppTypes.TimeRanges timeRange = AppTypes.TimeRanges.All;
                common.controls.baseDataGridView resultDataGrid = this.CurrentDataGridView;
                if (resultDataGrid.CurrentCell != null && resultDataGrid.CurrentCell.ColumnIndex > 0)
                {
                    int colId = resultDataGrid.CurrentCell.ColumnIndex;
                    timeRange = AppTypes.TimeRangeFromCode(resultDataGrid.Columns[colId].DataPropertyName);
                }
                ShowStock(stockCode, timeRange, timeScaleCb.myValue);
            }
            catch (Exception er)
            {
                this.ShowError(er);
            }
        }
Example #17
0
        private void Amount2Percent(common.controls.baseDataGridView dataGrid)
        {
            DataTable dataTbl = (DataTable)dataGrid.DataSource;

            dataGrid.DefaultCellStyle.Format             = "p3";
            dataGrid.DefaultCellStyle.SelectionForeColor = Color.Yellow;

            decimal val = 0;

            for (int rowId = 0; rowId < dataTbl.Rows.Count; rowId++)
            {
                for (int colId = 1; colId < dataTbl.Columns.Count; colId++)
                {
                    if (!decimal.TryParse(dataTbl.Rows[rowId][colId].ToString(), out val))
                    {
                        continue;
                    }
                    dataTbl.Rows[rowId][colId] = (val / this.Amount2PercentDenominator) * 100;
                }
            }

            //Test them
            //dataGrid.CellFormatting=
        }
Example #18
0
 private common.controls.baseDataGridView CreateResultGrid(string stockCode, DataTable testRetsultTbl)
 {
     common.controls.baseDataGridView dataGridView = new common.controls.baseDataGridView();
     resultTab.TabPages.Add(stockCode, stockCode);
     TabPage page = resultTab.TabPages[stockCode];
     page.Controls.Add(dataGridView);
     dataGridView.Location = new Point(0,0);
     dataGridView.Size = new Size(page.Width, page.Height);
     dataGridView.Anchor = AnchorStyles.Bottom | AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right;
     dataGridView.ReadOnly = true;
     SetDataGrid(dataGridView, testRetsultTbl);
     CreateContextMenu(dataGridView);
     return dataGridView;
 }
Example #19
0
        private void allProfitDetailMenu_Click(object sender, EventArgs e)
        {
            try
            {
                using (new DataAccess.PleaseWait())
                {
                    common.controls.baseDataGridView resultDataGrid = this.CurrentDataGridView;
                    if (resultDataGrid == null)
                    {
                        return;
                    }

                    string stockCode = resultTab.SelectedTab.Name;
                    databases.tmpDS.stockCodeRow stockCodeRow = DataAccess.Libs.myStockCodeTbl.FindBycode(stockCode);
                    if (stockCodeRow == null)
                    {
                        return;
                    }

                    DataParams dataParam = new DataParams(timeScaleCb.myValue.Code, AppTypes.TimeRanges.None, 0);
                    //TUAN - 29 Sept 2012 fix bug profit detail and all profit details
                    int min = int.MaxValue;
                    int max = -1;
                    for (int i = 0; i < resultDataGrid.SelectedCells.Count; i++)
                    {
                        if (resultDataGrid.SelectedCells[i].RowIndex > max)
                        {
                            max = resultDataGrid.SelectedCells[i].RowIndex;
                        }
                        if (resultDataGrid.SelectedCells[i].RowIndex < min)
                        {
                            min = resultDataGrid.SelectedCells[i].RowIndex;
                        }
                    }
                    //if (resultDataGrid.SelectedRows.Count > 0)
                    if (min < max)
                    {
                        for (int rowId = min; rowId <= max; rowId++)
                        {
                            application.Strategy.StrategyMeta meta = application.Strategy.StrategyLibs.FindMetaByName(resultDataGrid.Rows[rowId].Cells[0].Value.ToString());
                            for (int idx = 1; idx < resultDataGrid.ColumnCount; idx++)
                            {
                                dataParam.TimeRange = AppTypes.TimeRangeFromCode(resultDataGrid.Columns[idx].DataPropertyName);
                                ShowTradeTransactions(stockCodeRow, meta.Code, dataParam);
                            }
                        }
                        //for (int rowId = 0; rowId < resultDataGrid.SelectedRows.Count; rowId++)
                        //{
                        //    application.Strategy.StrategyMeta meta = application.Strategy.StrategyLibs.FindMetaByName(resultDataGrid.SelectedRows[rowId].Cells[0].Value.ToString());
                        //    for (int idx = 1; idx < resultDataGrid.ColumnCount; idx++)
                        //    {
                        //        dataParam.TimeRange = AppTypes.TimeRangeFromCode(resultDataGrid.Columns[idx].DataPropertyName);
                        //        ShowTradeTransactions(stockCodeRow, meta.Code, dataParam);
                        //    }
                        //}
                    }
                    //TUAN - 29 Sept 2012 fix bug profit detail and all profit details
                    else
                    {
                        if (resultDataGrid.CurrentRow != null)
                        {
                            application.Strategy.StrategyMeta meta = application.Strategy.StrategyLibs.FindMetaByName(resultDataGrid.CurrentRow.Cells[0].Value.ToString());
                            for (int idx = 1; idx < resultDataGrid.ColumnCount; idx++)
                            {
                                dataParam.TimeRange = AppTypes.TimeRangeFromCode(resultDataGrid.Columns[idx].DataPropertyName);
                                ShowTradeTransactions(stockCodeRow, meta.Code, dataParam);
                            }
                        }
                    }
                }
            }
            catch (Exception er)
            {
                this.ShowError(er);
            }
        }