GithubHelp home page GithubHelp logo

mafischer / trader-bot Goto Github PK

View Code? Open in Web Editor NEW
26.0 4.0 6.0 754 KB

A stock trading bot with trade strategy plugins.

License: ISC License

JavaScript 61.16% HTML 1.56% Vue 37.28%
bot stock nyse nasdaq broker robinhood electron vue nodejs javascript plugin-architecture plugin machine-learning tensorflow p2p-etf trading-strategies trader-bot broker-api stock-trading-bot experimental

trader-bot's Introduction

Trader Bot

A stock trading bot that can automate trades based on elected trade strategies. Trade strategies are plugins that are provided out of the box, created by the end user, or provided by the community.

TL;DR

Install from here and enjoy!

Acknowledgements

  • This bot and the reverse-spit strategy were initially inspired by the work of @ReverseSplitArb, send some appreciation that way.
  • This project has been built on top of the work of other open source initiatives; for more information, please see the dependencies listed in the package.json.

Warnings

  • This software should be considered experimental!
  • You are giving this experimental software access to your stock broker(s). THERE IS POTENTIAL FOR FINANCIAL LOSS!!
  • All data is stored on your local file system in SQLite databases.
  • Your credentials will be encrypted and stored in SQLite.
  • Anonymous usage statistics may be sent over the network if you chose to allow it.

License

This software is licensed under the ISC license. See LICENSE for full details.

Usage

Installation

  • Download the installer from TO DO

Setup

Pre Requisites

  • For access to twitter data, apply for a twitter developer account
  • create an account with a supported broker (support further development by using below links to open an account):

First Run

  • Start the application.
  • You will be prompted for your broker and twitter developer credentials.
  • You will be prompted for a password to encrypt and decrypt your credentials.
  • Elect one or more trading strategies.
  • The bot will now make trades according to your elected strategitesl

Subsequent Runs

  • Start the application.
  • You will be prompted for a password to encrypt and decrypt your credentials.
  • All of your settings are persited in a local database. The application will run as previously configured.
  • Leave running, Trader Bot must be running in order to make trades.

Development

Tech Stack & Docs

Environment Setup

Windows

For easy setup, you may use chocolatey as outlined below. Otherwise, if you know what you are doing, feel free to install the below dependencies however you see fit.

# run powershell as Administrator
# install chocloatey - https://chocolatey.org/install
Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
# install NodeJS - https://nodejs.org/
choco install nodejs-lts
# install SQLite
choco install sqlite
# install git
choco install git
# install windows build tools - needed for node-gyp
choco install microsoft-build-tools
# install python 3 - needed for node-gyp
choco install python
# install python 2 - needed for node-sass
choco install python2
# install node-gyp
npm i -g node-gyp

Mac

For easy setup, you may use brew as outlined below. Otherwise, if you know what you are doing, feel free to install the below dependencies however you see fit.

# install brew - https://brew.sh/
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
# install NodeJS -https://nodejs.org/
brew install node
# install SQLite https://www.sqlite.org/index.html
brew install sqlite

Other

It is presumed that you know what you are doing.

  • Install node and sqlite

All

# clone project
git clone https://github.com/mafischer/trader-bot.git
# change directory into project
cd trader-bot
# install dependencies
npm ci
# serve application
npm run electron:serve

Further Development

Long term vision

  • This project aims to provide a consistent broker api to simplify building a trading strategy. In order for a new broker to be added, a wrapper api must be developed to normalize the broker api with what is currently available
  • Tensorflow will be added to support strategies that want to use Machine Learning.
  • A repository of plugins will allow the community to share strategies.

Contributing

  • Have a look at the issues and feel free to submit a PR
  • Submit an issue if you find a bug or have an idea to make the project better.
  • Throw me some spare change if you found this software useful.

Donations

Become a patron by clicking below:

Send a one-time donation via paypal:

paypal

trader-bot's People

Contributors

dependabot[bot] avatar mafischer avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

trader-bot's Issues

Create App Branding

  • App logo (green stock line chart trending up)
  • App splash (green stock line chart trending up)
  • Other branding assets

Add Fidelity broker

Add Fidelity broker

  • API functions should be async
  • API function names should match the robinhood api function names

Execute trades for Reverse Split Arbitrage

  • Parse tweets from RSA.
    Format:
I'm buying 1 share of $MBRX by market close on Jan 29, 2020.
  • Schedule the buy of one share of parsed stock 10 minutes prior to market close on day indicated.
  • Attempt to sale the share as soon as it becomes available

trader-bot needs to be daemonized

  • Use forever to daemonize trader-bot
  • Special consideration will need to be made to unlock the credentials when the daemon starts trader-bot
    • Use electron and open application login window at trader-bot startup.
    • Trader-bot will run in standby mode waiting for credentials to be unlocked.

Login Screen

  • A basic login screen
    • allows user to input master password for encrypting or decrypting stored credentials
    • view/input broker credentials
    • view/input twitter access tokens/secrets

Prompt user for permission

Request approval from user to execute trades below confidence threshold.

  • Display trade recommendation
  • Display reason for trade recommendation
  • Popup window requesting permission.
  • Future functionality may support remote approvals via email/twitter/companion app/etc.

Create P2P ETF Strategy

A strategy that lets a Stock ETF portfolio designer publish a custom ETF which can be subscribed to. The ETF content will be dynamic and allow subscribers to rebalance their portfolios in real-time along with the ETF designer.

The subscribing trader-bots will mirror ETF assets on allocated accounts, up to the maximum allocation cap set by the ETF consumer. Consumers can opt-out at anytime, choosing to liquidate immediately or manages the assets manually.

Activity Log Screen

  • An activity log screen
    • Shows activity that is otherwise console logged.
    • load the logs from default log file

Add Webull broker

Add Webull broker

  • API functions should be async
  • API function names should match the robinhood api function names

Select Strategies Screen

A screen that prompts user to select from available trading strategies:

  • A list labeled Available Strategies should be displayed
    • The list is populated from the trader.strategies table and excludes those strategies found in the trader.eelected_strategies table.
  • A list labeled Elected Strategies should be displayed
    • The list is populated from the trader.elected_strategies table
  • When a user selects (clicks on) a strategy
    • a description of the strategy should be displayed on screen.
    • the selected strategy should be highlighted in the list that contains it.
  • A user can move a strategy from one list to another.
    • Drag and drop
    • >> or << button moves a selected strategy to the other box
  • There should be a Cancel button
    • not enabled until after the initial setup is complete
    • the cancel button will exit the Strategies Selection screen
  • There should be an OK button
    • not enabled unless at least once strategy is added to the Elected Strategies list
    • the OK button will record the elected strategies in the trader.elected_strategies table

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.