INNER CODE UNIT · Python

to

liamhartley/cryptotradingbot · trading_strategies/coinbase_cmo_trading_strategy/app/app.py:12

    Function to parse the get_accounts output to find the balance for a given ticker
    :param ticker: the ticker for the cryptocurrency that you want the balnace for e.g. BTC
    :return:
    '''

    all_accounts = coinbase_wrapper.get_accounts()

    response = None
    for account in all_accounts:
        if account['currency'] == ticker:
            response = account

    assert response is not None
    return response


def close_positions(coinbase_wrapper, pair, rate, amount):
    '''

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…