Beispiel #1
0
        /// <summary>
        /// 解析
        /// </summary>
        /// <param name="s"></param>
        /// <returns></returns>
        public static HoldRecord Parse(String s)
        {
            if (s == null || s.Trim() == "")
            {
                return(null);
            }

            String[] ss = s.Split('|');
            if (ss == null || ss.Length <= 0)
            {
                return(null);
            }

            HoldRecord r = new HoldRecord();

            r.code       = ss[0] == null?"":ss[0].Trim();
            r.buyDate    = DateTime.ParseExact(ss[1], "yyyyMMdd", null);
            r.amount     = int.Parse(ss[2]);
            r.expect     = double.Parse(ss[3]);
            r.parameters = insp.Utility.Bean.Properties.Parse(ss[1]);
            return(r);
        }
Beispiel #2
0
 /// <summary>
 /// 卖出
 /// </summary>
 /// <param name="holdRecord"></param>
 /// <param name="d"></param>
 /// <param name="strategyParams"></param>
 /// <returns></returns>
 public abstract TradeInfo DoSell(HoldRecord holdRecord, DateTime d, Properties strategyParams, StrategyContext context);