盈透证券的Java API得到所有的职位吗? [英] Interactive Brokers Java API get all positions?

查看:239
本文介绍了盈透证券的Java API得到所有的职位吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我通过IB的Java API去了,看不到任何函数获取在我的投资组合目前所有的股票/期权头寸。我所试图做的是:获得我的投资组合目前所有的/主动仓位(仓位可能会或可能不会从API发送),然后循环通过列表,关闭符合我的标准之一。有没有办法做到这一点?

I went through IB's java API and do not see any function for getting all current stock/option positions in my portfolio. What I am trying to do is: get all current/active positions in my portfolio ( positions may or may not sent from API ), then loop through the list to close the one that matches my criteria. Is there any way to do that?

感谢,

推荐答案

使用 reqAccountUpdates(真)方法开始接收有关帐户的事件。然后,你通过 updatePortfolio()事件方法所有位置。如果你不希望订阅帐户事件定期调用 reqAccountUpdates(假)来结束订阅。

Use the reqAccountUpdates(true) method to begin receiving events concerning the account. Then you get all positions through the updatePortfolio() event method. If you do not wish to subscribe to the account events periodically, call reqAccountUpdates(false) to end the subscription.

这篇关于盈透证券的Java API得到所有的职位吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆