Esempio n. 1
0
def unlink_telegram_confirm():
    speech = """\
    Are you sure you want to unlink your telegram account from Kryptos?
    You won't be able to receive updates from me anymore.
    """

    return ask(dedent(speech)).with_quick_reply("yes", "no")
Esempio n. 2
0
def prompt_capital_base(quote_currency):
    current_app.logger.debug(f"Setting quote currency as {quote_currency}")
    context_manager.set("strat-config-data", "quote_currency", quote_currency)
    speech = f"How much {quote_currency.upper()} would you like to allocate as the capital base?"

    exchange = context_manager.get("strat-config-data").get("exchange")
    # enqueue base_currency options
    current_app.logger.debug("enqueing for base currencies")
    task.get_available_base_currencies(exchange, quote_currency)
    return ask(speech)
Esempio n. 3
0
def welcome_message():
    user_name = build.get_first_name()
    msg = f"Hello {user_name}!"
    msg += """I’m Kryptos AI, your virtual investment assistant\
    that manages your cryptocurrency portfolio and automate\
    your cryptocurrency trading"""

    if build.get_user() is None:
        current_app.logger.info("Prompting user to login")
        msg += """\n\n \
        Before we can get started,you'll need to \
        create a free Kryptos account and authentiate with Telegram
        """
        resp = inline_keyboard(msg)
        url = os.path.join(current_app.config["FRONTEND_URL"],
                           "account/telegram")
        resp.add_button("Create an account", url=url)
        return resp

    return ask(msg)
Esempio n. 4
0
def review_config(hours):
    current_app.logger.debug(f"Setting hours as {hours}")
    context_manager.set("strat-config-data", "hours", hours)
    context = context_manager.get("strat-config-data")

    strat = context.get("existing_strategy")
    exchange = context.get("exchange").title()
    base_currency = context.get("trade_currency").upper()
    quote_currency = context.get("quote_currency").upper()
    capital_base = context.get("capital_base")
    trade_pair = f"{base_currency}_{quote_currency}".lower()

    speech = """\
        Great, does this look right?

        Strategy: {}
        Exchange: {}
        Trade Pair: {}
        Capital Base: {} ({})
        Run for: {} hours
    """.format(strat, exchange, trade_pair, capital_base, quote_currency,
               hours)

    return ask(dedent(speech)).with_quick_reply("yes", "no")
Esempio n. 5
0
def prompt_for_hours(trade_currency):
    current_app.logger.debug(f"Setting trade currency as {trade_currency}")
    context_manager.set("strat-config-data", "trade_currency", trade_currency)

    speech = "For how many hours would you like the run the strategy?"
    return ask(speech)