示例#1
0
        private void addSummaryLine(ISheet tab_, HSSFWorkbook wb_)
        {
            HSSFCellStyle style = CellStyle.footerStyle(wb_);

            currentLine++; currentLine++;
            IRow row = tab_.CreateRow(currentLine++);

            ICell[] cells = new ICell[columeNb];

            cells[1] = row.CreateCell(1, CellType.String);
            cells[1].SetCellValue("TOTAL");
            cells[1].CellStyle = style;

            for (int i = 2; i < 6; i++)
            {
                cells[i] = row.CreateCell(i, CellType.String);
                cells[i].SetCellValue(ALGO_RESULT_COLUMES[i - 2]);
                cells[i].CellStyle = style;
            }
            cells[6] = row.CreateCell(6, CellType.String);
            cells[6].SetCellValue("Slipage Stdev");
            cells[6].CellStyle = style;

            cells[7] = row.CreateCell(7, CellType.String);
            cells[7].SetCellValue("Cancel Rate");
            cells[7].CellStyle = style;

            cells[8] = row.CreateCell(8, CellType.String);
            cells[8].SetCellValue("Fill Rate");
            cells[8].CellStyle = style;

            writeAggreagetResult(tab_, wb_);
        }
示例#2
0
        private void addFootLine(HSSFWorkbook wb_, ISheet tb, List <decimal> turnoverList_, List <decimal> slipList_, decimal turnover_,
                                 decimal cancelRate_, decimal fillRate_)
        {
            currentLine++;  // Add one blank line.

            HSSFCellStyle style = CellStyle.footerStyle(wb_);

            int  columeNb   = columeName.Length;
            IRow summaryRow = tb.CreateRow(currentLine++);

            ICell[] summaryCells = new ICell[columeNb];
            for (int j = 0; j < columeNb; j++)
            {
                summaryCells[j] = summaryRow.CreateCell(j);
                summaryCells[j].SetCellValue("");
            }

            summaryRow        = tb.CreateRow(currentLine++);
            summaryRow.Height = 500;
            summaryCells      = new ICell[columeNb];
            for (int j = 0; j < columeNb; j++)
            {
                summaryCells[j] = summaryRow.CreateCell(j);
            }

            summaryCells[0].SetCellValue("合计");
            summaryCells[0].CellStyle = style;

            summaryCells[1].SetCellValue("撤单率");
            summaryCells[1].CellStyle = style;

            summaryCells[2].SetCellValue("成交额(元)");
            summaryCells[2].CellStyle = style;

            summaryCells[3].SetCellValue("滑点差(bp)");
            summaryCells[3].CellStyle = style;

            summaryCells[4].SetCellValue("成交额加权滑点差(bp)");
            summaryCells[4].CellStyle = style;

            summaryRow        = tb.CreateRow(currentLine++);
            summaryRow.Height = 500;
            summaryCells      = new ICell[columeNb];
            for (int j = 0; j < columeNb; j++)
            {
                summaryCells[j] = summaryRow.CreateCell(j);
                if (j >= 0 && j <= 4)
                {
                    summaryCells[j].CellStyle = style;
                }
            }
            summaryCells[1].SetCellValue(NumberFormat.asPercent(MathUtil.round(cancelRate_)));
            summaryCells[2].SetCellValue(NumberFormat.toMoney(MathUtil.round(turnover_)));
            summaryCells[3].SetCellValue(MathUtil.round(MathUtil.computeAvgSlipage(slipList_)).ToString());
            summaryCells[4].SetCellValue(MathUtil.round(MathUtil.computeWeightedSlipage(slipList_, turnoverList_)).ToString());
        }
示例#3
0
        private void writeAggreagetResult(ISheet tab_, HSSFWorkbook wb_)
        {
            HSSFCellStyle style = CellStyle.footerStyle(wb_);

            IRow row = tab_.CreateRow(currentLine++);

            ICell[] cells = new ICell[columeNb];

            cells[2] = row.CreateCell(2, CellType.String);
            cells[2].SetCellValue(NumberFormat.asInt(aggregatedStatistics.getOrderCount()));
            cells[2].CellStyle = style;

            cells[3] = row.CreateCell(3, CellType.String);
            cells[3].SetCellValue(NumberFormat.asInt(aggregatedStatistics.getSliceCount()));
            cells[3].CellStyle = style;

            cells[4] = row.CreateCell(4, CellType.String);
            cells[4].SetCellValue(string.Format("{0:N}", aggregatedStatistics.getSlipage()));
            cells[4].CellStyle = style;

            cells[5] = row.CreateCell(5, CellType.String);
            cells[5].SetCellValue(string.Format("{0:N}", aggregatedStatistics.getTurnover()));
            cells[5].CellStyle = style;

            cells[6] = row.CreateCell(6, CellType.String);
            cells[6].SetCellValue(string.Format("{0:N}", aggregatedStatistics.getSlipageStdev()));
            cells[6].CellStyle = style;

            cells[7] = row.CreateCell(7, CellType.String);
            cells[7].SetCellValue(NumberFormat.asPercent(MathUtil.round(aggregatedStatistics.getCancelRate())));
            cells[7].CellStyle = style;

            cells[8] = row.CreateCell(8, CellType.String);
            cells[8].SetCellValue(NumberFormat.asPercent(MathUtil.round(aggregatedStatistics.getFillRate())));
            cells[8].CellStyle = style;
        }