import robin_stocks as r
r.login("yourusername","yourpassword")
然后使用build_holdings()之类的函数,它将返回有关您帐户持有情况的信息
holdings = r.account.build_holdings()
返回:
Returns a dictionary where the keys are the stock tickers and the value is another dictionary that has the stock price, quantity held, equity, percent change, equity change, type, name, id, pe ratio, percentage of portfolio, and average buy price.
有一个名为pyrh的库用于访问RobinHood API
在像库文档中描述的那样进行身份验证之后,您可以使用类pyrh.robinood提供的方法来收集数据
像这样的东西可能有用
我不确定投资组合数据以何种形式出现,因此您可能需要对其进行迭代以将其转换为列表
Robinhood API当前维护的python库是robin_stocks
为了获得投资组合中的股票,您首先需要通过以下方式进行验证:
然后使用
build_holdings()
之类的函数,它将返回有关您帐户持有情况的信息返回:
包括所有持有的股票。图书馆文档是here
相关问题 更多 >
编程相关推荐