Esempio n. 1
0
        /// <summary>
        /// 通过输入变量获取rediskey 下一步为文件记录获取目录等级和文件名
        /// </summary>
        /// <param name="redisKeyType">redis 类型</param>
        /// <param name="exchangename">交易所短名字</param>
        /// <param name="symbol">币对儿</param>
        /// <param name="timestamp">记录的起始时间点</param>
        /// <returns></returns>
        public static string GetRedisKey(RedisKeyType redisKeyType, TimePeriodType timePeriod, string exchangename, string symbol, DateTime timestamp)
        {
            DateTime t   = TimerHelper.GetStartTimeStampByPreiod(timePeriod, timestamp);
            string   str = redisKeyType + "@" + timePeriod + "@" + exchangename + "@" + symbol.ToLower() + "@" + t.ToString("yyyy.MM.dd HH:mm");

            return(str);
        }
Esempio n. 2
0
        public override string ToString()
        {
            StringBuilder sb = new StringBuilder();

            sb.Append("-------------------------------------\r\n");
            sb.Append("成交时间:" + TimerHelper.ConvertStringToDateTime(ExchangeTimeStamp).ToLocalTime().ToString() + "\r\n");
            sb.Append("交易ID:" + TradeID + "类别:" + Type.ToString() + "\r\n");
            sb.Append("价格:" + Price.ToString() + "   数量:" + Amount.ToString() + "\r\n");
            return(sb.ToString());
        }
Esempio n. 3
0
 public void UpdateTickerBuyTrade(Trade t)
 {
     Last   = t.Price;
     Volume = t.Amount;
     if (High < t.Price)
     {
         High = t.Price;
     }
     if (Low > t.Price)
     {
         Low = t.Price;
     }
     ExchangeTimeStamp    = t.ExchangeTimeStamp;
     LocalServerTimeStamp = TimerHelper.GetTimeStampMilliSeconds(DateTime.Now);
 }