Exemple #1
0
        public static Trade ToTrade(jsonTrade _Trade)
        {
            Trade tmp = new Trade {
                IsBuy     = _Trade.is_buy,
                Price     = decimal.Parse(_Trade.price, System.Globalization.NumberFormatInfo.InvariantInfo),
                Volume    = decimal.Parse(_Trade.volume, System.Globalization.NumberFormatInfo.InvariantInfo),
                Timestamp = JSON.FromEpoch(_Trade.timestamp)
            };

            return(tmp);
        }
Exemple #2
0
        public static jsonTrade FromTrade(Trade _Trade)
        {
            jsonTrade tmpTrade = new jsonTrade {
                is_buy    = _Trade.IsBuy,
                volume    = _Trade.Volume.ToString(System.Globalization.NumberFormatInfo.InvariantInfo),
                price     = _Trade.Price.ToString(System.Globalization.NumberFormatInfo.InvariantInfo),
                timestamp = JSON.ToEpoch(_Trade.Timestamp)
            };

            return(tmpTrade);
        }
Exemple #3
0
 public static Trade FromJsonTrade(jsonTrade _Trade)
 {
     return(_Trade.ToTrade());
 }