/tradingapp

A trading app to buy and sell stocks using AI

Primary LanguageJavaScript

AI Trading App

Contributors Forks Stargazers Issues

About

Welcome to the AI Trading App!

It can connect to Alpaca to get positions and orders, sell and buy stocks.

  • You can import collaborative trading strategies
  • Currently implementing sentiment analysis strategy

Credit for UI: OktarianTB

Update: trailing orders removed

Stack

Backend: NodeJS with Python Scripts, AI: ChatGPT (collaborative strategy feature), Claude & Vertex (AI Fund feature)

Frontend: React, Material 5

Data: MongoDB

Devops: Github, Vercel, Render, Google Cloud Build, Gitguardian

Product Management: Notion

Project Management: Jira

Hackathons

Friday, May 26 2023 - 6:00 PM Anthropic AI Hackathon Build AI Apps with leading AI models! Submitted project

Friday, July 7 2023 - 6:00 PM Google Cloud Vertex AI Hackathon Be the first to build an AI App on Google’s AI models! Submitted project

Installation

Make sure you have NodeJS installed. You can check your Node.js version by running the command node -v in your terminal. If your version is older than 14.20.1, you will need to update Node.js. Please make sure that node -v gives you a version after 14.20.1 before doing anything else.

go to the server folder

cd server

Then install the required packages for the server with:

npm install

go to the client folder

cd ..
cd client

Install the required packages for the client with:

npm install

Then you have to set up the .env files for the server and the client: Go to the different services, create accounts and get the API keys

here /tradingapp/server/config/ you have an example file. Rename it .env and change the keys with yours

there /tradingapp/client/ you have an example file. Rename it .env and change the keys with yours

Please make sure you have created a .env in the server AND in the client or it will not work

To use Vertex you will need to create /tradingapp/server/config/googlecredentials.json with your google credentials

Then you can start the server and the client

Go to the client folder

And run the client with:

npm run start

Open another terminal window and then run the server with:

Go to the server folder

npm run start

Code explanation: Video

Deployment

The front is optimized to be deployed on Vercel. Don't forget to add env variables.

The back is optimized to be deployed on Render. Don't forget to add env variables.

Usage

You can edit you API keys in Settings

To buy stocks you can go in Search, search for a stock and buy

You can sell from the dashboard clicking on stocks ticker

You can implement a collaborative strategy that you found online in Strategies, copy paste it and add a name for the strategy. It will buy the stocks. This create a strategy portfolio that will show up on the dashboard

You can switch from paper trading to live trading in Config/Alpaca.js changing the apiurl

To do

Improve the AI Fund Strategy: better news quality, better sentiment analysis

Implement transaction cost displays to evaluate strategy profitability is crucial

Implement other AI trading strategies

Implement crypto using Alpaca

Implement other brokers: deGiro

Fix bugs: currently a blocking bug on the collaborative strategy feature

Links

Discord: Discord