MCPcopy Index your code
hub / github.com/daniel-trevino/trading-bot

github.com/daniel-trevino/trading-bot @v0.3.4

Chat with this repo
repository ↗ · DeepWiki ↗ · release v0.3.4 ↗ · + Follow
49 symbols 96 edges 18 files 0 documented · 0% updated 5y ago★ 61
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Trade bot

Conventional Commits

Node.js CI

Description

Trade bot using Alpaca as a bropker

Installation

$ yarn

Running the app

# development
$ yarn start

# watch mode
$ yarn start:dev

# production mode
$ yarn start:prod

Test

# unit tests
$ yarn test

# e2e tests
$ yarn test:e2e

# test coverage
$ yarn test:cov

Get started

  • Create an account on Alpaca.markets
  • Go to paper trading on the left navigation
  • Obtain your API keys on that view.
  • Add both ALPACA_API_KEY & ALPACA_SECRET_KEY to the .env variables
  • Add the algorithm you want to try on the .env file. Example: BOT_TYPE=LONG_SHORT
  • Run the app

Environmental variables

Please have a look at .env.sample to get started

BOT_TYPE

There are two different types of algorithms

  • MEAN_REVERSION
  • LONG_SHORT

MEAN_REVERSION

This algorithm requires an additional env variable:

MEAN_REVERSION_STOCK

This variable should have the value of the name of the stock. Example Apple = AAPL

Disclaimer

This project is done to test different trading strategies in a paper trading environment. If you want to try this to do live trading do it by your own risk.

Core symbols most depended-on inside this repo

Shape

Method 30
Class 16
Enum 2
Function 1

Languages

TypeScript100%

Modules by API surface

src/alpaca/alpaca.service.ts13 symbols
src/long-short/long-short.service.ts11 symbols
src/mean-reversion/mean-reversion.service.ts6 symbols
src/bot/bot.service.ts5 symbols
src/app.controller.ts4 symbols
src/app.service.ts3 symbols
src/bot/bot.module.ts2 symbols
src/app.module.ts2 symbols
src/utils/constants.ts1 symbols
src/main.ts1 symbols
src/bot/bot.types.ts1 symbols

For agents

$ claude mcp add trading-bot \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page