freedomfromfiat / elonbot

Trading bot that uses Elon Musk`s tweets to know when to buy cryptocurrency.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Elonbot

Trading bot that uses Elon Musk`s tweets to know when to buy cryptocurrency. Here is how it works:

  1. Subscribes to someone's (elonmusk?) tweets
  2. Automatically detects mentions of DOGE or other crypto in the image(or text) Elon's tweet
  3. Buys crypto on Binance
  4. Sells it after --auto-sell-delay seconds

Installation

git clone http://github.com/vslaykovsky/elonbot
pip install python-binance google-cloud-vision unidecode

Running

  1. Set up Twitter access keys.
    • Go to developer.twitter.com to create your developer account
    • Generate a bearer token
    • Set up an environment variable with the bearer token: export TWITTER_BEARER_TOKEN=<YOUR BEARER TOKEN>
  2. Set up Binance access keys.
    • Go to Binance and create a trader account if you don't have it yet
    • Go to API management page and copy your API key and secret
    • Export both keys: export BINANCE_KEY=<your API key>; export BINANCE_SECRET=<your secret key>
  3. [Optional] Add image text recognition support with Google OCR
    • Use the following documentation to access Google Vision API
    • Export path to your google vision configuration: export GOOGLE_APPLICATION_CREDENTIALS=/path/to/your/google_vision_credentials.json
  4. Run elonbot.py

Here are some examples of how to run Elonbot.

With image text recognition:

python elonbot.py --user=elonmusk --margin-type=cross_margin  --crypto-rules='{"doge": "DOGE", "btc|bitcoin": "BTC"}' --auto-sell-delay=600  --order-size=max  --use-image-signal

No image text recognition

python elonbot.py --user=elonmusk --margin-type=cross_margin  --crypto-rules='{"doge": "DOGE", "btc|bitcoin": "BTC"}' --auto-sell-delay=600 --order-size=max

Dry run (only prints debug output, no orders are executed)

python elonbot.py --user=elonmusk --margin-type=cross_margin  --crypto-rules='{"doge": "DOGE", "btc|bitcoin": "BTC"}'  --auto-sell-delay=60 --order-size=max --dry-run

About

Trading bot that uses Elon Musk`s tweets to know when to buy cryptocurrency.


Languages

Language:Python 100.0%