Esempio n. 1
0
 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
Esempio n. 2
0
 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)
Esempio n. 3
0
    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
Esempio n. 4
0
 def GetPositions(self, portfolio, with_returns=False):
     query = PositionQuery()
     query.returns = with_returns
     return self.client.GetPositionFeed(portfolio, query=query).entry
Esempio n. 5
0
 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)