💬 Want to read this in chinese ? Go here
VeighNa is a Python-based open source quantitative trading system development framework that has grown step by step into a fully-featured quantitative trading platform with continuous contributions from the open source community. It currently has many users from domestic and international financial institutions, including hedge funds, investment banks, futures brokers, university research institutions, proprietary trading companies, etc.
The VeighNa Elite Quantitative Terminal for professional traders has been officially released, providing comprehensive support for professional traders' needs in areas such as massive strategy concurrency, intelligent position rolling, algorithmic order execution, multi-account trading support, and more. For more detailed information, please scan the QR code below and follow the account, then click on the menu bar's [Community Exchange -> Elite Member Services]:
If you have any questions about using VeighNa for secondary development (strategies, modules, etc.), please check the VeighNa Project Documentation. If you can't solve it, please go to the [Questions and Help] section of the Official Community Forum for help, or share your experience in the [Experience Sharing] section!
Want to get more information about VeighNa? Please scan the QR code below to add the assistant and join the [VeighNa Community Exchange WeChat Group]:
On the tenth anniversary of VeighNa's release, version 4.0 officially introduces the vnpy.alpha module targeting AI quantitative strategies, providing professional quantitative traders with an all-in-one multi-factor machine learning (ML) strategy development, research, and live trading solution:
dataset: Factor Feature Engineering
model: Prediction Model Training
:robot: strategy: Strategy Research and Development
lab: Research Process Management
notebook: Quantitative Research Demo
The design concept of the vnpy.alpha module was inspired by the Qlib project, providing powerful AI quantitative capabilities while maintaining ease of use. We would like to express our sincere gratitude to the Qlib development team!
Modules marked with have completed the upgrade compatibility testing for version 4.0. Additionally, the 4.0 core framework uses an upgrade approach that prioritizes compatibility, so most modules can also be used directly (interfaces involving C++ API encapsulation must be upgraded before use).
Multi-functional quantitative trading platform (vnpy.trader) that integrates various trading interfaces and provides simple and easy-to-use APIs for specific strategy algorithm and function development, for quickly building quantitative trading applications required by traders.
Trading interfaces (vnpy.gateway) covering all domestic and international trading varieties:
Domestic market
CTP (ctp): Domestic futures and options
CTP Mini (mini): Domestic futures, options
CTP Securities (sopt): ETF options
FEMAS (femas): Domestic futures
UFT (uft): Domestic futures, ETF options
Esunny (esunny): Domestic futures, Gold TD
APEX XSpeed (sec): ETF options
APEX HTS (hts): ETF options
XTP (xtp): Domestic securities (A shares), ETF options
TORA (tora): Domestic securities (A shares), ETF options
Guotai Junan (hft): Domestic securities (A shares, margin trading)
OST (ost): Domestic securities (A shares)
EMT (emt): Domestic securities (A shares)
SGIT (sgit): Gold TD, domestic futures
KsGold (ksgold): Gold TD
LStar (lstar): Futures asset management
Rohon (rohon): Futures asset management
Jees (jees): Futures asset management
ComStar (comstar): Interbank market
GoldMiner (gm): Domestic securities (simulation)
UF Cloud (uf): Domestic securities (simulation)
TTS (tts): Domestic futures (simulation)
Overseas market
Special Applications
RQData Market Data (rqdata): Cross-market (stocks, indices, ETFs, futures) real-time market data
XtQuant Market Data (xt): Cross-market (stocks, indices, convertible bonds, ETFs, futures, options) real-time market data
RPC service (rpc): Inter-process communication interface for distributed architecture
Out-of-the-box trading applications for various quantitative strategies (vnpy.app):
cta_strategy: CTA strategy engine module, which allows users to perform fine-grained control over the order management during the operation of CTA-type strategies while maintaining ease of use (reducing trading slippage, implementing high-frequency strategies)
cta_backtester: CTA strategy backtester module, no need to use Jupyter Notebook, directly use the graphical interface to carry out strategy backtesting analysis, parameter optimization and other related work
spread_trading: Spread trading module, supports custom spreads, real-time calculation of spread quotes and positions, supports semi-automatic spread algorithm trading and fully automatic spread strategy trading modes
option_master: Option trading module, designed for the domestic options market, supports various option pricing models, implied volatility surface calculation, Greek value risk tracking and other functions
portfolio_strategy: Portfolio strategy module, designed for trading multi-contract quantitative strategies (Alpha, option arbitrage, etc.) simultaneously, providing historical data backtesting and live automatic trading functions
algo_trading: Algorithm trading module, providing various commonly used intelligent trading algorithms: TWAP, Sniper, Iceberg, BestLimit, etc.
script_trader: Script strategy module, designed for multi-asset portfolio trading strategies and computational tasks, also can directly achieve REPL instruction trading in the command line, does not support backtesting functions
paper_account: Simulation trading module, pure localized implementation of simulation trading functions, based on real-time quotes obtained from the trading interface for order matching, providing order execution pushing and position records
chart_wizard: K-line chart module, based on RQData data service (futures) or trading interface to obtain historical data, and combined with Tick push to display real-time market changes
portfolio_manager: Portfolio module, for various fundamental trading strategies, based on separate strategy sub-accounts, providing automatic tracking of trading positions and real-time profit and loss statistics
rpc_service: RPC service module, allowing a VeighNa Trader process to be started as a server, serving as a unified routing channel for quotes and trades, allowing multiple clients to connect simultaneously, realizing a multi-process distributed system
data_manager: Historical data management module, view existing data in the database through a tree directory, select any time period data to view field details, supports CSV file data import and export
data_recorder: Market data recording module, based on the graphical interface for configuration, records Tick or K-line data to the database in real-time according to demand, for strategy backtesting or live initialization
excel_rtd: Excel RTD (Real Time Data) real-time data service, based on pyxll module to achieve real-time push updates of various data (quotes, contracts, positions, etc.) in Excel
risk_manager: Risk management module, providing statistics and restrictions on rules including trade flow control, number of orders placed, active orders, total number of cancelled orders, etc., effectively implementing front-end risk control functions
web_trader: Web service module, designed according to the requirements of B-S architecture, implementing a web server that provides active function calls (REST) and passive data push (WebSocket)
Python trading API interface package (vnpy.api), providing the underlying implementation of the above trading interfaces:
REST Client (rest): High-performance REST API client based on coroutine process asynchronous IO which adopts the programming model of event message cycle to support sending high concurrent real-time transaction requests
Websocket Client (websocket): High-performance Websocket API client based on coroutine process asynchronous IO, supports sharing event loops with REST Client to avoid multi-threaded performance loss caused by GIL
Simple and easy-to-use event-driven engine (vnpy.event), which is the core of event-driven trading programs
Standardized management client (vnpy.database) interfacing with various databases:
SQL class
SQLite (sqlite): Lightweight single file database, no need to install and configure data service programs, default option of VeighNa, suitable for novice users
MySQL (mysql): The world's most popular open source relational database, extremely rich documentation, and can replace other high NewSQL compatible implementations (such as TiDB)
PostgreSQL (postgresql): More feature-rich open source relational database, support for new features through extension plug-ins, only recommended for skilled users
NoSQL classes
DolphinDB (dolphindb): A high-performance distributed temporal database especially suitable for low latency or real-time tasks with high speed requirements
Arctic (arctic): High-performance financial temporal database developed by quantitative hedge fund Man AHL based on MongoDB, adopts performance optimization schemes such as partitioned storage and lz4 compression
TDengine (taos): Distributed, high-performance, SQL-supporting time-series database with built-in caching, stream computing, data subscription and other system functions that greatly reduce development and maintenance complexity
TimescaleDB (timescaledb): Time-series database developed based on PostgreSQL, installed as a plugin extension, supports automatic data partitioning by space and time
MongoDB (mongodb): Non-relational database based on distributed file storage (bson format), built-in memory cache of hot data provides faster read and write speeds
InfluxDB (influxdb): Non-relational database specially designed for time-series data, columnar data storage provides high read/write efficiency and peripheral analysis applications
LevelDB (leveldb): High-performance key/value database launched by Google which implements a process memory storage engine based on LSM algorithm, and supports billions of levels of massive data
Adapter interfaces for various data services (datafeed):
XtQuant (xt): Stocks, futures, options, funds, bonds
RQData (rqdata): Stocks, futures, options, funds, bonds, Gold TD
VoltTrader (voltrader): Futures, options
UData (udata): Stocks, futures, options
TuShare (tushare): Stocks, futures, options, funds
Wind (wind): Stocks, futures, funds, bonds
Tinysoft (tinysoft): Stocks, futures, funds, bonds
iFinD (ifind): Stocks, futures, funds, bonds
TQSDK (tqsdk): Futures
Standard component for inter-process communication (vnpy.rpc) for implementing complex trading systems in distributed deployments
Python high-performance K-line charts (vnpy.chart), supporting large data volume chart display and real-time data update functions
Community Forum and Zhihu Blog, which include the development tutorial of VeighNa project and the research on the application of Python in the field of quantitative trading, etc.
The official communication group 262656087 (QQ), with strict management (regular purging of long-term inactive members), and the membership fee will be donated to the VeighNa community fund.
Note: The above description of functional features is based on the documentation at the time of publication, and subsequent updates or adjustments may exist. If there are discrepancies between the function description and the actual situation, please contact us through Issue for adjustments.
Download the latest version from here, unzip it and run the following command to install it.
Windows
install.bat
Ubuntu
bash install.sh
Macos
bash install_osx.sh
Register a CTP Demo account at SimNow and get the broker code and the trading quotes server address at this page.
Register at VeighNa community forum to get the VeighNa Station account password (the forum account password is used)
Launch VeighNa Station (a shortcut will be created automatically on your desktop after installing VeighNa Studio), enter the account password from the previous step and login
Click on the VeighNa Trader button at the bottom and start your trading!
Attention:
In addition to the graphical start-up method based on VeighNa Station, you can also create run.py in any directory and write the following sample code:
from vnpy.event import EventEngine
from vnpy.trader.engine import MainEngine
from vnpy.trader.ui import MainWindow, create_qapp
from vnpy_ctp import CtpGateway
from vnpy_ctastrategy import CtaStrategyApp
from vnpy_ctabacktester import CtaBacktesterApp
def main():
"""Start VeighNa Trader"""
qapp = create_qapp()
event_engine = EventEngine()
main_engine = MainEngine(event_engine)
main_engine.add_gateway(CtpGateway)
main_engine.add_app(CtaStrategyApp)
main_engine.add_app(CtaBacktesterApp)
main_window = MainWindow(main_engine, event_engine)
main_window.showMaximized()
qapp.exec()
if __name__ == "__main__":
main()
Open CMD in that directory (hold Shift->click right mouse button->open command window/PowerShell here) and then run the following command to start VeighNa Trader:
python run.py
VeighNa uses Github to host its source code, if you wish to contribute code please use the PR (Pull Request) process of github:
Create Issue - For larger changes (such as new features, large refactoring, etc.) it is best to first open an issue to discuss, and smaller improvements (such as document improvements, bugfixes, etc.) can be sent directly to PR
Fork VeighNa - Click the Fork button in the upper right corner
Clone your own fork: git clone https://github.com/$userid/vnpy.git
Create your own feature branch from dev: git checkout -b $my_feature_branch dev
Make changes on $my_feature_branch and push the changes to your fork
Create a [Pull Request] from your fork's $my_feature_branch branch to the main project's dev branch - here Click on compare across forks and select the required fork and branch to create the PR
Waiting for review, need to continue to improve, or be Merge!
When submitting code, please observe the following rules to improve the quality of the code:
ruff check .
in the project root directory.mypy vnpy
in the project root directory.MIT
Вы можете оставить комментарий после Вход в систему
Неприемлемый контент может быть отображен здесь и не будет показан на странице. Вы можете проверить и изменить его с помощью соответствующей функции редактирования.
Если вы подтверждаете, что содержание не содержит непристойной лексики/перенаправления на рекламу/насилия/вульгарной порнографии/нарушений/пиратства/ложного/незначительного или незаконного контента, связанного с национальными законами и предписаниями, вы можете нажать «Отправить» для подачи апелляции, и мы обработаем ее как можно скорее.
Опубликовать ( 0 )