robinhood-unofficial / pyrh

Python Framework to make trades with the unofficial Robinhood API
https://pyrh.readthedocs.io/en/latest/
MIT License
1.77k stars 603 forks source link

Get Current Portfolio #267

Closed Arunprakash1990 closed 3 years ago

Arunprakash1990 commented 4 years ago

I get the below error message when I try to get the current Portfolio:

AttributeError: 'Robinhood' object has no attribute 'portfolio'

It would be great if you can help with this request, Thanks!

thiteixeira commented 4 years ago

I don't think Robinhood.portofolio is a valid method. See https://github.com/robinhood-unofficial/pyrh/blob/master/pyrh/robinhood.py

ricardoprins commented 4 years ago

Yeah. you should use portfolios() to get the portfolio.

It returns a JSON with the following structure: { "url": portfolio URL, "account": account URL, "start_date": account start date, "market_value": account market value, "equity": equity value, "extetended_hours_market_value": self explanatory, "extended_hours_equity": self explanatory, "extended_hours_portfolio_equity": self explanatory, "last_core_market_value": self explanatory, "last_core_equity": self explanatory, "last_core_portfolio_equtity": self explanatory, "excess_margin": self explanatory, "excess_maintenance": self explanatory, "excess_margin_with_uncleared_deposits": self explanatory, "excess_maintenance_with_uncleared_deposits": self explanatory, "equity_prevucious_close": self explanatory, "portfolio_equity_previous_close": self explanatory, "adjusted_equity_previous_close": self explanatory, "adjusted_portfolio_equity_previous_close": self explanatory, "withdrawable_amount": self explanatory, "unwithdrawable_deposits": self explanatory, "unwithdrawable_grants": self explanatory }

It is important to note that it is an aggregate value;

If you want to get the individual value for your instruments, then the method is positions().

stale[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] commented 3 years ago

Closing this issue automatically because it has not had any activity since it has been marked as stale. If you think it is still relevant and should be addressed, feel free to open a new one.