def GetPositions(self, portfolio, with_returns=False, inline_transactions=False): query = PositionQuery() query.returns = with_returns query.transactions = inline_transactions return self.client.GetPositionFeed(portfolio, query=query).entry
def GetPosition(self, portfolio, ticker, with_returns=False, inline_transactions=False): query = PositionQuery() query.returns = with_returns query.transactions = inline_transactions return self.client.GetPosition(portfolio_id=portfolio.portfolio_id, ticker_id=ticker, query=query)
def GetPositions(self, portfolio_id="1", with_returns=True): from gdata.finance.service import PositionQuery query = PositionQuery() query.returns = with_returns wait = 0.1 while True: try: feed = self.client.GetPositionFeed(portfolio_id=portfolio_id, query=query).entry break except Exception, e: from time import sleep sleep(wait) wait *= 2
def GetPositions(self, portfolio, with_returns=False): query = PositionQuery() query.returns = with_returns return self.client.GetPositionFeed(portfolio, query=query).entry
def GetPosition(self, portfolio, ticker, with_returns=False, inline_transactions=False): query = PositionQuery() query.returns = with_returns query.transactions = inline_transactions return self.client.GetPosition( portfolio_id=portfolio.portfolio_id, ticker_id=ticker, query=query)