Skip to content

Commit a6c7303

Browse files
committedApr 27, 2015
modified portfolio accessor
1 parent fc849ef commit a6c7303

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed
 

‎tia/analysis/model/txn.py

+6-6
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
from tia.util.decorator import lazy_property
44
from tia.analysis.model.interface import TxnColumns as TC
5-
from tia.analysis.model.pl import Pl
5+
from tia.analysis.model.pl import ProfitAndLoss
66
from tia.analysis.model.ret import RoiiRetCalculator
77
from tia.analysis.util import is_decrease, is_increase, crosses_zero
88

@@ -68,8 +68,8 @@ def __init__(self, trades, pricer, ret_calc=None):
6868
self.ret_calc = ret_calc or RoiiRetCalculator()
6969

7070
pids = property(lambda self: self.frame[TC.PID].unique())
71-
pl = lazy_property(lambda self: Pl(self), 'pl')
72-
rets = lazy_property(lambda self: self.ret_calc.compute(self), 'rets')
71+
pl = lazy_property(lambda self: ProfitAndLoss(self), 'pl')
72+
performance = lazy_property(lambda self: self.ret_calc.compute(self), 'performance')
7373

7474
@lazy_property
7575
def frame(self):
@@ -136,9 +136,9 @@ def subset(self, pids):
136136
# build the object
137137
result = Txns(trds, self.pricer, self.ret_calc)
138138
result._frame = self.frame.ix[pmask]
139-
if hasattr(self, '_pl'):
140-
pl = self.pl
141-
result._pl = pl.subset(result)
139+
if hasattr(self, '_profit_and_loss'):
140+
pl = self.profit_and_loss
141+
result._profit_and_loss = pl.subset(result)
142142
return result
143143

144144

0 commit comments

Comments
 (0)
Please sign in to comment.