Problem with IBController


#1

Good afternoon
I tried using IBcontroller earlier on in august to pass automatic orders to IB (Interactive brokers) and everything worked fine: orders were created and sent to IB but not executed , which is fine since this is what I wanted.
I am trying again today with exactly the same code but amibroker is not sending anything to IBcontroller (and nothing to IB obviously).
IBController is launched and then nothing happens.

I am using Amibroker 5.6.
This is the code, which is exactly what you have in the readme that comes with the software.
Can you please let me know what is wrong with it? Has something changed in the last 4 weeks?
Thanks!

///////////CODE////////////
if( LastValue( Buy ) )
{
ibc = GetTradingInterface(“IB”);
// check if we are connected OK
if( ibc.IsConnected() )
{
// check if we do not have already open position on this stock
if( ibc.GetPositionSize( Name() ) == 0 )
{
// transmit order
ibc.PlaceOrder( “EUR.USD-IDEAPRO-CASH”, “Buy”, 20000, “MKT”, 0, 0, “Day”, False );
}
}
}
////END CODE//////


#2

My guess is that you have upgraded TWS and are using a new version. Nothing wrong with IBController 1.3.8. Once you find a TWS version that works, never upgrade it until you have to and that can be years of good usage.

Jorgen


#3

ok thanks, you are probably right. Anyone can show me where i can download previous version of TWS? I checked on the internet but couldn’t find a link anywhere…
thanks!


#4

I just wanted to let you know that i sorted out my issue. i had a tiny positive balance in EUR that meant the first condition of the code was always false!!! thing is that only IB controller picked up this amount while the IB interface is not showing it for some reason.