05-08-2010, 09:06 AM
|
#3 |
Join Date: May 2010 Location: Albany, NY Thanks: 9
Thanked 0 Times in 0 Posts
| Re: Interactive Brokers API - Market Scanners Thanks for that link. I was aware that IB had a forum, but I assumed it's content would be included in my Google search. They must not allow caching of their forum. Anyways, I'm not actually an IB member yet (I don't have the $10,000 minimum balance), so I couldn't actually post my question, but I did search through the forum and I finally found the solution.
It's actually a bug (which hasn't been fixed for several years). For some reason, the value for averageOptionVolumeAbove automatically gets set to Integer.MAX_VALUE. This needs to be set to 0 (or some other reasonable value) in order for the scanner to work. I adjusted my code accordingly and it worked just fine. Here is the working code: Code: EClientSocket client = new EClientSocket(this);
client.eConnect("", 7496, 0);
ScannerSubscription filter = new ScannerSubscription();
filter.numberOfRows(10);
filter.instrument("STK");
filter.locationCode("STK.US");
filter.scanCode("MOST_ACTIVE");
filter.averageOptionVolumeAbove(0);
client.reqScannerSubscription(0, filter); |
| |