//获取指数成分股列表
        public void backtestByIndexCode(string index, DateTime startDate, DateTime endDate)
        {
            allStockDic = getStockInfoList(index, endDate, endDate);
            foreach (var item in allStockDic)
            {
                var      stock      = item.Value;
                DateTime stockStart = startDate;
                DateTime stockEnd   = endDate;
                if (stockStart < stock.IPODate)
                {
                    stockStart = stock.IPODate.AddDays(10);
                }
                if (stockEnd > stock.DelistDate)
                {
                    stockEnd = stock.DelistDate;
                }
                //dataPrepare(stock.code, stockStart, stockEnd);
                backtest(stock.code, stockStart, stockEnd);
            }
            var    dt      = DataTableExtension.ToDataTable(transactionData);
            var    codeStr = index.Split('.');
            string name    = string.Format("E:\\result\\grabCeiling\\{0}.csv", codeStr[0]);

            DataTableExtension.SaveCSV(dt, name);
        }
        public void backtest(DateTime startDate, DateTime endDate)
        {
            dataPrepare(startDate, endDate);
            this.transactionData = new List <OneByOneTransaction>();
            foreach (var day in tradedays)
            {
                foreach (var info in bondInfo)
                {
                    if (day.Date >= info.startDate.Date && day.Date <= info.endDate.Date)
                    {
                        //var record = computeDailyWithRecordByMinute(day, info.code, info.stockCode, 0.01);
                        var record = computeDailyWithRecordByTick(day, info.code, info.stockCode, 0.03);
                        if (record.Count > 0)
                        {
                            this.transactionData.AddRange(record);
                        }
                    }
                }
            }
            var    dt     = DataTableExtension.ToDataTable(transactionData);
            var    nowStr = DateTime.Now.ToString("yyyyMMddhhmm");
            string name   = string.Format("E:\\result\\bond\\convertibleBond{0}.csv", nowStr);

            DataTableExtension.SaveCSV(dt, name);
        }
Exemplo n.º 3
0
    public override void ParseDataRow(string dataRowText)
    {
        string[] text  = DataTableExtension.SplitDataRow(dataRowText);
        int      index = 0;

        index++;
        Id          = int.Parse(text[index++]);
        AssetName   = text[index++];
        Name        = text[index++];
        MoveSpeed   = float.Parse(text[index++]);
        RotateSpeed = float.Parse(text[index++]);
        Atk         = int.Parse(text[index++]);
        AtkAnimTime = float.Parse(text[index++]);
        AtkRange    = float.Parse(text[index++]);
        Def         = int.Parse(text[index++]);
        AtkSpeed    = float.Parse(text[index++]);
        HP          = int.Parse(text[index++]);
        MP          = int.Parse(text[index++]);
        ParseWeapon(text[index++]);
        HPAbsorbPercent       = float.Parse(text[index++]);
        DefAbsorbPercent      = float.Parse(text[index++]);
        AtkAbsorbPercent      = float.Parse(text[index++]);
        AtkSpeedAbsorbPercent = float.Parse(text[index++]);
        HPMinAbsorb           = int.Parse(text[index++]);
        DefMinAbsorb          = int.Parse(text[index++]);
        AtkMinAbsorb          = int.Parse(text[index++]);
        AtkSpeedMinAbsorb     = float.Parse(text[index++]);
    }
Exemplo n.º 4
0
        //获取指数成分股列表
        public void backtestByIndexCode(string index, DateTime startDate, DateTime endDate)
        {
            this.index = index;
            dataPrepareAll(index, startDate, endDate);
            allStockDic = getStockInfoList(index, endDate, endDate);

            int num = 0;

            foreach (var item in allStockDic)
            {
                var      stock      = item.Value;
                DateTime stockStart = startDate;
                DateTime stockEnd   = endDate;
                if (stockStart < stock.IPODate)
                {
                    stockStart = stock.IPODate.AddDays(10);
                }
                //backtestOpposite(stock.code, stockStart, stockEnd);
                backtestOpposite2(stock.code, stockStart, stockEnd);
                num += 1;
                Console.WriteLine("完成 {0} of {1}!", num, allStockDic.Count());
            }
            //存入交易信息
            var    dt      = DataTableExtension.ToDataTable(transactionData);
            var    codeStr = index.Split('.');
            var    now     = DateTime.Now.ToString("yyyyMMddhhmm");
            string name    = string.Format("E:\\result\\grabCeiling\\{0}_{1}.csv", codeStr[0], now);

            DataTableExtension.SaveCSV(dt, name);
        }
        public void backtestAllStock(DateTime startDate, DateTime endDate)
        {
            allStockDic = getAllstockInfo(endDate, endDate);
            foreach (var item in allStockDic)
            {
                var      stock      = item.Value;
                DateTime stockStart = startDate;
                DateTime stockEnd   = endDate;
                if (stockStart < stock.IPODate)
                {
                    stockStart = stock.IPODate;
                }
                if (stockEnd > stock.DelistDate)
                {
                    stockEnd = stock.DelistDate;
                }
                //dataPrepare(stock.code, stockStart, stockEnd);
                backtest(stock.code, stockStart, stockEnd);
            }
            var    dt      = DataTableExtension.ToDataTable(transactionData);
            var    codeStr = "all";
            string name    = string.Format("E:\\result\\grabCeiling\\{0}.csv", codeStr);

            DataTableExtension.SaveCSV(dt, name);
        }
Exemplo n.º 6
0
        private void btnFind_Click(object sender, EventArgs e)
        {
            DataTable            dt = DataTableExtension.ToDataTable <TendencyModel>(this.Tendency.Lt_Tendencys);
            List <TendencyModel> lt = getList(dt, getFilterExpression());

            count = lt.Count;
            find(lt);
        }
Exemplo n.º 7
0
    public void ParseDataRow(string dataRowText)
    {
        string[] text  = DataTableExtension.SplitDataRow(dataRowText);
        int      index = 0;

        index++;
        Id = int.Parse(text[index++]);
        index++; // 备注列
        AssetName = text[index++];
    }
Exemplo n.º 8
0
        private void FormTendency_Load(object sender, EventArgs e)
        {
            DataTable dt = DataTableExtension.ToDataTable <TendencyType>(lt_Tt);

            this.comboBox1.DataSource    = dt;
            this.comboBox1.ValueMember   = "EnName";
            this.comboBox1.DisplayMember = "ChName";

            initUnit();
        }
        private List <string> getCodeListFromLocalFile(string filePath = "D:\\BTP\\LocalDataBase\\dailyFactors\\000905_SH.CSV")
        {
            List <string> codeList = new List <string>();
            var           dt       = DataTableExtension.CSVToDatatable(filePath);

            foreach (DataRow dr in dt.Rows)
            {
                string code = Convert.ToString(dr["wind_code"]);
                codeList.Add(code);
            }
            return(codeList);
        }
Exemplo n.º 10
0
    public void ParseDataRow(string dataRowText)
    {
        string[] text  = DataTableExtension.SplitDataRowOld(dataRowText);
        int      index = 0;

        index++;
        Id = int.Parse(text[index++]);
        index++;
        AssetName = text[index++];
        Priority  = int.Parse(text[index++]);
        Volume    = float.Parse(text[index++]);
    }
Exemplo n.º 11
0
        private void FormTendency_Load(object sender, EventArgs e)
        {
            DataTable dt = DataTableExtension.ToDataTable <TendencyType>(lt_Tt);

            this.cbType.DataSource    = dt;
            this.cbType.ValueMember   = "EnName";
            this.cbType.DisplayMember = "ChName";

            this.comboBox1.SelectedIndex = 2;
            find(this.Tendency.Lt_Tendencys);
            this.cbCompare.SelectedIndex = 0;
        }
Exemplo n.º 12
0
    public void ParseDataRow(string dataRowText)
    {
        string[] text  = DataTableExtension.SplitDataRow(dataRowText);
        int      index = 0;

        index++;
        Id = int.Parse(text[index++]);
        index++;
        AssetName          = text[index++];
        GroupName          = text[index++];
        AllowMultiInstance = bool.Parse(text[index++]);
        PauseCoveredUIForm = bool.Parse(text[index++]);
    }
Exemplo n.º 13
0
        private void FormTendency_Load(object sender, EventArgs e)
        {
            DataTable dt = DataTableExtension.ToDataTable <TendencyType>(lt_Tt);

            this.comboBox1.DataSource    = dt;
            this.comboBox1.ValueMember   = "EnName";
            this.comboBox1.DisplayMember = "ChName";

            this.radioButton1.Checked    = true;
            this.comboBox2.SelectedIndex = 0;

            this.rtbBigSmall.Checked = true;
            initUnit();
        }
        public void backtest(string underlyingCode, DateTime startDate, DateTime endDate)
        {
            this.RangeDic        = new Dictionary <int, Dictionary <DateTime, double> >();
            this.underlyingAll   = new List <StockTransaction>();
            this.underlyingKLine = new Dictionary <DateTime, List <StockTransaction> >();
            dataPrepare(underlyingCode, startDate, endDate);
            //训练集训练参数
            int    maxN      = 0;
            double maxK1     = 0;
            double maxK2     = 0;
            double maxSharpe = -10;

            for (int n = 2; n <= 6; n++)
            {
                for (double k1 = 0; k1 <= 2; k1 = k1 + 0.2)
                {
                    for (double k2 = 0; k2 <= 2; k2 = k2 + 0.2)
                    {
                        double sharpe = getParametersSharpe(startDate, endDate, n, k1, k2, loss);
                        if (sharpe > maxSharpe)
                        {
                            maxN      = n;
                            maxK1     = k1;
                            maxK2     = k2;
                            maxSharpe = sharpe;
                            //Console.WriteLine("rating:{0}, n:{1}, k1:{2}, k2:{3}", maxSharpe, maxN, maxK1, maxK2);
                        }
                        //Console.WriteLine("rating:{0}, n:{1}, k1:{2}, k2:{3}", sharpe, n, k1, k2);
                    }
                }
            }
            Console.WriteLine("code:{4}, rating:{0}, n:{1}, k1:{2}, k2:{3}", maxSharpe, maxN, maxK1, maxK2, underlyingCode);
            if (maxSharpe > -10)
            {
                var yield = getYieldList(startDate, endDate, maxN, maxK1, maxK2, loss);
                yield = getYieldList(startDate, endDate, maxN, maxK1, maxK2, loss);
                double nv = 1;
                for (int i = 0; i < yield.Count(); i++)
                {
                    nv = nv * (yield[i] + 1);
                }
                Console.WriteLine(nv);
                this.transactionData = getTransactionData(startDate, endDate, maxN, maxK1, maxK2, loss);
                var    dt      = DataTableExtension.ToDataTable(transactionData);
                var    codeStr = underlyingCode.Split('.');
                string name    = string.Format("E:\\result\\DualTrust\\{0}.csv", codeStr[0]);
                DataTableExtension.SaveCSV(dt, name);
            }
        }
        private List <string> getIndexStocksFromWind(DateTime date, string index)
        {
            var           rawData  = windReader.GetDataSetTable("sectorconstituent", string.Format("date={0};windcode={1}", date.Date, index));
            List <string> codeList = new List <string>();

            foreach (DataRow dr in rawData.Rows)
            {
                codeList.Add(Convert.ToString(dr[1]));
            }
            var    indexStr = index.Split('.');
            string name     = string.Format("D:\\BTP\\LocalDataBase\\dailyFactors\\{0}_{1}.csv", indexStr[0], indexStr[1]);

            DataTableExtension.SaveCSV(rawData, name);
            return(codeList);
        }
Exemplo n.º 16
0
    public void ParseDataRow(string dataRowText)
    {
        string[] text  = DataTableExtension.SplitDataRow(dataRowText);
        int      index = 0;

        index++;
        Id = int.Parse(text[index++]);
        index++;
        AssetName    = text[index++];
        Priority     = int.Parse(text[index++]);
        Loop         = bool.Parse(text[index++]);
        Volume       = float.Parse(text[index++]);
        SpatialBlend = float.Parse(text[index++]);
        MaxDistance  = float.Parse(text[index++]);
    }
Exemplo n.º 17
0
    /// <summary>
    /// 将要解析的数据表文本分割为数据表行文本。
    /// </summary>
    /// <param name="text">要解析的数据表文本。</param>
    /// <returns>数据表行文本。</returns>
    public override string[] SplitToDataRows(string text)
    {
        List <string> texts = new List <string>();

        string[] rowTexts = DataTableExtension.SplitDataTable(text);
        for (int i = 0; i < rowTexts.Length; i++)
        {
            if (!string.IsNullOrEmpty(rowTexts[i]))
            {
                texts.Add(rowTexts[i]);
            }
        }

        return(texts.ToArray());
    }
        private List <indexStockInfo> getDocumentFromFtp(string index)
        {
            FtpHelper             ftp  = new FtpHelper("192.168.38.213", "index", "dfzq1234");
            List <indexStockInfo> list = new List <indexStockInfo>();

            string[] indexStr = index.Split('.');
            string   todayStr = date.Year.ToString();
            string   filename = getFileName(index, date, "weightnextday", "xls");
            string   original = "\\hs300\\" + filename;
            string   target   = "E:\\result\\stockBonusEstimate\\" + filename;

            ftp.Download(original, target);
            var set = DataTableExtension.getDataSetFromXLS(target);

            foreach (DataTable dt in set.Tables)
            {
                int num = 0;
                foreach (DataRow dr in dt.Rows)
                {
                    num = num + 1;
                    //去除表头
                    if (num <= 1)
                    {
                        continue;
                    }
                    indexStockInfo info    = new indexStockInfo();
                    string         code    = Convert.ToString(dr[4]);
                    string         market  = Convert.ToString(dr[7]);
                    string         secName = Convert.ToString(dr[5]);
                    if (market == "Shanghai")
                    {
                        code = code + ".SH";
                    }
                    else
                    {
                        code = code + ".SZ";
                    }
                    double close  = Convert.ToDouble(dr[12]);
                    double weight = Convert.ToDouble(dr[16]);
                    info.code    = code;
                    info.secName = secName;
                    info.close   = close;
                    info.weight  = weight;
                    list.Add(info);
                }
            }
            return(list);
        }
Exemplo n.º 19
0
 /// <summary>
 /// 取得组织信息
 /// </summary>
 private string GetOrg(HttpContext context)
 {
     try
     {
         OrganizationBLL          bll     = new OrganizationBLL();
         IList <OrganizationInfo> orgList = bll.GetOrgList();
         DataTable dt   = DataTableExtension.ToDataTable <OrganizationInfo>(orgList);
         string    Id   = context.Request.Form["id"];
         string    text = context.Request.Form["text"];
         return(EasyUIJsonConvert.GetComboBoxJson(dt, Id, text));
     }
     catch (Exception ex)
     {
         DBManager.RecoreErrorProfile(ex, "RuleDesignHandler.GetOrganization", DBManager.GetCurrentUserAD());
         return("Fail");
     }
 }
Exemplo n.º 20
0
 private string GetOrgUsers(HttpContext context)
 {
     try
     {
         UserProfileBLL          bll      = new UserProfileBLL();
         IList <UserProfileInfo> userInfo = bll.GetAllUserProfile("");
         DataTable dt   = DataTableExtension.ToDataTable <UserProfileInfo>(userInfo);
         string    Id   = context.Request.Form["id"];
         string    text = context.Request.Form["text"];
         return(EasyUIJsonConvert.GetComboBoxJson(dt, Id, text));
     }
     catch (Exception ex)
     {
         DBManager.RecoreErrorProfile(ex, "RuleDesignHandler.GetOrgUsers", DBManager.GetCurrentUserAD());
         return("Fail");
     }
 }
Exemplo n.º 21
0
 /// <summary>
 /// 取得流程信息
 /// </summary>
 /// <returns></returns>
 private string GetProcess(HttpContext context)
 {
     try
     {
         ProcessTypeBLL          bll      = new ProcessTypeBLL();
         IList <ProcessTypeInfo> procList = bll.GetProcessType();
         DataTable dt   = DataTableExtension.ToDataTable <ProcessTypeInfo>(procList);
         string    Id   = context.Request.Form["id"];
         string    text = context.Request.Form["text"];
         return(EasyUIJsonConvert.GetComboBoxJson(dt, Id, text));
     }
     catch (Exception ex)
     {
         DBManager.RecoreErrorProfile(ex, "RuleDesignHandler.GetProcess", DBManager.GetCurrentUserAD());
         return("Fail");
     }
 }
Exemplo n.º 22
0
        public void backtest(string underlyingCode, DateTime startDate, DateTime endDate)
        {
            dataPrepare(underlyingCode, startDate, endDate);
            //训练集训练参数
            int    maxN      = 0;
            double maxK1     = 0;
            double maxK2     = 0;
            double maxSharpe = -1000;

            for (int n = 2; n <= 10; n++)
            {
                for (double k1 = 0.2; k1 < 1; k1 = k1 + 0.2)
                {
                    for (double k2 = 0.2; k2 < 1; k2 = k2 + 0.2)
                    {
                        double sharpe = getParametersPerformance(startDate, endDate, n, k1, k2, 0.01);
                        if (sharpe > maxSharpe)
                        {
                            maxN      = n;
                            maxK1     = k1;
                            maxK2     = k2;
                            maxSharpe = sharpe;
                            Console.WriteLine("score:{0}, n:{1}, k1:{2}, k2:{3}", maxSharpe, maxN, maxK1, maxK2);
                        }
                    }
                }
            }
            Console.WriteLine("score:{0}, n:{1}, k1:{2}, k2:{3}", maxSharpe, maxN, maxK1, maxK2, 0.01);
            var yield = getYieldList(startDate, endDate, maxN, maxK1, maxK2);

            yield = getYieldList(startDate, endDate, maxN, maxK1, maxK2);
            double nv = 1;

            for (int i = 0; i < yield.Count(); i++)
            {
                nv = nv * (yield[i] + 1);
            }
            Console.WriteLine(nv);
            this.transactionData = getTransactionData(startDate, endDate, maxN, maxK1, maxK2, 0.01);
            var    dt      = DataTableExtension.ToDataTable(transactionData);
            var    codeStr = underlyingCode.Split('.');
            string name    = string.Format("E:\\result\\stockVol2\\{0}.csv", codeStr[0]);

            DataTableExtension.SaveCSV(dt, name);
        }
Exemplo n.º 23
0
    public void ParseDataRow(string dataRowText)
    {
        string[] text  = DataTableExtension.SplitDataRow(dataRowText);
        int      index = 0;

        index++;
        Id = int.Parse(text[index++]);
        index++; // 跳过备注列
        Name          = text[index++];
        AssetName     = text[index++];
        Attack        = int.Parse(text[index++]);
        BulletId      = int.Parse(text[index++]);
        BulletSpeed   = float.Parse(text[index++]);
        AtkSpeed      = float.Parse(text[index++]);
        BulletSoundId = int.Parse(text[index++]);
        AttackType    = int.Parse(text[index++]);
        CostMP        = int.Parse(text[index++]);
    }
Exemplo n.º 24
0
    public virtual void ParseDataRow(string dataRowText)
    {
        string[] text  = DataTableExtension.SplitDataRow(dataRowText);
        int      index = 0;

        index++;
        Id            = int.Parse(text[index++]);
        AssetName     = text[index++];
        Name          = text[index++];
        StartTime     = float.Parse(text[index++]);
        Interval      = float.Parse(text[index++]);
        Probability   = int.Parse(text[index++]);
        PerNum        = int.Parse(text[index++]);
        MaxNum        = int.Parse(text[index++]);
        MonsterTypeId = int.Parse(text[index++]);
        MonsterPrize  = int.Parse(text[index++]);
        PowerPercent  = float.Parse(text[index++]);
    }
Exemplo n.º 25
0
    public override void ParseDataRow(string dataRowText)
    {
        string[] text  = DataTableExtension.SplitDataRow(dataRowText);
        int      index = 0;

        index++;
        Id        = int.Parse(text[index++]);
        AssetName = text[index++];
        Name      = text[index++];
        LV        = int.Parse(text[index++]);
        exp       = int.Parse(text[index++]);
        HP        = int.Parse(text[index++]);
        MP        = int.Parse(text[index++]);
        S         = int.Parse(text[index++]);
        A         = int.Parse(text[index++]);
        D         = int.Parse(text[index++]);
        I         = int.Parse(text[index++]);
        M         = int.Parse(text[index++]);
        C         = int.Parse(text[index++]);
        L         = int.Parse(text[index++]);

        Atk                = int.Parse(text[index++]);
        Def                = int.Parse(text[index++]);
        MagicAtk           = int.Parse(text[index++]);
        MagicDef           = int.Parse(text[index++]);
        AtkSpeed           = float.Parse(text[index++]);
        Crit               = int.Parse(text[index++]);
        CritDamage         = int.Parse(text[index++]);
        Hit                = int.Parse(text[index++]);
        Agl                = int.Parse(text[index++]);
        Counter            = int.Parse(text[index++]);
        Double             = int.Parse(text[index++]);
        HPRecoverPerSecond = int.Parse(text[index++]);
        MPRecoverPerSecond = int.Parse(text[index++]);

        BloodLine  = text[index++];
        Profession = text[index++];
        MP_STYLE   = text[index++];

        ParseWeapon(text[index++]);
        ParseJob(text[index++]);
        ParseSkill(text[index++]);
        ParseFeature(text[index++]);
    }
        private List <double> getNetValueDaily(List <StockTransaction> etf, double[] netvalue)
        {
            List <double>        nv  = new List <double>();
            List <netvalueDaily> nv2 = new List <netvalueDaily>();

            for (int i = 0; i < netvalue.Length; i++)
            {
                if (etf[i].DateTime.TimeOfDay == new TimeSpan(14, 59, 00))
                {
                    nv.Add(netvalue[i]);
                    var nvtoday = new netvalueDaily();
                    nvtoday.date     = etf[i].DateTime.Date;
                    nvtoday.netvalue = netvalue[i];
                    nv2.Add(nvtoday);
                }
            }
            DataTableExtension.SaveCSV(DataTableExtension.ToDataTable <netvalueDaily>(nv2), "E:\\result\\td\\netvalue.csv");
            return(nv);
        }
Exemplo n.º 27
0
    public void ParseDataRow(string dataRowText)
    {
        string[] text  = DataTableExtension.SplitDataRow(dataRowText);
        int      index = 0;

        index++;
        Id                    = int.Parse(text[index++]);
        AssetName             = text[index++];
        Delay                 = float.Parse(text[index++]);
        AddHPPercent          = float.Parse(text[index++]);
        AddHP                 = int.Parse(text[index++]);
        AddAtk                = int.Parse(text[index++]);
        AddGold               = int.Parse(text[index++]);
        CreateCloneHeroTypeID = int.Parse(text[index++]);
        ParticleTypeID        = int.Parse(text[index++]);

        // 读取坐标
        string[] pos = text[index++].Split('|');
        Position = new Vector3(float.Parse(pos[0]), float.Parse(pos[1]), float.Parse(pos[2]));
    }
        private void storeResults(List <StockBonusEstimate> list, string index)
        {
            var dt = DataTableExtension.ToDataTable(list);

            dt.Columns["code"].ColumnName              = "代码";
            dt.Columns["secName"].ColumnName           = "股票";
            dt.Columns["dividend"].ColumnName          = "分红利息";
            dt.Columns["dividendDate"].ColumnName      = "分红时间";
            dt.Columns["shareRegisterDate"].ColumnName = "股权登记日";
            dt.Columns["points"].ColumnName            = "分红点数";
            dt.Columns["status"].ColumnName            = "备注";
            string filename  = getFileName(index, date, "bonus", "csv");
            string nameStr   = string.Format("E:\\result\\stockBonusEstimate\\{0}", filename);
            string remoteStr = "\\IndexBonus\\" + filename;;

            DataTableExtension.SaveCSV(dt, nameStr);
            FileInfo  file = new FileInfo(nameStr);
            FtpHelper ftp  = new FtpHelper("192.168.38.213", "index", "dfzq1234");

            ftp.Upload(file, remoteStr);
        }
Exemplo n.º 29
0
        private DataTable GetDataSource()
        {
            object datasource = null;

            if (variable is ActionArrayVariable)
            {
                datasource = DataTableExtension.ConvertListToDataTable(variable.Name, (List <string>)variable.Data);
            }
            else if (variable is ActionTableVariable)
            {
                datasource = variable.Data;
            }
            else if (variable is ActionAttributeObject)
            {
                var data = ((ActionAttributeObject)variable).Data;
                if (data != null)
                {
                    datasource = ((AutoRobo.DataMapping.DataMap)data).ToDataTable();
                }
            }
            return(datasource as DataTable);
        }
Exemplo n.º 30
0
        private void statisticDataOfTransaction(List <OneByOneTransaction> data, List <DateTime> tradeDays)
        {
            Dictionary <DateTime, double> dailyCount = new Dictionary <DateTime, double>();
            List <double> yield    = new List <double>();
            List <double> maintain = new List <double>();

            foreach (var day in tradeDays)
            {
                dailyCount.Add(day.Date, 0);
            }
            foreach (var item in data)
            {
                var today = item.openTime.Date;
                if (dailyCount.ContainsKey(today))
                {
                    dailyCount[today] += 1;
                }
                else
                {
                    dailyCount.Add(today, 1);
                }
                double r = (item.closePrice - item.openPrice) / item.openPrice * item.position;
                yield.Add(r);
                double time = (item.closeTime - item.openTime).TotalMinutes;
                if (item.openTime.TimeOfDay < new TimeSpan(13, 00, 00) && item.closeTime.TimeOfDay >= new TimeSpan(13, 00, 00))
                {
                    time = time - 90;
                }
                maintain.Add(time);
            }
            var counts = dailyCount.Values.ToList();

            ListToCSV.SaveDataToCSVFile <double>(yield, ListToCSV.CreateFile("E:\\result\\break\\", "yield"), "yield");
            ListToCSV.SaveDataToCSVFile <double>(counts, ListToCSV.CreateFile("E:\\result\\break\\", "counts"), "counts");
            ListToCSV.SaveDataToCSVFile <double>(maintain, ListToCSV.CreateFile("E:\\result\\break\\", "maintain"), "maintain");
            var dt = DataTableExtension.ToDataTable <OneByOneTransaction>(data);

            DataTableExtension.SaveCSV(dt, "E:\\result\\break\\transaction.csv");
        }