Skip to content

Commit

Permalink
Merge branch 'dev' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
vnpy authored May 14, 2020
2 parents 743ec0f + b14c9cd commit 26faaea
Show file tree
Hide file tree
Showing 208 changed files with 36,858 additions and 2,192 deletions.
28 changes: 17 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
</p>

<p align="center">
<img src ="https://img.shields.io/badge/version-2.1.2-blueviolet.svg"/>
<img src ="https://img.shields.io/badge/version-2.1.3-blueviolet.svg"/>
<img src ="https://img.shields.io/badge/platform-windows|linux|macos-yellow.svg"/>
<img src ="https://img.shields.io/badge/python-3.7-blue.svg" />
<img src ="https://img.shields.io/github/workflow/status/vnpy/vnpy/Python%20application/master"/>
Expand Down Expand Up @@ -52,6 +52,8 @@ vn.py是一套基于Python的开源量化交易系统开发框架,于2015年1

* 飞鼠(sgit):黄金TD、国内期货

* 金仕达黄金(ksgold):黄金TD

* 鑫管家(xgj):期货资管

* 融航(rohon):期货资管
Expand All @@ -74,31 +76,35 @@ vn.py是一套基于Python的开源量化交易系统开发框架,于2015年1

* Alpaca(alpaca):美股(零佣金)

* 佳兆业投资(kasia):港股

* 数字货币

* BitMEX(bitmex):数字货币期货、期权、永续合约

* Bybit(bybit):数字货币永续合约

* 币安(binance):数字货币现货

* 币安永续(binances):数字货币永续合约

* OKEX(okex):数字货币现货

* OKEX永续(okexs):数字货币永续合约

* OKEX期货(okexf):数字货币期货

* OKEX期权(okexo):数字货币期权

* 火币合约(hbdm):数字货币期货

* 币安永续(binancef):数字货币永续合约

* Gate.io永续(gateios):数字货币永续合约
* 火币(huobi):数字货币现货

* Deribit(deribit),数字货币期权、永续合约
* 火币期货(huobif):数字货币期货

* 币安(binance):数字货币现货
* 火币永续(huobis):数字货币永续

* OKEX(okex):数字货币现货
* Gate.io永续(gateios):数字货币永续合约

* 火币(huobi):数字货币现货
* Deribit(deribit),数字货币期权、永续合约

* Bitfinex(bitfinex):数字货币现货

Expand Down Expand Up @@ -156,7 +162,7 @@ vn.py是一套基于Python的开源量化交易系统开发框架,于2015年1

## 环境准备

* 推荐使用vn.py团队为量化交易专门打造的Python发行版[VNStudio-2.1.2](https://download.vnpy.com/vnstudio-2.1.2.exe),内置了最新版的vn.py框架以及VN Station量化管理平台,无需手动安装
* 推荐使用vn.py团队为量化交易专门打造的Python发行版[VNStudio-2.1.3](https://download.vnpy.com/vnstudio-2.1.3.exe),内置了最新版的vn.py框架以及VN Station量化管理平台,无需手动安装
* 支持的系统版本:Windows 7以上/Windows Server 2008以上/Ubuntu 18.04 LTS
* 支持的Python版本:Python 3.7 64位(**注意必须是Python 3.7 64位版本**

Expand Down
10 changes: 5 additions & 5 deletions docs/gateway.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ def main():
| OKEX | 数字货币 |
| OKEXF | 数字货币 |
| HUOBI | 数字货币 |
| HBDM | 数字货币 |
| HUOBIF | 数字货币 |
| ONETOKEN | 数字货币 |
| RPC | RPC服务 |

Expand Down Expand Up @@ -612,14 +612,14 @@ main_engine.add_gateway(HuobiGateway)



### 火币合约(HBDM)
### 火币合约(HUOBIF)

#### 如何加载

先从gateway上调用HbdmGateway类;然后通过add_gateway()函数添加到main_engine上。
先从gateway上调用HuobifGateway类;然后通过add_gateway()函数添加到main_engine上。
```
from vnpy.gateway.hbdm import HbdmGateway
main_engine.add_gateway(HbdmGateway)
from vnpy.gateway.huobif import HuobifGateway
main_engine.add_gateway(HuobifGateway)
```

&nbsp;
Expand Down
2 changes: 1 addition & 1 deletion docs/introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@

* OKEX合约(okexf):数字货币期货

* 火币合约(hbdm):数字货币期货
* 火币合约(huobif):数字货币期货

* 币安(binance):数字货币现货

Expand Down
147 changes: 134 additions & 13 deletions examples/portfolio_backtesting/backtesting_demo.ipynb

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions examples/vn_trader/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
# from vnpy.gateway.okexf import OkexfGateway
# from vnpy.gateway.okexs import OkexsGateway
from vnpy.gateway.xtp import XtpGateway
# from vnpy.gateway.hbdm import HbdmGateway
# from vnpy.gateway.huobif import HuobifGateway
from vnpy.gateway.tap import TapGateway
# from vnpy.gateway.tora import ToraGateway
# from vnpy.gateway.alpaca import AlpacaGateway
Expand Down Expand Up @@ -80,7 +80,7 @@ def main():
# main_engine.add_gateway(BitfinexGateway)
# main_engine.add_gateway(OnetokenGateway)
# main_engine.add_gateway(OkexfGateway)
# main_engine.add_gateway(HbdmGateway)
# main_engine.add_gateway(HuobifGateway)
main_engine.add_gateway(XtpGateway)
main_engine.add_gateway(TapGateway)
# main_engine.add_gateway(ToraGateway)
Expand Down
88 changes: 87 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,78 @@ def get_ext_modules():
language="cpp",
)

vnxtpmd = Extension(
"vnpy.api.xtp.vnxtpmd",
[
"vnpy/api/xtp/vnxtp/vnxtpmd/vnxtpmd.cpp",
],
include_dirs=["vnpy/api/xtp/include",
"vnpy/api/xtp/vnxtp"],
define_macros=[],
undef_macros=[],
library_dirs=["vnpy/api/xtp/libs", "vnpy/api/xtp"],
libraries=["xtptraderapi", "xtpquoteapi"],
extra_compile_args=compiler_flags,
extra_link_args=extra_link_args,
runtime_library_dirs=runtime_library_dirs,
depends=[],
language="cpp",
)

vnxtptd = Extension(
"vnpy.api.xtp.vnxtptd",
[
"vnpy/api/xtp/vnxtp/vnxtptd/vnxtptd.cpp",
],
include_dirs=["vnpy/api/xtp/include",
"vnpy/api/xtp/vnxtp"],
define_macros=[],
undef_macros=[],
library_dirs=["vnpy/api/xtp/libs", "vnpy/api/xtp"],
libraries=["xtptraderapi", "xtpquoteapi"],
extra_compile_args=compiler_flags,
extra_link_args=extra_link_args,
runtime_library_dirs=runtime_library_dirs,
depends=[],
language="cpp",
)

vnksgoldmd = Extension(
"vnpy.api.ksgold.vnksgoldmd",
[
"vnpy/api/ksgold/vnksgold/vnksgoldmd/vnksgoldmd.cpp",
],
include_dirs=["vnpy/api/ksgold/include",
"vnpy/api/ksgold/vnksgold"],
define_macros=[],
undef_macros=[],
library_dirs=["vnpy/api/ksgold/libs", "vnpy/api/ksgold"],
libraries=["ksgoldquotmarketdataapi", "ksgoldtraderapi"],
extra_compile_args=compiler_flags,
extra_link_args=extra_link_args,
runtime_library_dirs=runtime_library_dirs,
depends=[],
language="cpp",
)

vnksgoldtd = Extension(
"vnpy.api.ksgold.vnksgoldtd",
[
"vnpy/api/ksgold/vnksgold/vnksgoldtd/vnksgoldtd.cpp",
],
include_dirs=["vnpy/api/ksgold/include",
"vnpy/api/ksgold/vnksgold"],
define_macros=[],
undef_macros=[],
library_dirs=["vnpy/api/ksgold/libs", "vnpy/api/ksgold"],
libraries=["ksgoldquotmarketdataapi", "ksgoldtraderapi"],
extra_compile_args=compiler_flags,
extra_link_args=extra_link_args,
runtime_library_dirs=runtime_library_dirs,
depends=[],
language="cpp",
)

vnsgitmd = Extension(
"vnpy.api.sgit.vnsgitmd",
[
Expand Down Expand Up @@ -211,18 +283,32 @@ def get_ext_modules():
elif platform.system() == "Darwin":
ext_modules = []
else:
ext_modules = [vnctptd, vnctpmd, vnsgittd, vnsgitmd, vnoes]
ext_modules = [
vnctptd, vnctpmd,
vnxtptd, vnxtpmd,
vnsgittd, vnsgitmd,
vnksgoldmd, vnksgoldtd,
vnoes
]

ext_modules = check_extension_build_flag(
ext_modules, "VNPY_BUILD_OES", vnoes)
ext_modules = check_extension_build_flag(
ext_modules, "VNPY_BUILD_CTP", vnctptd)
ext_modules = check_extension_build_flag(
ext_modules, "VNPY_BUILD_CTP", vnctpmd)
ext_modules = check_extension_build_flag(
ext_modules, "VNPY_BUILD_XTP", vnxtptd)
ext_modules = check_extension_build_flag(
ext_modules, "VNPY_BUILD_XTP", vnxtpmd)
ext_modules = check_extension_build_flag(
ext_modules, "VNPY_BUILD_sgit", vnsgittd)
ext_modules = check_extension_build_flag(
ext_modules, "VNPY_BUILD_sgit", vnsgitmd)
ext_modules = check_extension_build_flag(
ext_modules, "VNPY_BUILD_ksgold", vnksgoldmd)
ext_modules = check_extension_build_flag(
ext_modules, "VNPY_BUILD_ksgold", vnksgoldtd)

return ext_modules

Expand Down
2 changes: 1 addition & 1 deletion vnpy/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "2.1.2"
__version__ = "2.1.3"
Binary file added vnpy/api/ksgold/KSGoldQuotMarketDataApi.dll
Binary file not shown.
Binary file added vnpy/api/ksgold/KSGoldTraderApi.dll
Binary file not shown.
Binary file added vnpy/api/ksgold/SSPXEncode.dll
Binary file not shown.
3 changes: 3 additions & 0 deletions vnpy/api/ksgold/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from .vnksgoldmd import MdApi
from .vnksgoldtd import TdApi
from .ksgold_constant import *
Loading

0 comments on commit 26faaea

Please sign in to comment.