def __init__(self): Strategy.__init__(self) props = { k : getattr(self, k) for k in self._properties.iterkeys() } sp = merge_dict(props, side=Side.Sell) bp = merge_dict(props, side=Side.Buy) self._sell = LiquidityProviderSide(**sp) self._buy = LiquidityProviderSide(**bp)
def __init__(self): Strategy.__init__(self) props = dict([(k, getattr(self, k)) for k in self._properties.iterkeys() ]) sp = merge_dict(props, side=Side.Sell) bp = merge_dict(props, side=Side.Buy) self._sell = LiquidityProviderSide(**sp) self._buy = LiquidityProviderSide(**bp) event.subscribe(self._sell.on_order_created, _(self)._send, self) event.subscribe(self._buy.on_order_created, _(self)._send, self)
class _LiquidityProvider_Impl(Strategy): def __init__(self): Strategy.__init__(self) props = { k : getattr(self, k) for k in self._properties.iterkeys() } sp = merge_dict(props, side=Side.Sell) bp = merge_dict(props, side=Side.Buy) self._sell = LiquidityProviderSide(**sp) self._buy = LiquidityProviderSide(**bp) _internals = ['_sell', '_buy'] def suspend(self, s): Strategy.suspend(self, s) self._sell.suspend(s) self._buy.suspend(s) @property def suspended(self): assert self._sell.suspended == self._suspended assert self._buy.suspended == self._suspended return Strategy.suspended(self) def dispose(self): self._sell.dispose() self._buy.dispose()
class _LiquidityProvider_Impl(Strategy): def __init__(self): Strategy.__init__(self) props = dict([(k, getattr(self, k)) for k in self._properties.iterkeys() ]) sp = merge_dict(props, side=Side.Sell) bp = merge_dict(props, side=Side.Buy) self._sell = LiquidityProviderSide(**sp) self._buy = LiquidityProviderSide(**bp) event.subscribe(self._sell.on_order_created, _(self)._send, self) event.subscribe(self._buy.on_order_created, _(self)._send, self) _internals = ['_sell', '_buy'] def dispose(self): self._sell.dispose() self._buy.dispose()