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
65 lines (52 loc) · 1.9 KB
/
Copy pathshell.py
File metadata and controls
65 lines (52 loc) · 1.9 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
# -*- coding: utf-8 -*-
from quantdigger.config import ConfigInteraction
from quantdigger.event.rpc import EventRPCClient
from quantdigger.event.eventengine import ZMQEventEngine
from quantdigger.interaction.interface import BackendInterface, UIInterface
from quantdigger.util import mlogger as log
from quantdigger.interaction.backend import backend
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,
ConfigInteraction.ui_server_for_shell)
self._backend = EventRPCClient('test_shell', self._engine,
ConfigInteraction.backend_server_for_shell)
def get_all_pcontracts(self):
pass
def get_all_contracts(self):
ret = self._backend.sync_call("get_all_contracts")
print "****"
print ret
print "****"
#"""docstring for get_all_contracts"""
#print "------------------"
#print "get-all-contracts"
#print pcontract
#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"""
print "plot"
shell = Shell()