Beispiel #1
0
        public static string GetMarketLink(string platform, string exchange, string market, string mainMarket)
        {
            string result = "#";

            if (platform.Equals("TradingView"))
            {
                result = "https://www.tradingview.com/chart/?symbol=" + exchange.ToUpper() + ":";

                string pairName = SystemHelper.StripBadCode(market, Constants.WhiteListMinimal);

                if (pairName.StartsWith(mainMarket))
                {
                    pairName = pairName.Replace(mainMarket, "") + mainMarket;
                }

                result += pairName;
            }
            else if (platform.Equals("TradingViewFutures"))
            {
                result = "https://www.tradingview.com/chart/?symbol=";

                string pairName = SystemHelper.StripBadCode(market, Constants.WhiteListMinimal);

                if (pairName.StartsWith(mainMarket))
                {
                    pairName = pairName.Replace(mainMarket, "") + mainMarket;
                }

                result += pairName + "PERP";
            }
            else
            {
                switch (exchange)
                {
                case "Bittrex":
                    result = "https://bittrex.com/Market/Index?MarketName=" + market;
                    break;

                case "Binance":
                    result = "https://www.binance.com/trade.html?symbol=" + market;
                    break;

                case "BinanceUS":
                    result = "https://www.binance.us/trade.html?symbol=" + market;
                    break;

                case "BinanceFutures":
                    result = "https://www.binance.com/en/futures/" + market;
                    break;

                case "Poloniex":
                    result = "https://poloniex.com/exchange#" + market.ToLower();
                    break;
                }
            }

            return(result);
        }
Beispiel #2
0
        public static string GetTradingViewSymbol(string exchange, string market, string mainMarket)
        {
            string result = exchange.ToUpper() + ":";

            string pairName = SystemHelper.StripBadCode(market, Constants.WhiteListMinimal);

            if (pairName.StartsWith(mainMarket))
            {
                pairName = pairName.Replace(mainMarket, "") + mainMarket;
            }

            result += pairName;


            return(result);
        }
Beispiel #3
0
        public static string GetTradingViewSymbol(string exchange, string market, string mainMarket)
        {
            string result = exchange.ToUpper() + ":";

            string pairName = SystemHelper.StripBadCode(market, Constants.WhiteListMinimal);

            if (pairName.StartsWith(mainMarket))
            {
                pairName = pairName.Replace(mainMarket, "") + mainMarket;
            }

            if (exchange.Equals("binancefutures", StringComparison.InvariantCultureIgnoreCase))
            {
                result = "BINANCE:" + pairName + "PERP";
            }
            else
            {
                result += pairName;
            }



            return(result);
        }