예제 #1
0
        public MockupExchangeClient(string apiKey, string secretKey) : base(apiKey = "apiKey", secretKey = "secretKey")
        {
            _prices = File.ReadAllLines("BacktestData.csv")
                      .Skip(1)
                      .Select(v => HistoricalData.FromCsv(v))
                      .Reverse()
                      .ToList();

            Portfolio.UpdateCoinBalance("USDT", 20000m);
        }
예제 #2
0
        public static HistoricalData FromCsv(string csvLine)
        {
            string[] values = csvLine.Split(',');

            HistoricalData data = new HistoricalData();

            data.Date  = values[0];
            data.Open  = Convert.ToDecimal(values[2]);
            data.High  = Convert.ToDecimal(values[3]);
            data.Low   = Convert.ToDecimal(values[4]);
            data.Close = Convert.ToDecimal(values[5]);

            return(data);
        }