public MacroSetting(string access_key, string secret_key, List <string> coinList) { apiData = new ApiData(access_key, secret_key); lastCandleUpdate.Columns.Add("week", typeof(DateTime)); lastCandleUpdate.Columns.Add("day", typeof(DateTime)); lastCandleUpdate.Columns.Add("hour4", typeof(DateTime)); lastCandleUpdate.Columns.Add("hour1", typeof(DateTime)); lastCandleUpdate.Columns.Add("min30", typeof(DateTime)); order.Columns.Add("coinName", typeof(string)); order.Columns.Add("uuid", typeof(string)); this.coinList = coinList; for (int i = 0; i < coinList.Count; i++) { lastPrice.Add(coinList[i], 0d); DataRow dataRow = lastCandleUpdate.NewRow(); dataRow["week"] = DateTime.Now.AddMonths(-1); dataRow["day"] = DateTime.Now.AddMonths(-1); dataRow["hour4"] = DateTime.Now.AddMonths(-1); dataRow["hour1"] = DateTime.Now.AddMonths(-1); dataRow["min30"] = DateTime.Now.AddMonths(-1); lastCandleUpdate.Rows.Add(dataRow); DataTable week_candle_single = new DataTable(coinList[i]); week_candle_single.Columns.Add("date", typeof(DateTime)); week_candle_single.Columns.Add("open", typeof(double)); week_candle_single.Columns.Add("close", typeof(double)); week_candle_single.Columns.Add("max", typeof(double)); week_candle_single.Columns.Add("min", typeof(double)); week_candle_single.Columns.Add("volume", typeof(double)); week_candle.Tables.Add(week_candle_single); DataTable day_candle_single = new DataTable(coinList[i]); day_candle_single.Columns.Add("date", typeof(DateTime)); day_candle_single.Columns.Add("open", typeof(double)); day_candle_single.Columns.Add("close", typeof(double)); day_candle_single.Columns.Add("max", typeof(double)); day_candle_single.Columns.Add("min", typeof(double)); day_candle_single.Columns.Add("volume", typeof(double)); day_candle.Tables.Add(day_candle_single); DataTable hour4_candle_single = new DataTable(coinList[i]); hour4_candle_single.Columns.Add("date", typeof(DateTime)); hour4_candle_single.Columns.Add("open", typeof(double)); hour4_candle_single.Columns.Add("close", typeof(double)); hour4_candle_single.Columns.Add("max", typeof(double)); hour4_candle_single.Columns.Add("min", typeof(double)); hour4_candle_single.Columns.Add("volume", typeof(double)); hour4_candle.Tables.Add(hour4_candle_single); DataTable hour1_candle_single = new DataTable(coinList[i]); hour1_candle_single.Columns.Add("date", typeof(DateTime)); hour1_candle_single.Columns.Add("open", typeof(double)); hour1_candle_single.Columns.Add("close", typeof(double)); hour1_candle_single.Columns.Add("max", typeof(double)); hour1_candle_single.Columns.Add("min", typeof(double)); hour1_candle_single.Columns.Add("volume", typeof(double)); hour1_candle.Tables.Add(hour1_candle_single); DataTable min30_candle_single = new DataTable(coinList[i]); min30_candle_single.Columns.Add("date", typeof(DateTime)); min30_candle_single.Columns.Add("open", typeof(double)); min30_candle_single.Columns.Add("close", typeof(double)); min30_candle_single.Columns.Add("max", typeof(double)); min30_candle_single.Columns.Add("min", typeof(double)); min30_candle_single.Columns.Add("volume", typeof(double)); min30_candle.Tables.Add(min30_candle_single); DataTable state_table = new DataTable(coinList[i]); state_table.Columns.Add("uuid", typeof(string)); state_table.Columns.Add("date", typeof(DateTime)); state_table.Columns.Add("unit", typeof(double)); state_table.Columns.Add("price", typeof(double)); state_table.Columns.Add("krw", typeof(double)); state.Tables.Add(state_table); } }