Giter Site home page Giter Site logo

cryptoprinter's Introduction

๐Ÿš€ Crypto Trading Bot with Robinhood and OpenAI ๐Ÿค–

This bot uses the Robinhood API to trade cryptocurrencies based on advice from OpenAI's GPT-4 model. The bot can trade Bitcoin (BTC), Ethereum (ETH), Binance Coin (BNB), Ripple (XRP), and Cardano (ADA).

๐Ÿ“š Dependencies

The bot requires the following Python libraries:

  • robin_stocks
  • pyotp
  • openai
  • os
  • datetime
  • time
  • requests
  • re

๐Ÿ›  Setup

  1. Robinhood Account: You need a Robinhood account with two-factor authentication (2FA) enabled. The bot uses the Robinhood API to execute trades.

  2. OpenAI API Key: You need an OpenAI API key to use the GPT-4 model. You can get this from the OpenAI website.

  3. News API Key: You need a News API key to fetch news headlines for the cryptocurrencies. You can get this from the News API website.

  4. Environment Variables: The bot uses environment variables to store sensitive information. You should create a .env file in the same directory as your Python script and add the following variables as per .env.template:

    • ROBINHOOD_EMAIL: Your Robinhood account email.
    • ROBINHOOD_PASSWORD: Your Robinhood account password.
    • TOTP: Your Time-based One-Time Password (TOTP) for 2FA. See the TOTP section below for more details.
    • OPENAI_API_KEY: Your OpenAI API key.
    • NEWSAPI_KEY: Your News API key.

๐Ÿ•’ Time-based One-Time Password (TOTP)

The bot uses TOTP for 2FA with Robinhood. Here's how to set it up:

  1. Log into your Robinhood account and enable 2FA. When asked which 2FA app you want to use, select "other".

  2. Robinhood will present you with an alphanumeric code. This is your TOTP secret. Copy this code and set it as the TOTP environment variable in your .env file.

  3. Run the following Python code to generate a TOTP:

    import pyotp
    totp = pyotp.TOTP("YourTOTPSecretHere").now()
    print("Current OTP:", totp)

    Replace "YourTOTPSecretHere" with your TOTP secret. The code will print a 6-digit OTP.

  4. Enter this OTP into the prompt on your Robinhood app. Robinhood will give you a backup code. Do not lose this code or you may be locked out of your account!

  5. You can also enter your TOTP secret into a 2FA app on your phone, such as Google Authenticator. This will generate the same OTPs as your Python code, which is useful if you need to access your Robinhood account from your phone.

๐Ÿƒโ€โ™€๏ธ Running the Bot

To run the bot, simply run the Python script. The bot will start trading cryptocurrencies based on advice from the GPT-4 model. The bot will execute a trade every 30 minutes.

โš ๏ธ Disclaimer

This bot is for educational purposes only. Use it at your own risk. Cryptocurrency trading involves financial risk, and you should only trade with money you can afford to lose.

Please leave a star on this repo! โค๏ธ

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.