C#定义结构体

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace SimulationTool
{
     struct PESSelectParam //成交记录的Key参数
    {
        DateTime strStarTime;   //开始时间
        DateTime strEndTime;       //结束时间
        string   strInvestGroupID; //投资团队ID
 
        List<string>   pstrStrategyList;     //策略名字列表
        int     nStrategyCount;       //策略名字列表大小

        List<string>   pstrSymbolList;       //品种列表
        int     nSymbolCount;         //品种列表大小
    };

     enum PES_TRADE_TYPE     //交易类型枚举
    {
        TRADE_TYPE_LONGPOS  = 0 ,     //多头
        TRADE_TYPE_SHORTPOS           //空头
    };

     struct PESTradeRecord //成交记录
    {
        string   strInvestGroupID; //投资团队ID
        string   strStrategyName;  //策略名字
        string   strSymbol;        //商品名称

        PES_TRADE_TYPE    enTradeType;//交易类型
        DateTime   strOpenPosTime; //建仓时间,精确到秒,格式:20130529102059
        float    fOpenPosPrice;        //建仓价格
        DateTime strClosePosTime; //平仓时间,精确到秒,格式:20130529102059
        float   fClosePosPrice;       //平仓价格
        int     nPosNumber;           //数量
        float   fTradeCost;           //交易成本
        float   fNetProfit;           //净利润
        float   fAccumuNetProfit;     //累计净利润
        float   fReturnRate;          //收益率
        float   fAccumuReturnRate;    //累计收益率
        int     nBarCount;            //持仓周期数
    };

}


 

posted @ 2013-05-30 21:39  Predator  阅读(289)  评论(0编辑  收藏  举报