Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Misc. changes
  • Loading branch information
dmichalowicz committed Feb 9, 2016
1 parent 7c378c4 commit 739b15b
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion tests/test_algorithm.py
Expand Up @@ -1882,7 +1882,7 @@ def test_auto_close_future(self):
# Check results
results = algo.run(data)

expected_positions = [0, 1, 1, 0]
expected_positions = [0, 1, 1, 1]
self.check_algo_positions(results, expected_positions)

expected_pnl = [0, 0, 1, 2]
Expand Down
4 changes: 3 additions & 1 deletion zipline/finance/performance/position_tracker.py
Expand Up @@ -18,6 +18,7 @@
import logbook
import numpy as np
import pandas as pd
import uuid
from pandas.lib import checknull
from collections import namedtuple
try:
Expand All @@ -27,6 +28,7 @@
from collections import OrderedDict
from six import iteritems, itervalues


from zipline.protocol import Event, DATASOURCE_TYPE
from zipline.finance.transaction import Transaction
from zipline.utils.serialization_utils import (
Expand Down Expand Up @@ -383,7 +385,7 @@ def maybe_create_close_position_transaction(self, event):
dt=event.dt,
price=price,
commission=0,
order_id=0
order_id=uuid.uuid4().hex,
)
return txn

Expand Down
1 change: 0 additions & 1 deletion zipline/test_algorithms.py
Expand Up @@ -963,7 +963,6 @@ def handle_data(self, data):
for s in data:
self.order(self.sid(s), 10)

# if self.get_datetime() > data[0]['dt']:
if self.get_datetime() == pd.Timestamp('2015-01-07', tz='UTC'):
# This creates a persisting open order, as Equity 0 will delist.
self.order(self.sid(0), 10)
Expand Down

0 comments on commit 739b15b

Please sign in to comment.