示例#1
0
 def __init__(self):
     ServicePlugin.__init__(self)
     self.markets = {}
     self.books = {}
     self.trade_history = {}
     self.ohlcv_history = {}
     self.safe_prices = {}
示例#2
0
 def __init__(self):
     ServicePlugin.__init__(self)
     self.markets = {}
     self.books = {}
     self.trade_history = {}
     self.ohlcv_history = {}
     self.safe_prices = {}
示例#3
0
 def register(self, endpoint, procedure=None, options=None):
     results = yield ServicePlugin.register(self,
                                            endpoint,
                                            procedure,
                                            options=RegisterOptions(
                                                details_arg="details",
                                                discloseCaller=True))
     returnValue(results)
示例#4
0
    def init(self):
        yield ServicePlugin.init(self)

        self.db = self.require("sputnik.webserver.plugins.db.postgres.PostgresDatabase")
        self.administrator = self.require("sputnik.webserver.plugins.backend.administrator.AdministratorProxy")
        contracts = yield self.db.get_contracts()
        for contract in contracts:
            yield self.load_contract(contract)
            self.trade_history[contract] = yield self.db.get_trade_history(contract)

            # Clear ohlcv history
            self.ohlcv_history[contract] = {}

            # Fill ohlcv history
            for period in ["minute", "hour", "day"]:
                for trade in self.trade_history[contract]:
                    self.update_ohlcv(trade, period=period)
示例#5
0
    def init(self):
        yield ServicePlugin.init(self)

        self.db = self.require("sputnik.webserver.plugins.db.postgres.PostgresDatabase")
        self.administrator = self.require("sputnik.webserver.plugins.backend.administrator.AdministratorProxy")
        contracts = yield self.db.get_contracts()
        for contract in contracts:
            yield self.load_contract(contract)
            self.trade_history[contract] = yield self.db.get_trade_history(contract)

            # Clear ohlcv history
            self.ohlcv_history[contract] = {}

            # Fill ohlcv history
            for period in ["minute", "hour", "day"]:
                for trade in self.trade_history[contract]:
                    self.update_ohlcv(trade, period=period)
示例#6
0
文件: token.py 项目: ysobolev/sputnik
 def __init__(self):
     ServicePlugin.__init__(self)
示例#7
0
文件: token.py 项目: ysobolev/sputnik
 def register(self, endpoint, procedure = None, options = None):
     results = yield ServicePlugin.register(self, endpoint, procedure, options=RegisterOptions(details_arg="details", discloseCaller=True))
     returnValue(results)
示例#8
0
 def __init__(self):
     ServicePlugin.__init__(self)