forked from QuantFans/quantdigger
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathshell.py
More file actions
72 lines (59 loc) · 2.01 KB
/
Copy pathshell.py
File metadata and controls
72 lines (59 loc) · 2.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
# -*- coding: utf-8 -*-
import six
from quantdigger.event.rpc import EventRPCClient
from quantdigger.event.eventengine import ZMQEventEngine
from quantdigger.interaction.interface import BackendInterface, UIInterface
from quantdigger.interaction import(
BackendInterface,
Backend,
WindowGate,
UIInterface
)
from quantdigger.util import mlogger as log
class Shell(BackendInterface, UIInterface):
""" 终端接口类,可通过它在python终端上操作界面和后台代码。 """
def __init__(self):
log.info("Init Shell..")
self._engine = ZMQEventEngine('Shell')
self._engine.start()
self.gate = EventRPCClient('Shell',
self._engine,
WindowGate.SERVER_FOR_SHELL)
self._backend = EventRPCClient('test_shell',
self._engine,
Backend.SERVER_FOR_SHELL)
def get_all_pcontracts(self):
pass
def get_all_contracts(self):
ret = self._backend.sync_call("get_all_contracts")
six.print_("****" )
six.print_(ret)
six.print_("****" )
#"""docstring for get_all_contracts"""
#six.print_("------------------" )
#six.print_("get-all-contracts" )
#six.print_(pcontract)
#six.print_("------------------" )
#return "world"
def show_data(self, strpcontract):
"""docstring for load_pcontract"""
return self.gate.sync_call("show_data", {
'pcontract': strpcontract
})
def get_pcontract(self, pcontract):
"""docstring for get_data"""
pass
def run_strategy(self, name):
""""""
return
def run_technical(self, name):
return
def get_technicals(self):
""" 获取系统的所有指标。 """
return
def get_strategies(self):
return 'hello'
def plot(self):
"""docstring for plo"""
six.print_("plot" )
shell = Shell()