diff --git a/zipline/gens/tradesimulation.py b/zipline/gens/tradesimulation.py index 8ad54053..2f60c7e0 100644 --- a/zipline/gens/tradesimulation.py +++ b/zipline/gens/tradesimulation.py @@ -190,6 +190,8 @@ class AlgorithmSimulator(object): 'filled' : 0 }) + log.debug(order) + # Tell the user if they try to buy 0 shares of something. if order.amount == 0: zero_message = "Requested to trade zero shares of {sid}".format( diff --git a/zipline/optimize/algorithms.py b/zipline/optimize/algorithms.py index 30feaf59..cc438fd1 100644 --- a/zipline/optimize/algorithms.py +++ b/zipline/optimize/algorithms.py @@ -14,8 +14,8 @@ from zipline.lines import SimulatedTradingLite, SimulatedTrading from logbook import Logger - logger = Logger('Algo') + class BuySellAlgorithm(object): """Algorithm that buys and sells alternatingly. The amount for each order can be specified. In addition, an offset that will @@ -184,6 +184,7 @@ class BuySellAlgorithmNew(TradingAlgorithm): def handle_data(self, data): order_size = self.buy_or_sell * (self.amount - (self.offset**2)) self.order(self.sids[0], order_size) + logger.debug("ordering" + str(order_size)) #sell next time around. self.buy_or_sell *= -1 @@ -192,4 +193,4 @@ class BuySellAlgorithmNew(TradingAlgorithm): self.frame_count += 1 self.incr += 1 - from nose.tools import set_trace; set_trace() +