Exemplo n.º 1
0
        public static TransactionPairBinary Parse(string value)
        {
            TransactionPairBinary pair = new TransactionPairBinary();

            string[] fields = value.Split(',');
            int      field  = 0;

            pair.currentPosition   = int.Parse(fields[field++]);
            pair.entryOrderId      = int.Parse(fields[field++]);
            pair.entrySerialNumber = long.Parse(fields[field++]);
            pair.entryBar          = int.Parse(fields[field++]);
            pair.entryPrice        = double.Parse(fields[field++]);
            pair.entryTime         = TimeStamp.Parse(fields[field++]).Internal;
            pair.postedEntryTime   = TimeStamp.Parse(fields[field++]).Internal;
            pair.exitOrderId       = int.Parse(fields[field++]);
            pair.exitSerialNumber  = long.Parse(fields[field++]);
            pair.exitBar           = int.Parse(fields[field++]);
            pair.exitPrice         = double.Parse(fields[field++]);
            pair.exitTime          = TimeStamp.Parse(fields[field++]).Internal;
            pair.postedExitTime    = TimeStamp.Parse(fields[field++]).Internal;
            pair.maxPrice          = double.Parse(fields[field++]);
            pair.minPrice          = double.Parse(fields[field++]);
            pair.longVolume        = int.Parse(fields[field++]);
            pair.shortVolume       = int.Parse(fields[field++]);
            return(pair);
        }
Exemplo n.º 2
0
        public static LogicalFillBinary Parse(string value)
        {
            string[] fields            = value.Split(',');
            int      field             = 0;
            var      orderId           = int.Parse(fields[field++]);
            var      orderSerialNumber = long.Parse(fields[field++]);
            var      orderPosition     = int.Parse(fields[field++]);
            var      price             = double.Parse(fields[field++]);
            var      position          = int.Parse(fields[field++]);
            var      time       = TimeStamp.Parse(fields[field++]);
            var      utcTime    = TimeStamp.Parse(fields[field++]);
            var      postedTime = TimeStamp.Parse(fields[field++]);
            var      fill       = new LogicalFillBinary(position, 0, price, time, utcTime, orderId, orderSerialNumber, orderPosition, false, false);

            fill.postedTime = postedTime;
            return(fill);
        }