# Bybit trading gateway for VeighNa Evo
<p align="center">
<img src ="https://vnpy.oss-cn-shanghai.aliyuncs.com/vnpy-logo.png"/>
</p>
<p align="center">
<img src ="https://img.shields.io/badge/version-2024.9.16-blueviolet.svg"/>
<img src ="https://img.shields.io/badge/platform-windows|linux|macos-yellow.svg"/>
<img src ="https://img.shields.io/badge/python-3.10|3.11|3.12-blue.svg" />
<img src ="https://img.shields.io/github/license/vnpy/vnpy.svg?color=orange"/>
</p>
## Introduction
This gateway is developed based on Bybit's V5 REST and Websocket API, and supports spot, linear contract, inverse contract and option trading.
**For derivatives contract trading, please notice:**
1. Only supports unified trading account.
2. Only supports cross margin and portfolio margin.
3. Only supports one-way position mode.
## Install
Users can easily install ``vnpy_bybit`` by pip according to the following command.
```
pip install vnpy_bybit
```
Also, users can install ``vnpy_bybit`` using the source code. Clone the repository and install as follows:
```
git clone https://github.com/veighna-global/vnpy_bybit.git && cd vnpy_bybit
python setup.py install
```
## A Simple Example
Save this as run.py.
```
from vnpy_evo.event import EventEngine
from vnpy_evo.trader.engine import MainEngine
from vnpy_evo.trader.ui import MainWindow, create_qapp
from vnpy_bybit import (
BinanceSpotGateway,
BinanceLinearGateway,
BinanceInverseGateway
)
def main():
"""主入口函数"""
qapp = create_qapp()
event_engine = EventEngine()
main_engine = MainEngine(event_engine)
main_engine.add_gateway(BinanceSpotGateway)
main_engine.add_gateway(BinanceLinearGateway)
main_engine.add_gateway(BinanceInverseGateway)
main_window = MainWindow(main_engine, event_engine)
main_window.showMaximized()
qapp.exec()
if __name__ == "__main__":
main()
```
Raw data
{
"_id": null,
"home_page": "https://www.github.com/veighna-global",
"name": "vnpy-bybit",
"maintainer": null,
"docs_url": null,
"requires_python": null,
"maintainer_email": null,
"keywords": "quant, quantitative, investment, trading, algotrading, bybit, btc, crypto",
"author": "VeighNa Global",
"author_email": "veighna@hotmail.com",
"download_url": "https://files.pythonhosted.org/packages/da/d5/11df3a08e514185ec223c05bbfa28b8019d55ebdc200e9a7843266c12aee/vnpy_bybit-2024.9.18.tar.gz",
"platform": null,
"description": "# Bybit trading gateway for VeighNa Evo\r\n\r\n<p align=\"center\">\r\n <img src =\"https://vnpy.oss-cn-shanghai.aliyuncs.com/vnpy-logo.png\"/>\r\n</p>\r\n\r\n<p align=\"center\">\r\n <img src =\"https://img.shields.io/badge/version-2024.9.16-blueviolet.svg\"/>\r\n <img src =\"https://img.shields.io/badge/platform-windows|linux|macos-yellow.svg\"/>\r\n <img src =\"https://img.shields.io/badge/python-3.10|3.11|3.12-blue.svg\" />\r\n <img src =\"https://img.shields.io/github/license/vnpy/vnpy.svg?color=orange\"/>\r\n</p>\r\n\r\n## Introduction\r\n\r\nThis gateway is developed based on Bybit's V5 REST and Websocket API, and supports spot, linear contract, inverse contract and option trading.\r\n\r\n**For derivatives contract trading, please notice:**\r\n\r\n1. Only supports unified trading account.\r\n2. Only supports cross margin and portfolio margin.\r\n3. Only supports one-way position mode.\r\n\r\n## Install\r\n\r\nUsers can easily install ``vnpy_bybit`` by pip according to the following command.\r\n\r\n```\r\npip install vnpy_bybit\r\n```\r\n\r\nAlso, users can install ``vnpy_bybit`` using the source code. Clone the repository and install as follows:\r\n\r\n```\r\ngit clone https://github.com/veighna-global/vnpy_bybit.git && cd vnpy_bybit\r\n\r\npython setup.py install\r\n```\r\n\r\n## A Simple Example\r\n\r\nSave this as run.py.\r\n\r\n```\r\nfrom vnpy_evo.event import EventEngine\r\nfrom vnpy_evo.trader.engine import MainEngine\r\nfrom vnpy_evo.trader.ui import MainWindow, create_qapp\r\n\r\nfrom vnpy_bybit import (\r\n BinanceSpotGateway,\r\n BinanceLinearGateway,\r\n BinanceInverseGateway\r\n)\r\n\r\n\r\ndef main():\r\n \"\"\"\u4e3b\u5165\u53e3\u51fd\u6570\"\"\"\r\n qapp = create_qapp()\r\n\r\n event_engine = EventEngine()\r\n main_engine = MainEngine(event_engine)\r\n main_engine.add_gateway(BinanceSpotGateway)\r\n main_engine.add_gateway(BinanceLinearGateway)\r\n main_engine.add_gateway(BinanceInverseGateway)\r\n\r\n main_window = MainWindow(main_engine, event_engine)\r\n main_window.showMaximized()\r\n\r\n qapp.exec()\r\n\r\n\r\nif __name__ == \"__main__\":\r\n main()\r\n```\r\n",
"bugtrack_url": null,
"license": null,
"summary": "Bybit trading gateway for VeighNa Evo.",
"version": "2024.9.18",
"project_urls": {
"Homepage": "https://www.github.com/veighna-global"
},
"split_keywords": [
"quant",
" quantitative",
" investment",
" trading",
" algotrading",
" bybit",
" btc",
" crypto"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "cdc434823bb68f428089e2d776345147a24789237e21d037521e934473f7faad",
"md5": "66aafa2c37d970650c7140d7b2480f2b",
"sha256": "48df2fafa81042ed122f94575e2cc9f2abc77b7ee3150fdfd3a0f4f9d37252fe"
},
"downloads": -1,
"filename": "vnpy_bybit-2024.9.18-py3-none-any.whl",
"has_sig": false,
"md5_digest": "66aafa2c37d970650c7140d7b2480f2b",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 12379,
"upload_time": "2024-09-18T01:40:47",
"upload_time_iso_8601": "2024-09-18T01:40:47.167920Z",
"url": "https://files.pythonhosted.org/packages/cd/c4/34823bb68f428089e2d776345147a24789237e21d037521e934473f7faad/vnpy_bybit-2024.9.18-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "dad511df3a08e514185ec223c05bbfa28b8019d55ebdc200e9a7843266c12aee",
"md5": "ae5e01e3dafc4d6431300501c45e9e12",
"sha256": "5af8e62b8bb487bc85457aa93475c6d80a8b2f7e789bb5951e06213e4dc16eea"
},
"downloads": -1,
"filename": "vnpy_bybit-2024.9.18.tar.gz",
"has_sig": false,
"md5_digest": "ae5e01e3dafc4d6431300501c45e9e12",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 12711,
"upload_time": "2024-09-18T01:40:48",
"upload_time_iso_8601": "2024-09-18T01:40:48.797153Z",
"url": "https://files.pythonhosted.org/packages/da/d5/11df3a08e514185ec223c05bbfa28b8019d55ebdc200e9a7843266c12aee/vnpy_bybit-2024.9.18.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-09-18 01:40:48",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "vnpy-bybit"
}