The same error is repeating itself.
#client object has no attribute ‘place_market_order’
2023-04-09 14:08:32,541 INFO:Attempting to purchase ACH…
2023-04-09 14:08:32,718 DEBUG:https://api.pro.coinbase.com:443 “GET /products/ACH-USD/ticker HTTP/1.1” 200 138
2023-04-09 14:08:32,721 ERROR:Failed to purchase ACH. Error message: ‘Client’ object has no attribute ‘place_market_order’
#this is in the trade_predic.py script at the bottom
for crypto in cryptos:
logging.info(f"Attempting to purchase {crypto}...")
try:
buy_price = get_current_price(crypto)
buy_amount = USD_BUDGET / buy_price
buy_order = client.place_market_order(product_id=f"{crypto}-USD", side='buy', funds=str(USD_BUDGET))
logging.info(f"Successfully purchased {buy_order['filled_size']} {crypto} at {buy_price:.2f} USD per {crypto}.")
USD_BALANCE -= USD_BUDGET
crypto_balance = float(get_account_balance(crypto)['balance'])
crypto_balance += float(buy_order['filled_size'])
update_account_balance(crypto, crypto_balance)
except Exception as e:
logging.error(f"Failed to purchase {crypto}. Error message: {e}")
time.sleep(60)
if __name__ == '__main__':
main()