Giter VIP home page Giter VIP logo

vnpy_evo's Introduction

By Traders, For Traders.

VeighNa Evo (vnpy_evo) is the core module for using VeighNa (vnpy) quant trading platform on the crypto market.

Social

  • Twitter Follow us on Twitter
  • Telegram Announcements Follow our important announcements
  • Telegram Chat If you need technical support

Features

  1. Full-featured quantitative trading platform (vnpy_evo.trader)

  2. Gateways which connect to exchanges for receiving market data and sending trading orders:

    • Crypto Market

      • Binance (binance): Spot/Perpetual/Futures/Option

      • OKX (okx): Spot/Perpetual/Futures/Option

      • Bybit (bybit): Spot/Perpetual/Futures/Option

    • Forex Market

      • MT5 (mt5): Forex/Gold/Commodity/Crypto
    • Special Applications

      • RPC service (rpc): inter-process communication interface for distributed architecture
  3. Applications for various quantitative strategies (vnpy_evo.app).

    • cta_strategy: CTA strategy engine module, which allows users to perform fine-grained control over the withdrawal behavior of delegates 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 directly carry out strategy backtester analysis, parameter optimization and other related work

    • spread_trading: spread trading module, support custom spreads, real-time calculation of spread quotes and positions, support semi-automatic spread algorithm trading and fully automatic spread strategy trading two modes

    • option_master: option trading module, designed for the domestic options market, supports a variety of 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.) at the same time, providing historical data backtesting and live automatic trading functions

    • algo_trading: algorithm trading module, providing a variety of commonly used intelligent trading algorithms: TWAP, Sniper, Iceberg, BestLimit, etc.

    • script_trader: script strategy module, designed for multi-standard portfolio trading strategies, also can be directly in the command line to achieve REPL instructions in the form of trading, does not support the backtest function

    • paper_account: Simulation trading module, pure localization of simulation trading functions, based on the real-time quotes obtained from the trading interface for commission aggregation, providing commission transaction push and position records

    • chart_wizard: K-line chart module, based on RQData data service (futures) or trading interface (digital currency) to obtain historical data, and combined with Tick push to display real-time market changes

    • portfolio_manager: portfolio module, for all kinds of 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 at the same time, realizing a multi-process distributed system

    • data_manager: Historical data management module, view the existing data in the database through the tree directory, select any time period data to view the field details, support CSV file data import and export

    • data_recorder: Quotes recording module, based on the graphical interface for configuration, according to the demand for real-time recording Tick or K-line quotes to the database, 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 realizing front-end risk control functions

    • web_trader: The web service module is designed according to the requirements of B-S architecture, and implements a web server that provides active function call (REST) and passive data push (WebSocket)

  4. Standard network clients for connecting to exchange APIs:

    • REST Client (rest): The high-performance rest API client based on coroutine process asynchronous IO which adopts the programming model of event message cycle to support the sending of high concurrent real-time transaction requests

    • Websocket Client (websocket): The high-performance websocket API client based on coroutine process asynchronous IO supports which sharing event loops with REST Client to avoid multi-threaded performance loss caused by GIL

  5. Event processing engine (vnpy_evo.event), which is the core of event-driven trading program

  6. Database adaptors which support most commonly used databases:

    • SQL

      • SQLite (sqlite): lightweight single file database, no need to install and configure data service programs, default option of vnpy_evo.py, 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

      • 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): The high-performance key/value database launched by Google which realizes the process memory storage engine based on LSM algorithm, and supports billions of levels of massive data

  7. Standarad RPC solution (vnpy_evo.rpc) for implementing complex trading systems with distributed deployments

  8. High-performance charting widget (vnpy_evo.chart), which supports stream market data update

Install

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

Example

You can start running VeighNa Evo with only a few lines of code.

from vnpy_evo.event import EventEngine
from vnpy_evo.trader.engine import MainEngine
from vnpy_evo.trader.ui import MainWindow, create_qapp

from vnpy_binance import BinanceUsdtGateway
from vnpy_ctastrategy import CtaStrategyApp
from vnpy_ctabacktester import CtaBacktesterApp

def main():
    qapp = create_qapp()

    event_engine = EventEngine()
    main_engine = MainEngine(event_engine)
    
    main_engine.add_gateway(BinanceUsdtGateway)
    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 a terminal within the directory and run the following command to start VeighNa Trader.

python run.py

Licence

MIT

vnpy_evo's People

Contributors

ryan-dev-design avatar veighna-global avatar vn-crypto avatar vnpy 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

Watchers

 avatar  avatar  avatar  avatar

vnpy_evo's Issues

2024 Roadmap

Hello guys, not sure how many are still following the updates of this project.

We are making lots of improvements now, mostly a redesigned quant trading platfrom which only focuses on the crypto market, i.e. remove those unrelated parts of the original VeighNa project.

Here is our roadmap for 2024, please let us know if you have any suggestions!

怎么配置datafeed呢?

启动vnpy_evo的时候输出
没有配置要使用的数据服务,请修改全局配置中的datafeed相关内容

image

image

Version 0.1.0 No module named 'vnpy.trader.locale'

Traceback (most recent call last):
File "G:\project\vnpy\vnpy\examples\veighna_trader\run.py", line 9, in
from vnpy_evo.trader.ui import MainWindow, create_qapp
File "D:\ProgramData\Anaconda3\envs\3_10\lib\site-packages\vnpy_evo\trader\ui_init_.py", line 2, in
from .mainwindow import MainWindow
File "D:\ProgramData\Anaconda3\envs\3_10\lib\site-packages\vnpy_evo\trader\ui\mainwindow.py", line 16, in
from vnpy.trader.locale import _
ModuleNotFoundError: No module named 'vnpy.trader.locale'

AttributeError: 'TickMonitor' object has no attribute 'NoEditTriggers'. Did you mean: 'editTriggers'?

Traceback (most recent call last):
File "C:\Users\Administrator\PycharmProjects\vnpybinance\run.py", line 27, in
main()
File "C:\Users\Administrator\PycharmProjects\vnpybinance\run.py", line 20, in main
main_window = MainWindow(main_engine, event_engine)
File "C:\Users\Administrator\PycharmProjects\vnpybinance\vnpy_evo\trader\ui\mainwindow.py", line 57, in init
self.init_ui()
File "C:\Users\Administrator\PycharmProjects\vnpybinance\vnpy_evo\trader\ui\mainwindow.py", line 66, in init_ui
self.init_widgets()
File "C:\Users\Administrator\PycharmProjects\vnpybinance\vnpy_evo\trader\ui\mainwindow.py", line 71, in init_widgets
self.home_widget = HomeWidget(self.main_engine, self.event_engine)
File "C:\Users\Administrator\PycharmProjects\vnpybinance\vnpy_evo\trader\ui\mainwindow.py", line 177, in init
self.init_ui()
File "C:\Users\Administrator\PycharmProjects\vnpybinance\vnpy_evo\trader\ui\mainwindow.py", line 184, in init_ui
self.tick_monitor = TickMonitor(self.main_engine, self.event_engine)
File "C:\Users\Administrator\PycharmProjects\vnpybinance\vnpy_evo\trader\ui\monitor.py", line 228, in init
self.init_ui()
File "C:\Users\Administrator\PycharmProjects\vnpybinance\vnpy_evo\trader\ui\monitor.py", line 234, in init_ui
self.init_table()
File "C:\Users\Administrator\PycharmProjects\vnpybinance\vnpy_evo\trader\ui\monitor.py", line 247, in init_table
self.setEditTriggers(self.NoEditTriggers)
AttributeError: 'TickMonitor' object has no attribute 'NoEditTriggers'. Did you mean: 'editTriggers'?

TickMonitor checked it and did in fact have no NoEditTriggers attribute and many different errors

Please provide your suggestions for new gateway support!

We have updated the most widely used crypto gateways including:

  1. Binance
  2. OKX
  3. Bybit

After completing the crypto strategy module, we will continue developing new gateways.

Please let us know if you have any suggestions, especially the reason for you to trade on this specific exchange.

New vnpy_evo is not compatible with old apps

I have installed the latest vnpy_evo and other apps such as ctabacktester and ctastrategy, but it is not running. From the error message, I reckon it is about the UI version is not compatible.

Steps:

  1. Install python 3.10.11 on windows 11
  2. Install vnpy_evo
  3. Install vnpy_binance, vnpy_ctastrategy, vnpy_ctabacktester and other dependencies
  4. run sample code

Code:
image

Error message:
image

Exchange 是基于旧 Exchange 的值创建的新的 Enum 类型对象,我在 database 的 load_bar_data 的时候,无法进行类型转化。

vnpy_crypto 的 Exchange 是基于旧 Exchange 的值创建的新的 Enum 类型对象,我在 database 的 load_bar_data 的时候,里面用的 vnpy.trader.constant 的 Exchange,无法进行 crypto 交易所的类型转化。

错误提示:

Traceback (most recent call last):
  File "/vnpy/examples/candle_chart/run.py", line 15, in <module>
    bars = database.load_bar_data('BTC-USDT-SWAP',
  File "/virtualenv/vnpy/lib/python3.9/site-packages/vnpy_sqlite/sqlite_database.py", line 288, in load_bar_data
    exchange=Exchange(db_bar.exchange),
  File "/usr/local/Cellar/[email protected]/3.9.16/Frameworks/Python.framework/Versions/3.9/lib/python3.9/enum.py", line 384, in __call__
    return cls.__new__(cls, value)
  File "/usr/local/Cellar/[email protected]/3.9.16/Frameworks/Python.framework/Versions/3.9/lib/python3.9/enum.py", line 702, in __new__
    raise ve_exc
ValueError: 'OKX' is not a valid Exchange

好像是 Python 的 enum 的作者另外还扩展了一个包 aenum,能直接扩展原始的 Enum 类型。我通过以下的代码,直接把 Exchange 修改后就没问题了。

from aenum import extend_enum

from vnpy.trader.constant import Exchange


# Add crypto currency exchanges
exchange_names = [
    "BINANCE",
    "BITFINEX",
    "BITSTAMP",
    "BYBIT",
    "COINBASE",
    "DERIBIT",
    "DYDX",
    "FTX",
    "GATEIO",
    "HUOBI",
    "OKX"
]

# Generate new enum class

[extend_enum(Exchange, exchange_name, exchange_name) for exchange_name in exchange_names]

这个包我没有详细看,不知道有没有其他问题。

pyside6.7 still have 'TickMonitor' object has no attribute 'NoEditTriggers'. Did you mean: 'editTriggers'? #39

PS D:\Veighna_Crypto> pip install pyside6
Requirement already satisfied: pyside6 in d:\veighna_station\lib\site-packages (6.7.0)
Requirement already satisfied: shiboken6==6.7.0 in d:\veighna_station\lib\site-packages (from pyside6) (6.7.0)
Requirement already satisfied: PySide6-Essentials==6.7.0 in d:\veighna_station\lib\site-packages (from pyside6) (6.7.0)
Requirement already satisfied: PySide6-Addons==6.7.0 in d:\veighna_station\lib\site-packages (from pyside6) (6.7.0)
PS D:\Veighna_Crypto> python .\run.py

�[1;33m📢 Tips:�[0m QFluentWidgets Pro is now released. Click �[1;96mhttps://qfluentwidgets.com/pages/pro�[0m to learn more about it.

The datafeed to be used is not configured. Please modify the datafeed settings in the global configuration.
Traceback (most recent call last):
File "D:\Veighna_Crypto\run.py", line 32, in
main()
File "D:\Veighna_Crypto\run.py", line 25, in main
main_window = MainWindow(main_engine, event_engine)
File "D:\veighna_station\lib\site-packages\vnpy_evo\trader\ui\mainwindow.py", line 56, in init
self.init_ui()
File "D:\veighna_station\lib\site-packages\vnpy_evo\trader\ui\mainwindow.py", line 65, in init_ui
self.init_widgets()
File "D:\veighna_station\lib\site-packages\vnpy_evo\trader\ui\mainwindow.py", line 80, in init_widgets
widget: QtWidgets.QWidget = widget_class(self.main_engine, self.event_engine)
File "D:\veighna_station\lib\site-packages\vnpy_ctastrategy\ui\widget.py", line 39, in init
self.init_ui()
File "D:\veighna_station\lib\site-packages\vnpy_ctastrategy\ui\widget.py", line 79, in init_ui
self.log_monitor: LogMonitor = LogMonitor(self.main_engine, self.event_engine)
File "D:\veighna_station\lib\site-packages\vnpy\trader\ui\widget.py", line 236, in init
self.init_ui()
File "D:\veighna_station\lib\site-packages\vnpy_ctastrategy\ui\widget.py", line 424, in init_ui
super(LogMonitor, self).init_ui()
File "D:\veighna_station\lib\site-packages\vnpy\trader\ui\widget.py", line 242, in init_ui
self.init_table()
File "D:\veighna_station\lib\site-packages\vnpy\trader\ui\widget.py", line 255, in init_table
self.setEditTriggers(self.NoEditTriggers)
AttributeError: 'LogMonitor' object has no attribute 'NoEditTriggers'. Did you mean: 'editTriggers'?

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.