public ActionResult CurrencyDetail(int symbol)
        {
            var response = MCAPI.Get <JObject>("ticker/" + symbol);
            var tickers  = MCAPI.GetSysmbolData(response);

            if (symbol == 1)
            {
                var response_trade = Bitfinex.GetTicklers("candles/trade:1M:tBTCUSD/hist");
                JsonSerializerSettings _jsonSetting = new JsonSerializerSettings()
                {
                    NullValueHandling = NullValueHandling.Ignore
                };
                ViewBag.DataPoints          = JsonConvert.SerializeObject(response_trade.ListChartParameters.ToList(), _jsonSetting);
                tickers.ListChartParameters = response_trade.ListChartParameters;
            }
            else if (symbol == 1027)
            {
                var response_trade = Bitfinex.GetTicklers("candles/trade:1M:tETHUSD/hist");
                JsonSerializerSettings _jsonSetting = new JsonSerializerSettings()
                {
                    NullValueHandling = NullValueHandling.Ignore
                };
                ViewBag.DataPoints          = JsonConvert.SerializeObject(response_trade.ListChartParameters.ToList(), _jsonSetting);
                tickers.ListChartParameters = response_trade.ListChartParameters;
            }

            return(View(tickers));
        }
        public ActionResult CalculatePrice(string sourceId, string destinationSymbol)
        {
            var        symbols    = MCAPI.Get <ValueConversion>($"ticker/{sourceId}/?convert={destinationSymbol}", destinationSymbol);
            JsonResult jsonResult = new JsonResult();

            jsonResult.Data = symbols.data;
            jsonResult.JsonRequestBehavior = JsonRequestBehavior.AllowGet;
            return(jsonResult);
        }
        //string apiKey = "HKNIeFFUSCIfca2F5B2GA56UqLkBIIYJ7o01JNerIJz6XT8s1k0Mqg2c2PXdn842";
        //string secretKey = "ynM4OWcqRitNkmcs0gOaU1X5Z4jcxkhSgpzc0G3bGYrzCBsfoaP2xg9I9tgyY5Gu";

        public ActionResult Index()
        {
            DashboardModel model    = new DashboardModel();
            var            response = MCAPI.Get <JObject>("ticker/?limit=6");
            var            tickers  = MCAPI.GetData(response);

            model.tickersList = tickers;
            var symbols = MCAPI.Get <Symbols>("listings/");

            Session["TotalCurrency"] = symbols.metadata.num_cryptocurrencies;

            model.SymbolsList = symbols;
            return(View(model));
        }
        public ActionResult _ChartTable(int sym, string selectedval)
        {
            var response       = MCAPI.Get <JObject>("ticker/" + 1);
            var symbol         = "";
            var tickers        = MCAPI.GetSysmbolData(response);
            var response_trade = new Ticklers();

            if (sym == 1)
            {
                symbol = "tBTCUSD";
            }
            else if (sym == 2)
            {
                symbol = "tETHUSD";
            }

            if (selectedval == "1Min")
            {
                response_trade = Bitfinex.GetTicklers("candles/trade:" + 1 + "m:" + symbol + "/hist");
            }

            else if (selectedval == "1Hour")
            {
                response_trade = Bitfinex.GetTicklers("candles/trade:" + 1 + "h:" + symbol + "/hist");
            }
            else if (selectedval == "1Day")
            {
                response_trade = Bitfinex.GetTicklers("candles/trade:" + 1 + "D:" + symbol + "/hist");
            }
            else if (selectedval == "7Days")
            {
                response_trade = Bitfinex.GetTicklers("candles/trade:" + 7 + "D:" + symbol + "/hist");
            }
            else if (selectedval == "14Days")
            {
                response_trade = Bitfinex.GetTicklers("candles/trade:" + 14 + "D:" + symbol + "/hist");
            }
            else if (selectedval == "1Month")
            {
                response_trade = Bitfinex.GetTicklers("candles/trade:" + 1 + "M:" + symbol + "/hist");
            }
            JsonSerializerSettings _jsonSetting = new JsonSerializerSettings()
            {
                NullValueHandling = NullValueHandling.Ignore
            };

            ViewBag.DataPoints = JsonConvert.SerializeObject(response_trade.ListChartParameters.ToList(), _jsonSetting);
            return(PartialView(tickers));
        }
        public ActionResult _HistoricalTable(string drpdownval, int sym = 1)
        {
            var response       = MCAPI.Get <JObject>("ticker/" + 1);
            var symbol         = "";
            var tickers        = MCAPI.GetSysmbolData(response);
            var response_trade = new Ticklers();

            if (sym == 1)
            {
                symbol = "tBTCUSD";
            }
            else if (sym == 2)
            {
                symbol = "tETHUSD";
            }


            if (drpdownval == "1 Min")
            {
                response_trade = Bitfinex.GetTicklers("candles/trade:" + 1 + "m:" + symbol + "/hist");
            }

            else if (drpdownval == "1 Hour")
            {
                response_trade = Bitfinex.GetTicklers("candles/trade:" + 1 + "h:" + symbol + "/hist");
            }

            else if (drpdownval == "30 Days")
            {
                response_trade = Bitfinex.GetTicklers("candles/trade:" + 1 + "M:" + symbol + "/hist");
            }
            else if (drpdownval == "7 Days")
            {
                response_trade = Bitfinex.GetTicklers("candles/trade:" + 7 + "D:" + symbol + "/hist");
            }
            else if (drpdownval == "1 Day")
            {
                response_trade = Bitfinex.GetTicklers("candles/trade:" + 1 + "D:" + symbol + "/hist");
            }
            else if (drpdownval == "14 Days")
            {
                response_trade = Bitfinex.GetTicklers("candles/trade:" + 14 + "D:" + symbol + "/hist");
            }

            tickers.ListChartParameters = response_trade.ListChartParameters;
            return(PartialView(tickers));
        }
        public ActionResult CurrencyList()
        {
            List <Ticklers> parentTickers = new List <Ticklers>();
            var             response      = MCAPI.Get <JObject>("ticker/?limit=100");
            var             tickers       = MCAPI.GetData(response);
            double          currencyTotal = 0.00;

            if (Session["TotalCurrency"] == null)
            {
                var symbols = MCAPI.Get <Symbols>("listings/");
                currencyTotal = symbols.metadata.num_cryptocurrencies;
            }
            else
            {
                currencyTotal = Convert.ToInt32(Session["TotalCurrency"]);
            }
            parentTickers.AddRange(tickers);

            double remaining   = currencyTotal / 100;
            int    intPart     = Convert.ToInt32(remaining);
            double decimalPart = remaining - intPart;

            if (decimalPart > 0)
            {
                intPart++;
            }
            int start = 101;

            for (int i = 1; i < intPart; i++)
            {
                response = MCAPI.Get <JObject>($"/ticker/?start={start}&limit=100");
                tickers  = MCAPI.GetData(response);
                parentTickers.AddRange(tickers);
                start = start + 100;
            }
            return(View(parentTickers));
        }