gofinance / ib

Pure Go interface to Interactive Brokers IB API
386 stars 120 forks source link

Sell in FA Group #14

Open dshanabrook opened 9 years ago

dshanabrook commented 9 years ago

I am trying to sell in a financial advisor group. The Java example provided by IB looks like this:

Contract m_contract = new Contract();
Order m_order = new Order();
.
.
// allocate the order for this group
m_order.m_faGroup = "USGroup";
// using the percent change method
m_order.m_faMethod = "PctChange";
m_order.m_faPercentage = "100";

m_client.placeOrder(orderId++, m_contract, m_order);

However, when I try a similar bit of code, setting the FA attributes on the Order, the consul says:

You must specify an allocation (either a single account, group, or profile).

Any ideas?

dsouzae commented 9 years ago

I am not familiar with advisor accounts. You might want to start with this IB Java API for Advisors.

A few internet searches may solve your problem, I've found the same error message discussed over here: https://github.com/ib-ruby/ib-ruby/issues/60

dshanabrook commented 9 years ago

I thought I was setting things up right: request.Order.FAMethod = "PctChange" request.Order.FAPercentage = "-100" request.Order.FAGroup = "everyone" Not sure what I should do besides setting up the FAGroup. Another approach would be to get the stock positions held in each account, yet I can't figure this out either.