Example #1
0
 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)
Example #2
0
 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)
Example #3
0
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()
Example #4
0
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()