Пример #1
0
    async def onStart(self, event: Event) -> None:
        # Create an instrument
        inst = Instrument(name=self._symbol, type=InstrumentType(self._symbol_type))

        # Subscribe
        await self.subscribe(inst)
        print("Subscribing to {}".format(inst))
Пример #2
0
    async def onStart(self, event: Event) -> None:
        # Create an instrument
        inst = Instrument(name=self._symbol,
                          type=InstrumentType(self._symbol_type))

        # Check that its available
        if inst not in self.instruments():
            raise Exception("Not available on exchange: {}".format(
                self._symbol))

        # Subscribe
        await self.subscribe(inst)
        print("Subscribing to {}".format(inst))