rhettre / coinbase-advancedtrade-python

This is the unofficial Python client for the Coinbase Advanced Trade API. It allows users to interact with the API to manage their cryptocurrency trading activities on the Coinbase platform.
https://rhett.blog/youtube
MIT License
50 stars 22 forks source link

as a lark.... #90

Closed DrBlackross closed 3 weeks ago

DrBlackross commented 1 month ago

Tried running in python3-venv on a RPI3 (since its not a resource demanding scrypt), also if you do not use the venv it'll kick errors about gpg versions (WARNING: Error parsing dependencies of gpg: Invalid version: '1.14.0-unknown').

It kinda reminds me of gekko (and another) that i used to run a RPI zero for poloniex via solar panel for when they had lending markets in the US (almost a decade ago).

Soo installing in a venv environment works on rpi3 with running pip3 install -r requirements.txt :)

BUT, when running the scrypt via python3 ./main.py (testing DOGE-USDT only)... it kinda peters out, after running. Do i need to crontab intervals for it to run, will it maintain the F/G (Fear and Greed) index if i did? Or is the F/G index just an indicator it is pulling from a website like https://cfgi.io/doge-fear-greed-index/ ? And lastly, is it calculating F/G on the fly?

I did modify trading_config.py

        self._fgi_schedule: List[Dict[str, Any]] = [
            {'threshold': 5, 'factor': 1.7, 'action': 'buy'}, #added for testing small amount
            {'threshold': 10, 'factor': 1.5, 'action': 'buy'},

Anyway here is my main.py (minus the api's) for now (working)

client = EnhancedRESTClient(api_key=api_key, api_secret=api_secret)

balance = client.get_crypto_balance("DOGE")
balance = client.get_crypto_balance("USDT")

#Prints all product info about current Pair
#product_info = client.get_product(product_id="DOGE-USDT")

#print(product_info)

#Run Fear and Greed
client.trade_based_on_fgi("DOGE-USDT", "5")

#NOT USING THIS BELOW

# Get current FGI schedule (using stock schedule)
#current_schedule = client.get_fgi_schedule()

# Update FGI schedule
#new_schedule = [
#    {'threshold': 15, 'factor': 1.2, 'action': 'buy'},
#    {'threshold': 37, 'factor': 1.0, 'action': 'buy'},
#    {'threshold': 35, 'factor': 0.8, 'action': 'sell'},
#    {'threshold': 45, 'factor': 0.6, 'action': 'sell'}
#]
#client.update_fgi_schedule(new_schedule)

BTW, in short, yes this will run on a RPI3 lol

(.venv) drblackross@Solar-Daytrader:~/coinbase-advancedtrade-python $ python3 --version
Python 3.9.2
(.venv) drblackross@Solar-Daytrader:~/coinbase-advancedtrade-python $ pip3 --version
pip 20.3.4
DrBlackross commented 1 month ago

just decided to cron it and shift it over to MATIC-USDT

New CoinBase Trader every 1 hour

0 bash -c "/home/drblackross/coinbase-advancedtrade-python/.venv/bin/python3 ./main.py; exit"