Git Product home page Git Product logo

s-brez / trading-server Goto Github PK

View Code? Open in Web Editor NEW
614.0 38.0 120.0 778 KB

Multi-asset, multi-strategy, event-driven trading platform for running low to medium freq strategies at many venues simultaneously with portfolio-based risk management and %-per-strategy capital allocation. Supports event-driven backtesting across all desired instruments, venues and strategies under a single parameterized portfolio.

License: GNU General Public License v3.0

Python 100.00%
algo-trading quantitative-trading algorithmic-trading trading trading-execution trading-bot cryptocurrency derivatives futures bitmex

trading-server's Introduction

trading-server

A multi-asset, multi-strategy, event-driven trade execution and management platform for running many algorithms/bots at many venues simultaneously, with unified risk management and reporting.

This is not a standalone trading bot. You need to install and run this on a server or VPS using your own trading algorithms.

Installation

Using python 3.9

  1. Install mongodb (https://www.mongodb.com/)
  2. Install TA-Lib python bindings (links to wheels here https://blog.quantinsti.com/install-ta-lib-python/) and binaries (https://mrjbq7.github.io/ta-lib/install.html)
  3. Set up a telegram bot, record the bot key in enviroment variable TELEGRAM_BOT_TOKEN.
  4. Create a whitelist for telegram account ID's you want to have control of the server, recorded in environment variable TELEGRAM_BOT_WHITELIST, eg [<USER_ID_1>, <USER_ID_2>]
  5. Set up accounts for all venues you will trade at, recording API keys and secret keys in environment variables <VENUE_NAME>_API_KEY and <VENUE_NAME>_API_SECRET
  6. Configure what venues, instruments, models and timeframes you want to trade in server.py and model.py.
  7. Install dependencies in requirments.txt
  8. Run the server with python server_test.py. Note it will take some time to fetch historical data for the instruments you are trading.

Current features

Trade any API-accessible market with unified multi-strategy portfolio management, autonomously or semi-autonomously.

Allocation-based risk management (allocate x% of capital to specific strategies with y% exposure per strategy).

Porfolio performance metrics and tracking. Tracks the following:

Feature library - assemble new strategies quickly from existing features.

Trade consent via Telegram (or write your own messaging client). Accept, veto or tweak trade setups before they are actioned.

WIP features

Account multicasting - trade as many accounts on as many platforms as desired.

UI - web dashboard for portfolio stats and individual trade metrics

Integration with Backtrader

Blockchain-based strategy auditing - publish trade signals to IPFS and Ethereum/BSC to empirically prove win rate over time

Accounting and compliance reporting

Venue support

Venue Integration status Instrument types
Complete Crypto derivatives
Planned Crypto spot & derivatives
IG Markets Planned FX, equity, commodity & index CFD's
Interactive Brokers Planned FX, equity, commodity & index CFD's
Deribit Planned Crypto derivatives & options

Market data

1 minute resolution OHLCV bars for all watched instruments are stored with MongoDB.

This software works with 1 minute and above resolution strategies. Tick-resolution support planned later. With this in mind, the software converts tick data to 1 min bars where live tick data is available, but doesn't store ticks locally (i.e. it handles tick data but doesnt use it as is, yet).

Strategy modellling

Individual strategy implementations are not included. A simple moving average cross model is included as an example only. Custom strategy implementations, collaboration or any other enquiries please email me at [email protected].

Collaboration

Feature requests and discussion regarding new features are very welcome, please reach out.

External libraries

TA-LIB - https://mrjbq7.github.io/ta-lib/

Backtrader - https://www.backtrader.com/

Acknowledgements

Based on architecture described by Michael Halls-Moore at QuantStart.com (qsTrader), and written works by E. Chan and M. Lopez de Prado. Thanks all.

License

GNU GPLv3

trading-server's People

Contributors

s-brez 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  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  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  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  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

trading-server's Issues

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.