From 59a4def39327f3915158f45f60945353eeaf15d3 Mon Sep 17 00:00:00 2001 From: "vn.py" Date: Tue, 19 Mar 2019 18:58:39 +0800 Subject: [PATCH] [Mod]import rqdatac only if required --- docs/cta_strategy.md | 1 + docs/index.md | 7 ++++--- docs/quickstart.md | 1 + vnpy/app/cta_strategy/engine.py | 4 ++-- 4 files changed, 8 insertions(+), 5 deletions(-) create mode 100644 docs/cta_strategy.md create mode 100644 docs/quickstart.md diff --git a/docs/cta_strategy.md b/docs/cta_strategy.md new file mode 100644 index 00000000..e10b99d0 --- /dev/null +++ b/docs/cta_strategy.md @@ -0,0 +1 @@ +# Introduction diff --git a/docs/index.md b/docs/index.md index 18ead527..3dbff961 100644 --- a/docs/index.md +++ b/docs/index.md @@ -1,6 +1,7 @@ # vn.py文档 -* [Introduction](introduction.md) -* [Install](install.md) -* [Quick Start](quickstart.md) \ No newline at end of file +* [vn.py简介](introduction.md) +* [项目安装](install.md) +* [基本使用](quickstart.md) +* [CTA策略模块](cta_strategy.md) \ No newline at end of file diff --git a/docs/quickstart.md b/docs/quickstart.md new file mode 100644 index 00000000..e10b99d0 --- /dev/null +++ b/docs/quickstart.md @@ -0,0 +1 @@ +# Introduction diff --git a/vnpy/app/cta_strategy/engine.py b/vnpy/app/cta_strategy/engine.py index 721d4c4e..bbfb3ef9 100644 --- a/vnpy/app/cta_strategy/engine.py +++ b/vnpy/app/cta_strategy/engine.py @@ -11,8 +11,6 @@ from threading import Thread from queue import Queue from copy import copy -import rqdatac - from vnpy.event import Event, EventEngine from vnpy.trader.engine import BaseEngine, MainEngine from vnpy.trader.object import ( @@ -105,6 +103,8 @@ class CtaEngine(BaseEngine): if not username or not password: return + import rqdatac + self.rq_client = rqdatac self.rq_client.init(username, password, ('rqdatad-pro.ricequant.com', 16011))