def trading(): real_open_orders, simulated_open_orders = get_open_orders() return render_template('trading.html', real_open_orders=real_open_orders, simulated_open_orders=simulated_open_orders, watched_symbols=get_watched_symbols(), pairs_with_status=get_currencies_with_status())
def command_market_status(_, update): try: message = "My cryptocurrencies evaluations are:" + TelegramApp.EOL + TelegramApp.EOL for currency_pair, currency_info in get_currencies_with_status().items(): message += "- {0}:{1}".format(currency_pair, TelegramApp.EOL) for exchange_name, evaluation in currency_info.items(): message += "=> {0}: {1}{2}".format(exchange_name, evaluation.name, TelegramApp.EOL) message += "{0}My current risk is: {1}".format(TelegramApp.EOL, get_risk()) update.message.reply_text(message) except Exception: update.message.reply_text("I'm unfortunately currently unable to show you my market evaluations, " + "please retry in a few seconds:")
def get_command_market_status(markdown=False): _, b, c = PrettyPrinter.get_markets(markdown) message = f"{b}My cryptocurrencies evaluations are:{b} {EOL}{EOL}" at_least_one_currency = False for currency_pair, currency_info in get_currencies_with_status().items(): at_least_one_currency = True message += f"{c}{currency_pair}:{c}{EOL}" for exchange_name, evaluation in currency_info.items(): message += f"{c}- {exchange_name}: {evaluation[0]}{c}{EOL}" if not at_least_one_currency: message += f"{c}{NO_CURRENCIES_MESSAGE}{c}{EOL}" message += f"{EOL}{c}My current risk is: {get_risk()}{c}" return message
def get_command_market_status(): message = f"My cryptocurrencies evaluations are: {EOL}{EOL}" at_least_one_currency = False for currency_pair, currency_info in get_currencies_with_status().items( ): at_least_one_currency = True message += f"- {currency_pair}:{EOL}" for exchange_name, evaluation in currency_info.items(): message += f"=> {exchange_name}: {evaluation[0]}{EOL}" if not at_least_one_currency: message += NO_CURRENCIES_MESSAGE + EOL message += f"{EOL}My current risk is: {get_risk()}" return message
def command_market_status(_, update): try: message = "My cryptocurrencies evaluations are:" + TelegramApp.EOL + TelegramApp.EOL for currency_pair, currency_info in get_currencies_with_status( ).items(): message += "- {0}:{1}".format(currency_pair, TelegramApp.EOL) for exchange_name, evaluation in currency_info.items(): message += "=> {0}: {1}{2}".format(exchange_name, evaluation.name, TelegramApp.EOL) message += "{0}My current risk is: {1}".format( TelegramApp.EOL, get_risk()) update.message.reply_text(message) except Exception: update.message.reply_text( "I'm unfortunately currently unable to show you my market evaluations, " + "please retry in a few seconds:")
def command_market_status(_, update): try: message = f"My cryptocurrencies evaluations are: {TelegramApp.EOL}{TelegramApp.EOL}" at_least_one_currency = False for currency_pair, currency_info in get_currencies_with_status( ).items(): at_least_one_currency = True message += f"- {currency_pair}:{TelegramApp.EOL}" for exchange_name, evaluation in currency_info.items(): message += f"=> {exchange_name}: {evaluation[0]}{TelegramApp.EOL}" if not at_least_one_currency: message += TelegramApp.NO_CURRENCIES_MESSAGE + TelegramApp.EOL message += f"{TelegramApp.EOL}My current risk is: {get_risk()}" update.message.reply_text(message) except Exception: update.message.reply_text( "I'm unfortunately currently unable to show you my market evaluations, " + "please retry in a few seconds.")
def market_status(): return render_template('market_status.html', pairs_with_status=get_currencies_with_status())