- ago
Currently, the IB API runs through the TWS. IB supports a direct API that does not require TWS. Implementing this API approach would address these current issues with the current implementation:

1. It would eliminate the overhead of having to restart WL8 each day, as TWS requires daily restart
2. It should be a more robust connect to IB, and presumably a more reliable connect of WL8 to the broker.
3. It may address additional limitations of the TWS approach, including the difficulty WL8 supporting multiple IB accounts.

.
13
2,987
Solved
36 Replies

Reply

Bookmark

Sort
- ago
#1
What is the "direct" IB API?
0
- ago
#2
QUOTE:
What is the "direct" IB API?

I think he means using the RESTful endpoint IB has rather than hooking into the TWS application as is done now. This was discussed in another post a couple weeks ago. In that post I "think" Cone said that REST endpoint was missing a few trading types (but I could be wrong).
0
- ago
#3
HI guys,

I believe @superticker is correct. I'm afraid I am conflating the FIX and RESTful API solutions at IB: https://www.interactivebrokers.com/en/index.php?f=5041

superticker has recently posted about both FIX and RESTful as potential next gen approaches to the current broker API's.

My purpose was to take TWS out of the picture for connecting to the broker. I'm not sure which approach is better. I'm also not sure if this request is already covered by another feature request. I found this from @Glitch, but it's technically not marked as a feature request:

https://www.wealth-lab.com/Discussion/FIX-Base-Broker-Provider-5938
0
- ago
#4
I found this recent discussion of IB REST interface as well as @superticker post commenting on both REST and FIX (last thread at bottom).

https://www.wealth-lab.com/Discussion/Multi-account-trading-with-WL8-7949

Doesn't look like this is marked as an official feature request either; it's more of a discussion of options.

There is some caution in this post that the REST approach will not have all the trading features of TWS. I don't see an analysis of FIX potential features.

0
- ago
#5
QUOTE:
There is some caution in this post that the REST approach will not have all the trading features of TWS. I don't see an analysis of FIX potential features.

The FIX approach will have the least number of features "today," but that will change "tomorrow" as brokers fill out their FIX offerings.

What we should be doing is building modern, "hybrid," broker providers by using FIX whenever possible then "padding the gaps" with non-FIX calls. Later that padded implementation can be removed as the broker improves his FIX offerings. Perhaps this should be discussed in the FIX feature request topic. https://www.wealth-lab.com/Discussion/FIX-Base-Broker-Provider-5938
0
- ago
#6
The FIX API at IB lacks too many features to be useful. @Glitch believes that dropping tick data may be worth the effort to swap the TWS API for the Client Portal (REST) API. Let's rename the topic title then.
0
Cone8
 ( 23.73% )
- ago
#7
Here's something from the FAQ page that might make this option slightly less attractive than using TWS - https://interactivebrokers.github.io/cpwebapi/faq.html

- No automatic login, and,
- like for a web session, you must use a 2FA device to login, and,
- you still have to refresh the session daily

In other words, you MUST use a 2FA device to login, whereas this is optional when trading with TWS.
0
- ago
#8
You still have to refresh the session daily - what's the benefit compared to having to restart the TWS then?
0
Glitch8
 ( 14.35% )
- ago
#9
The benefit is you don’t need to run TWS.
0
Cone8
 ( 23.73% )
- ago
#10
Personally, I see TWS as an aid, not a hinderance while trading, and, I don't have to use 2FA to start it. And fwiw, no one has even voted for this yet!
0
- ago
#11
QUOTE:
you MUST use a 2FA device to login; whereas, this is optional when trading with TWS.

By "device" are we talking about a hardware device like a YubiKey?
https://www.yubico.com/product/security-key-nfc-by-yubico/ IB's website isn't that clear. Most 2FA sites (e.g. my local bank) only require you authenticate once, then they store a cookie so you're good sometime into the future.

2FA is a good idea, but I'm not so keen on the "hardware" requirement, especially if all you're doing is trading within an account. Now if you're transferring money out of an account, that's a different story. But WL isn't doing that, nor should it have that authority. IB needs to offer different levels of account access, and WL only needs the lowest level.
0
Cone8
 ( 23.73% )
- ago
#12
@superticker
Do you have an IB account?

2FA doesn't work in any of the ways you mentioned at IB. It's a challenge/response every time you log in, although you can set the IB Key app for facial recog too.
0
- ago
#13
QUOTE:
2FA ... It's a challenge/response every time you log in, although you can set the IB Key app for facial recog too.

So IB's 2FA involves using a phone app instead of a YubiKey? And you need to do that for each login? Using the YubiKey would be simpler and more secure. And some YubiKeys feature fingerprint readers.

I think for "only trading" (which is what WL is doing), that's too much security. They should tier their security better. And someone should tell them that.

QUOTE:
And fwiw, no one has even voted for this yet!

Well that's the real problem. Perhaps the features of the REST endpoint aren't there as yet.
0
- ago
#14
I have been using TWS w/ WL8 to auto trade. The only reason I am using IB/TWS is because they allow certain trading functions that other brokers don't (specifically stacking a Limit and MOC order for the same transaction). Their support of OCO seems to work seamlessly with WL API. I think they may have the best support for Options trading with API, but I haven't tested that. The other reason one might want to use BI/TWS is that their margin fees are very low.

If the GTD feature is developed for Limit trades in WL, or some other way to address broker restrictions on trade constructs, I would be able to use other brokers. I won't go into all the reasons not to stay with BI, some of which are mentioned here and others that are non-technical.

I have also tried TDA and Tradier. Both companies have excellent, accessible, customer support, especially for non-technical users like me.

Tradier seems to have a very simple (I mean that positively) approach. Tradier offers a free sandbox account, which will run with the WL API for testing. Unfortunately, their broker trading constructs are not up to today's standards (no support of OCO, MOO, MOC, for example.)

I believe TDA is the best example of the way WL should work with a broker API. When I open or restart WL, TDA is automatically connected. No login. No daily restart. It just works. Every time. The API connect seems to be bulletproof. TDA appears to support most of the modern trading constructs but not everything I need.

The points raised here about IB REST API not being much of an upgrade might be valid. And there could be new issues with their REST implementation that we won't be aware of until we start using it. I can understand the hesitancy to want to invest in API development for software that has to restart every day. And that requires login each day to use API through WL.

BTW, the TWS login I am using requires U/N & P/W login + fingerprint from my mobile phone. TWS is supposed to be able to restart itself each day (except Sunday) without login, but it doesn't always work, at least not for me. The fact that WL8 requires a restart after TWS restarts each day (login-free or not) only compounds the overhead issue.
1
- ago
#15
QUOTE:
TWS login ... requires U/N & P/W login + fingerprint from my mobile phone.

Interesting. I have to wonder what happens if you drop your mobile phone?

I would encourage IB to support the YubiKey that has a fingerprint reader instead of using your mobile cellphone. The YubiKeys are indestructible and more secure; your mobile phone isn't. The YubiKeys also support KeyPass (i.e. a password key chain) and some support NFC.

Moreover, if all you're doing is trading (and not transferring money out of an account), then the bar on security could be lower. And you should tell them that.

Thanks for the info.
0
Cone8
 ( 23.73% )
- ago
#16
QUOTE:
the TWS login I am using requires U/N & P/W login + fingerprint
That's because you've imposed that restriction in your account settings. 2FA is not required for TWS login.

re: yubikey
Changing the way another global company conducts their business is way off topic here. It's really not helpful.
1
- ago
#17
QUOTE:
That's because you've imposed that restriction in your account settings. 2FA is not required for TWS login.

@Cone I tried to figure out how to turn 2FA off but couldn't. I called IB tech support and was told the option to disable 2FA was removed a couple of months ago and is now a requirement to log in to TWS (and portal, I'm guessing). I was also told that users without 2FA currently will be required to sign up for it after n logins. This is an example of the type of non-technical issues I have with IB.

Does this info jibe with your experience? I presume you must be using 2FA.
0
Cone8
 ( 23.73% )
- ago
#18
It's not my experience, I haven't seen a notification to that effect, and here's how you can change it -

0
- ago
#19
Interesting. I don't have the Settings option for that choice. Maybe your account is grandfathered, at least for some period of time.

1
- ago
#20
QUOTE:
Interesting. I have to wonder what happens if you drop your mobile phone?

@superticker @Cone
Well, I didn't drop my phone, but it died on me. There is apparently no alternative to login to IBKR without a mobile phone (unless you have $1 million in your account). Otherwise, can't disable 2FA and they do not support any 2FA devices except mobile phone.

Could not believe how difficult it was to get access the account. Finally, after working with a support agent for about 30 minutes and answering about 8 challenge questions, I was issued a 48-hour token that allows me to login. I wonder if my phone is not fixed by then if I will have to go through the entire process again to get them to extend it.


1
Cone8
 ( 23.73% )
- ago
#21
Difficult to get to your account is good - that means the process is working. You wouldn't really want it to be easy, right?
1
- ago
#22
Sure, but 8 challenge questions?
0
Cone8
 ( 23.73% )
- ago
#23
I just noticed that I can also use a Key Card authentication from years ago. I don't know if that's still offered, but they give you a card with a bunch of challenge/response characters. It works, but it's pretty inconvenient since you have to have the card handy and type in the response. Better than answering 8 questions though!
0
- ago
#24
The card is no longer offered for new accounts (AFAIK) but it's very convenient if you have it. KeePass supports a neat TAN feature which can hold all of the 200+ keys. From what I remember it took me some patience to scratch off and input all of them.😃 So when challenged by IB I just invoked KeePass and retrieved a pair of codes.
0
Cone8
 ( 23.73% )
- ago
#25
Wish I had known that.. would have saved me from writing my own little app that auto-copied the response of the challenge to the clipboard ;)

1
- ago
#26
Nice! Maybe you can sell it to IB users.. :)
0
Cone8
 ( 23.73% )
- ago
#27
Keepass (or similar) is actually more convenient and keeps the codes securely. In all cases, you have to key in your codes. Later, you click the challenge numbers and Keepass copies them to the clipboard for a convenient paste.
0
Glitch8
 ( 14.35% )
- ago
#28
Why the star in the lower left?
0
Cone8
 ( 23.73% )
- ago
#29
It's the default label. When you enter the challenge, the response is displayed there. Anyway, even I'm using KeePass now because I usually have it open on the desktop :)
0
- ago
#30
QUOTE:
Personally, I see TWS as an aid, not a hinderance while trading, and, I don't have to use 2FA to start it.

From the IB REST API docs at https://interactivebrokers.github.io/cpwebapi/use-cases:

QUOTE:
Competing sessions

Only a single active brokerage session can exist for any username accross all IBKR services. If you are logged in to either Client Portal, TWS, or IBKR Mobile, make sure to log out and try reauthenticating your session Client Portal API again.

So not only no auto login in this API, it basically forces you to not have TWS running?
0
Cone8
 ( 23.73% )
- ago
#31
You have to log in once per week.
Then you can schedule daily restarts, which do not require login.

TWS or IB Gateway is required. That's the connection.
0
just8
- ago
#32
This feature request has now percolated to the top of the wish list with 9 votes.
I voted for it also, but with caveats.

If this RESTS API does not allow more automation, less software running and less mouse clicks, then the benefits are minimal for the effort and maintenance required.

QUOTE:
Innertrader: The points raised here about IB REST API not being much of an upgrade might be valid...


Post #7 by cone also poignant.
1
Glitch8
 ( 14.35% )
- ago
#33
I'm closing this one. The more I read about it the less appealing it is.

https://ibkrcampus.com/ibkr-api-page/webapi-doc/

It's not even a REST API to IBKR. It runs via some Java client application, then a localhost "server" for which you'll need to create your own certificate.

Finally there's this right from the doc:

"The Client Portal API is primarily targeted towards developers looking to create custom user interfaces with some trading and market data capabilities. It is not aimed at users looking to automate, at scale, common operations done through other platforms. For users looking to develop solutions that require a high throughput of requests, for example placing dozens of orders at a time, or subscribing to large amounts of market data, we recommend the TWS API instead."
2
Best Answer
- ago
#34
The Medved API supports Interactive Brokers. Perhaps the Medved broker extension "might" be a better option than going through TWS, but I'm only guessing. Of course, one would have to subscribe to a Medved account to use its broker extension for this.
0
- ago
#35
@Glitch. I started this feature request but this sounds like a good decision to me. My experience with IB performance has not been good., There have got to be better alternatives to invest valuable development time in, and as @superticker mentioned, Medved could be one.
0
Cone8
 ( 23.73% )
- ago
#36
@innertrader - respectfully, that's only your objective experience. IB Broker performance with and without WealthLab is excellent. There's no other broker connection that I've ever seen (in 30 years of trading) that is as responsive.

Your experience with "IB performance" is referring to data access. If you work within the known data constraints, you won't have a problem, like me. IB specifically tells you that they are not a data provider but will give you the data you need to trade with.

You can run 100 streaming symbols in the Strategy Monitor without a problem... you just can't expect to download reams of historical data on-demand and during market hours.

We've had our challenges getting some things to work well at IB, but nothing sums it up as concisely as Mr. Medved himself https://www.medvedtrader.com/www/frontend/blog/MT-Websocket-API

"There is very little standartization among [APIs], and every one of them has its own peculiarities and difficulties. Some (I am looking at you, IB), have been created so long ago and grew, like a fungus, to create an almost incomprehensible agglomeration of specification that is hard to wade through."
0

Reply

Bookmark

Sort