Esempio n. 1
0
    def __init__(self):
        Strategy.__init__(self)
        from marketsim._pub import strategy, side

        self._seller = strategy.price.Ladder(self.orderFactory, self.initialSize, side.Sell())
        self._buyer = strategy.price.Ladder(self.orderFactory, self.initialSize, side.Buy())

        event.subscribe(self._seller.on_order_created, _(self)._send, self)
        event.subscribe(self._buyer.on_order_created, _(self)._send, self)
Esempio n. 2
0
 def __init__(self):
     Strategy.__init__(self)
     self._current = None
     self._estimators = []
     for s in self.strategies:
         event.subscribe(s.on_order_created, _(self).send, self)
         e = self.performance(self.account(s))
         e._origin = s
         self._estimators.append(e)
     event.subscribe(event.Every(constant(1.)), _(self)._wakeUp, self)
 def __init__(self):
     Strategy.__init__(self)
     self._current = None
     self._estimators = []
     for s in self.strategies:
         event.subscribe(s.on_order_created, _(self).send, self)
         e = self.normalizer(self.weight(self.account(s)))
         e._origin = s
         self._estimators.append(e)
     event.subscribe(event.Every(constant(1.)), _(self)._wakeUp, self)
Esempio n. 4
0
    def __init__(self):
        Strategy.__init__(self)
        from marketsim._pub import trader, orderbook
        self._balance = trader.Balance()
        self._position = trader.Position()
        self._pendingVolume = trader.PendingVolume()
        self._internalSuspended = False

        event.subscribe(self.inner.on_order_created, _(self)._send, self)
        event.subscribe(self.predicate, _(self)._wakeUp, self)
Esempio n. 5
0
    def __init__(self):
        Strategy.__init__(self)

        # our order book
        self._book = OfTrader()
        # our order queue
        self._orderQueue = Queue(self._book, side = self.side)
        # we are going to track best price changes
        self._source = self._orderQueue.BestPrice
        event.subscribe(self._source, _(self)._wakeUp, self)
        # deque containing issued orders
        self._orders = None
        # how many orders can be issued
        self._size = self.initialSize
        self._suspended = False
Esempio n. 6
0
 def __init__(self):
     Strategy.__init__(self)
     event.subscribe(self.inner.on_order_created, _(self).onOrderCreated, self)
Esempio n. 7
0
 def __init__(self):
     Strategy.__init__(self)
     from marketsim import event, _
     event.subscribe(self.eventGen, _(self)._wakeUp, self)
Esempio n. 8
0
 def __init__(self):
     Strategy.__init__(self)
     for s in [self.A, self.B]:
         event.subscribe(s.on_order_created, _(self)._send, self)
Esempio n. 9
0
 def __init__(self):
     Strategy.__init__(self)
     for s in self.strategies:
         event.subscribe(s.on_order_created, _(self)._send, self)
Esempio n. 10
0
 def __init__(self):                
     Strategy.__init__(self)
     from marketsim import event, _
     event.subscribe(self.eventGen, _(self)._wakeUp, self)
Esempio n. 11
0
 def __init__(self):
     Strategy.__init__(self)
     event.subscribe(self.predicate, _(self)._wakeUp, self)
     event.subscribe(self.inner.on_order_created, _(self)._send, self)
     self._suspended = False
Esempio n. 12
0
 def __init__(self):
     Strategy.__init__(self)
     event.subscribe(self.inner.on_order_created, _(self)._send, self)
Esempio n. 13
0
 def __init__(self):
     Strategy.__init__(self)
     for s in [self.A, self.B]:
         event.subscribe(s.on_order_created, _(self)._send, self)
Esempio n. 14
0
 def __init__(self):
     Strategy.__init__(self)
     for s in self.strategies:
         event.subscribe(s.on_order_created, _(self)._send, self)