Home

Awesome

Auto-GPT-AlpacaTrader

AutoGPT plugin for Alpaca trader alpaca Trader

Alpaca Trading API provides the following key features:

Trade Execution: Users can place, modify, and cancel orders for stocks and ETFs programmatically, with support for various order types, such as market, limit, and stop orders.

Account Management: Users can access their account information, including balances, positions, and portfolio history.

Market Data: Alpaca Trading API offers both historical and real-time market data, including stock quotes, trades, and bar data (OHLCV). It also provides access to data on corporate actions, such as dividends and stock splits.

Paper Trading: Alpaca offers a paper trading environment, allowing users to test their trading strategies and algorithms without risking real money. The paper trading API has the same interface as the live trading API, making it easy to switch between the two.

To use the Alpaca Trading API, you need to sign up for an account at Alpaca (https://alpaca.markets/) and generate an API key. Alt Text

Please note that while Alpaca's trading services are commission-free, they may still be subject to various fees and regulations, such as SEC and FINRA fees. You should also be aware of the risks associated with algorithmic trading and ensure compliance with all applicable laws and regulations.

Note I am not liable for any financial loss due to the plugin. Feel free to use paper trading mode as much as you want if you plan on really using this, this is at your own financial risk. I would atleast recommend GPT-4.

Plugin Installation Steps

for Linux, depending on distro

sudo apt-get install zip
apk add zip
sudo pacman -S zip
sudo yum install zip

Mac / Linux / WSL

cd plugins && git clone https://github.com/danikhan632/Auto-GPT-AlpacaTrader-Plugin.git && zip -r ./Auto-GPT-AlpacaTrader-Plugin.zip ./Auto-GPT-AlpacaTrader-Plugin && rm -rf ./Auto-GPT-AlpacaTrader-Plugin && cd .. && ./run.sh --install-plugin-deps

Windows, Powershell

cd plugins; git clone https://github.com/danikhan632/Auto-GPT-AlpacaTrader-Plugin.git; Compress-Archive -Path .\Auto-GPT-AlpacaTrader-Plugin -DestinationPath .\Auto-GPT-AlpacaTrader-Plugin.zip; Remove-Item -Recurse -Force .\Auto-GPT-AlpacaTrader-Plugin; cd ..
  1. Allowlist the plugin (optional): Add the plugin's class name to the ALLOWLISTED_PLUGINS in the .env file to avoid being prompted with a warning when loading the plugin:

    ALLOWLISTED_PLUGINS=AutoGPTAlpacaTraderPlugin
    APCA_API_KEY_ID=your_api_key
    APCA_API_SECRET_KEY=your_api_secret_key
    APCA_PAPER=True
    APCA_SAFE=True 
    

    default for APCA_PAPER is True default for APCA_SAFE is True which restricts stocks that can be traded

    If the plugin is not allowlisted, you will be warned before it's loaded.

    If you have not added the plugin to allowlisted or APCA_IS_PAPER=True in the .env file, you will have to generate a Paper account API key on the Alpaca.

    Decent startup config, for ai_settings.yaml

    ai_goals:
    





Credit where credit is due to [isaiahbjork](https://github.com/isaiahbjork/Auto-GPT-MetaTrader-Plugin/) this is meant to be pretty similar to his just using the
Alpaca Trading platform