Esempio n. 1
0
class Account(object):

    def __init__(self, name):
        super(Account, self).__init__()
        self._name = name
        self._lot = Lot()

    @property
    def name(self):
        return self._name

    def add(self, spot, amount, t):
        assert isinstance(spot, Lot.Spot)
        self._lot.add(spot, amount, t)

    def remove(self, security, amount, t, mode):
        self._lot.remove(security, amount, t, mode)

    def get_total_amount_for_security(self, security, t):
        return self._lot.get_total_amount_for_security(security, t)

    def get_lot_as_dict(self, t):
        return self._lot.get_lot_as_dict(t)

    def get_securities_dict(self, t):
        return self._lot.get_securities_dict(t)
Esempio n. 2
0
 def __init__(self, name):
     super(Account, self).__init__()
     self._name = name
     self._lot = Lot()