All Projects → EliteQuant → Elitequant_cpp

EliteQuant / Elitequant_cpp

Licence: apache-2.0
C/C++ 11 High frequency quantitative trading platform. It follows modern design patterns such as event-driven, server/client architect, dependency injection and loosely-coupled robust distributed system. It is self-contained and can be used out of box. At the same time, it serves as server side for other EliteQuant projects.

Programming Languages

c
50402 projects - #5 most used programming language
cpp
1120 projects

Projects that are alternatives of or similar to Elitequant cpp

Elitequant python
Python quantitative trading and investment platform; Python3 based multi-threading, concurrent high-frequency trading platform that provides consistent backtest and live trading solutions. It follows modern design patterns such as event-driven, server/client architect, and loosely-coupled robust distributed system. It follows the same structure and performance metrix as other EliteQuant product line, which makes it easier to share with traders using other languages.
Stars: ✭ 394 (+15.54%)
Mutual labels:  trading-strategies, trading-platform, quantitative-trading, investment, backtest
Sgx Full Orderbook Tick Data Trading Strategy
Providing the solutions for high-frequency trading (HFT) strategies using data science approaches (Machine Learning) on Full Orderbook Tick Data.
Stars: ✭ 733 (+114.96%)
Mutual labels:  trading-strategies, quantitative-trading, investment
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. Uses MongoDB for storage and Telegram for user notifications/trade consent.
Stars: ✭ 191 (-43.99%)
Mutual labels:  trading-platform, quantitative-trading, backtest
Tradinggym
Trading and Backtesting environment for training reinforcement learning agent or simple rule base algo.
Stars: ✭ 813 (+138.42%)
Mutual labels:  trading-strategies, trading-platform, backtest
Xalpha
基金投资管理回测引擎
Stars: ✭ 683 (+100.29%)
Mutual labels:  quantitative-trading, investment, backtest
Quantdom
Python-based framework for backtesting trading strategies & analyzing financial markets [GUI ]
Stars: ✭ 449 (+31.67%)
Mutual labels:  trading-strategies, trading-platform, investment
Quant
Codera Quant is a Java framework for algorithmic trading strategies development, execution and backtesting via Interactive Brokers TWS API or other brokers API
Stars: ✭ 104 (-69.5%)
Mutual labels:  trading-strategies, trading-platform, quantitative-trading
Tradingstrategies
Algorithmic trading strategies
Stars: ✭ 120 (-64.81%)
Mutual labels:  trading-strategies, trading-platform, quantitative-trading
Zvt
modular quant framework.
Stars: ✭ 1,801 (+428.15%)
Mutual labels:  trading-strategies, trading-platform, quantitative-trading
Strategems.jl
Quantitative systematic trading strategy development and backtesting in Julia
Stars: ✭ 106 (-68.91%)
Mutual labels:  trading-strategies, quantitative-trading, backtest
quanttrader
Backtest and live trading in Python
Stars: ✭ 139 (-59.24%)
Mutual labels:  trading-platform, trading-strategies, quantitative-trading
Turingtrader
The Open-Source Backtesting Engine/ Market Simulator by Bertram Solutions.
Stars: ✭ 132 (-61.29%)
Mutual labels:  trading-strategies, trading-platform, quantitative-trading
AutoTrader
A Python-based development platform for automated trading systems - from backtesting to optimisation to livetrading.
Stars: ✭ 227 (-33.43%)
Mutual labels:  trading-platform, trading-strategies, quantitative-trading
LiuAlgoTrader
Framework for algorithmic trading
Stars: ✭ 514 (+50.73%)
Mutual labels:  trading-platform, trading-strategies
Devalpha Node
A stream-based approach to algorithmic trading and backtesting in Node.js
Stars: ✭ 217 (-36.36%)
Mutual labels:  trading-strategies, backtest
Blankly
🚀 💸 Easily build, backtest and deploy your algo in just a few lines of code. Trade stocks, cryptos, and forex across exchanges w/ one package.
Stars: ✭ 1,456 (+326.98%)
Mutual labels:  trading-strategies, investment
tradingview-alert-binance-trader
This trading bot listens to the TradingView alert emails on your inbox and executes trades on Binance based on the parameters set on the TD alerts.
Stars: ✭ 153 (-55.13%)
Mutual labels:  trading-platform, trading-strategies
Gekko Backtesttool
Batch backtest, import and strategy params optimalization for Gekko Trading Bot. With one command you will run any number of backtests.
Stars: ✭ 203 (-40.47%)
Mutual labels:  trading-strategies, backtest
algobox
Open Source algorithmic trading platform in Java / Python
Stars: ✭ 90 (-73.61%)
Mutual labels:  trading-platform, trading-strategies
Awesome Algorithmic Trading
A curated list of awesome algorithmic trading frameworks, libraries, software and resources
Stars: ✭ 328 (-3.81%)
Mutual labels:  trading-strategies, quantitative-trading

EliteQuant_Cpp

C/C++ High frequency quantitative trading and investment platform


Platform Introduction

EliteQuant is an open source forever free unified quant trading platform built by quant traders, for quant traders. It is dual listed on both github and gitee.

The word unified carries two features.

  • First it’s unified across backtesting and live trading. Just switch the data source to play with real money.
  • Second it’s consistent across platforms written in their native langugages. It becomes easy to communicate with peer traders on strategies, ideas, and replicate performances, sparing language details.

Related projects include

Project Summary

EliteQuant_Cpp is C/C++ 11 based multi-threading, concurrent high-frequency trading platform. It follows modern design patterns such as event-driven, server/client architect, dependency injection and loosely-coupled robust distributed system. It is self-contained and can be used out of box. At the same time, it serves as server side for other EliteQuant projects.

Participation

Please feel free to report issues, fork the branch, and create pull requests. Any kind of contributions are welcomed and appreciated. Through shared code architecture, it also helps traders using other languges.

Installation

No installation is needed, it's ready for use out of box. Just download the code and enjoy.

The easiest way is to download and uzip compiled.zip from the project root directory. Then run the program called eqsever.exe.Before you run this executable, there are a couple of config settings you need to modify. By default, the program reads config.xml from the same directory. Therefore open the config file

  1. If you want to use interactive broker, open IB trader workstation (TWS), go to its menu File/Global Configuration/API/Settings, check "Enable ActiveX and Socket Client", uncheck "Read-Only API"
  2. In the config file, change the account id to yours; IB account id usually can be found on the top right of the TWS window.
  3. If you use CTP, change your brokerage account information and ctp addresses accordingly.
  4. create folder for log_dir and data_dir respectively. The former records runtime logs, while the later saves tick data.

Interactive Brokers is the most popular broker among retail traders. A lot of retail trading platform such as quantopian, quantconnect are built to support IB. If you don't have IB account but want to try it out, they provide demo account edemo with password demouser. Just download TWS trader workstation and log in with this demo account. Note that accound id changes everytime you log on to TWS with demo account so you have to change EliteQuant config file accordingly.

CTP is the de-facto brokerage for Chinese futures market, including commodity futures and financial futures. They also offer free demo account SimNow. After registration, you will get account, password, brokerid, along with market data and trading broker address. Replace them in EliteQuant config file accordingly.

Live Demo

Development Environment

Below is the environment we are using

  • Visual Studio 2017 Community Edition on Windows
  • Qt Creator 4.5.0 Commuity

Visual C++ is a popular choice on Windows. Qt Creator builds cross-plaform Qt user interface. Other choices are CLion, CMake, etc.

Development on Ubuntu 16.04 64 bit System

You can follow below steps to install necessary third party libraries and build this project with cmake on newest 64 bit Ubuntu system. Assume you have xcode and Homebrew installed, open a command terminal and execute the following.

sudo apt-get update
sudo apt-get upgrade
sudo apt-get install aptitude git cmake 
sudo aptitude install zlib1g-dev rapidjson-dev python3-dev libboost-all-dev libsodium-dev \
                      libyaml-cpp-dev libwebsocketpp-dev libnanomsg-dev libzmq3-dev

# Download SimNow tradeapi for Linux
cd ~          # or directory of your choice 
wget http://simnow.sfit.com.cn/download/api/v6.3.5_20150803_tradeapi_linux64.tar
tar xvf v6.3.5_20150803_tradeapi_linux64.tar
cd v6.3.5_20150803_api_tradeapi_linux64/
sudo cp thostmduserapi.so /usr/lib/libthostmduserapi.so
sudo cp thosttraderapi.so /usr/lib/libthosttraderapi.so
cd ~        # or directory of your choice        
git clone https://github.com/EliteQuant/EliteQuant_Cpp.git
cd EliteQuant_Cpp/source
mkdir build
cd build
cmake ..
make -j2

# run the program
cd eqserver
cp ../../eqserver/config.yaml .
mkdir log data
./eqserver             # change config.yaml first

On Linux, you might encounter the double free or corruption (!prev) error when you terminate the eqserver by pressing Ctrl+C. One way to suppress this warning is to add MALLOC_CHECK_=0 variable to your environment.

sudo vim ~/.bashrc          # edit system config
export MALLOC_CHECK_=0      # append this to the end of the file
source ~/.bashrc            # source the configuration file into effect

Development on macOS

You can follow below steps to install necessary third party libraries and build this project with cmake on clean macOS system.

brew --version
brew update

brew install git cmake
brew install zlib1g-dev rapidjson-dev python3-dev libboost-all-dev libsodium-dev \
                      libyaml-cpp-dev libwebsocketpp-dev libnanomsg-dev libzmq3-dev

Architecture Diagram

Micro-Services

Service Protocol Port Binding
MarketData PUB 55555 Y
Brokerage PAIR 55556 Y
DataManager/BarAggregator PUB 55557 Y
TickRecording SUB 55555 N
DataBoard SUB 55555 N
ApiServer PAIR 55556 N
ApiServer SUB 55557 N
ApiServer PAIR 55558 Y

Message Protocol

Messages are sperated by character '|'. For example

  • new market order: o|account|api|client order id|MKT|AAPL STK SMART|100[|order_flag]
  • new limit order: o|account|api|client order id|LMT|AAPL STK SMART|100|170.00[|order_flag]
  • order status: s|account|api|server order id|client order id|broker order id|order status
  • fill: f|account|api|server order id|client order id|broker order id|trade id|trade time|symbol|trade price|tradesize
  • cancel: c|account|api|server order id|client order id|broker order id
  • tick message: AAPL STK SMART|time|data type|price|size|depth
  • full tick message: AAPL STK SMART|time|3|price|size|1|bid|bid size|ask|ask size|open interest|open|high|low|pre close|upper limit|lower limit

The following are message types:

  • k: tick msg
  • p: last price
  • z: last size
  • o: new order
  • c: cancel order
  • s: order status
  • n: position query
  • m: general message
  • b: bar
  • h: historical data
  • e: test message

Ticker Symbol

In EliteQuant, an instrument is identified by its full symbol, which consists of a couple fo words separated by space. The general pattern is "Local_Symbol Security_Type Exchange_Name Currency Multiplier“. For example

  • Stock: SPY STK SMART
  • Future: ESZ7 FUT GLOBEX 50
  • FX: EUR.USD CASH IDEALPRO
  • FX futures: 6BU1 FUT GLOBELX
  • Option: GOOGL_140920P00535000 OPT SMART 100
  • Futures Options: EWQ4_C1730 FOP GLOBEX 50

order status

enum OrderStatus {
		OS_NewBorn = 0,			// NewBorn
		OS_PendingSubmit = 1,
		OS_PendingCancel =2 ,
		OS_Submitted = 3,			// submitted
		OS_Acknowledged = 4,		// acknowledged
		OS_Canceled = 5,			// Canceled
		OS_Filled = 6,				// Filled
		OS_Inactive = 7,
		OS_PartiallyFilled = 8		// PartiallyFilled
	};

	enum OrderFlag {			// for CTP offset flag
		OF_OpenPosition = 0,
		OF_ClosePosition = 1,
		OF_CloseToday = 2,
		OF_CloseYesterday = 3
	};

Code Structure

Code Structure

Todo List

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].