Пример #1
0
 def run(self):
     print(self.name)
     config = get_task_config(self.name)
     account_id = config["account_id"]
     db_file = config["db_file"]
     is_loop = config["is_loop"]
     self.sandbox = sandbox.MdService(account_id, db_file, is_loop)
     thread = threading.Thread(target=self.sandbox.run)
     while True:
         time.sleep(1)
Пример #2
0
 def __init__(self, name):
     self.name = name
     self.xtp = None
     self.config = get_task_config(self.name)
     self.client_id = self.config.get("client_id", 1)
     self.log_level = self.config.get("log_level", SPDLOG_LEVEL_INFO)
     self.software_key = self.config["software_key"]
     self.user_id = self.config["user_id"]
     self.password = self.config["password"]
     self.ip = self.config["td_ip"]
     self.port = self.config["td_port"]
     self.save_path_file = "{}/runtime".format(os.environ['KF_HOME'])
Пример #3
0
    def run(self):
        self.config = get_task_config(self.name)
        self.account_id = self.config["account_id"]
        self.broker_id = self.config["broker_id"]
        self.password = self.config["password"]
        self.front_uri = self.config["td_uri"]
        self.log_level = self.config.get("log_level", SPDLOG_LEVEL_TRACE)

        self.ctp = ctp.TdGateway(self.front_uri, self.broker_id,
                                 self.account_id, self.password,
                                 self.log_level)
        self.ctp.init()
        self.ctp.start()
Пример #4
0
    def run(self):
        self.config = get_task_config(self.name)
        print("run {} with config {}".format(self.name, self.config))
        self.client_id = self.config.get("client_id", 1)
        self.user_id = self.config["user_id"]
        self.password = self.config["password"]
        self.ip = self.config["md_ip"]
        self.port = self.config["md_port"]
        self.log_level = self.config.get("log_level", SPDLOG_LEVEL_INFO)
        self.save_path_file = "{}/runtime".format(os.environ['KF_HOME'])

        self.xtp = xtp.MdGateway(self.client_id, self.save_path_file, self.ip, self.port, self.user_id, self.password, self.log_level)
        self.xtp.init()
        self.xtp.start()
Пример #5
0
    def run(self):
        self.config = get_task_config(self.name)
        print("run {} with config {}".format(self.name, self.config))
        self.account_id = self.config["account_id"]
        self.broker_id = self.config["broker_id"]
        self.password = self.config["password"]
        self.front_uri = self.config["md_uri"]
        self.log_level = self.config.get("log_level", SPDLOG_LEVEL_TRACE)

        self.ctp = ctp.MdGateway(self.front_uri, self.broker_id,
                                 self.account_id, self.password,
                                 self.log_level)
        self.ctp.init()
        self.ctp.start()