def fx_prices(data):
    fx_code = get_valid_fx_code_from_user(data)
    diag_prices = dataCurrency(data)
    prices = diag_prices.get_fx_prices(fx_code)
    print(prices)

    return None
def interactive_manual_check_fx_prices():
    """
    Update FX prices stored in Arctic (Mongo) with interactive brokers prices (usually going back about a year)

    :return: Nothing
    """

    with dataBlob(log_name="Interactive-Manual-Check-FX-prices") as data:
        fx_code = get_valid_fx_code_from_user(data)

        data.log.label(currency_code=fx_code)
        check_fx_ok_for_broker(data, fx_code)

        update_manual_check_fx_prices_for_code(fx_code, data)

    return success
Example #3
0
def interactive_manual_check_fx_prices():
    """
    Update FX prices stored in Arctic (Mongo) with interactive brokers prices (usually going back about a year)

    :return: Nothing
    """

    with dataBlob(log_name="Interactive-Manual-Check-FX-prices") as data:
        do_another = True
        while do_another:
            EXIT_STR = "Finished - EXIT"
            fx_code = get_valid_fx_code_from_user(
                data, allow_none=True, none_str=EXIT_STR
            )
            if fx_code is EXIT_STR:
                do_another = False  ## belt. Also braces.
            else:
                data.log.label(currency_code=fx_code)
                check_fx_ok_for_broker(data, fx_code)
                update_manual_check_fx_prices_for_code(fx_code, data)

    return success