Beispiel #1
0
 def __init__(self):
     ServicePlugin.__init__(self)
     self.markets = {}
     self.books = {}
     self.trade_history = {}
     self.ohlcv_history = {}
     self.safe_prices = {}
Beispiel #2
0
 def __init__(self):
     ServicePlugin.__init__(self)
     self.markets = {}
     self.books = {}
     self.trade_history = {}
     self.ohlcv_history = {}
     self.safe_prices = {}
Beispiel #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)
Beispiel #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)
Beispiel #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)
Beispiel #6
0
 def __init__(self):
     ServicePlugin.__init__(self)
Beispiel #7
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)
Beispiel #8
0
 def __init__(self):
     ServicePlugin.__init__(self)