Profile Picture

Having trouble with TWS conection

Posted By jbk Last Year
Message
jbk
Supreme Being (994 reputation)Supreme Being (994 reputation)Supreme Being (994 reputation)Supreme Being (994 reputation)Supreme Being (994 reputation)Supreme Being (994 reputation)Supreme Being (994 reputation)Supreme Being (994 reputation)Supreme Being (994 reputation)
Posted Thursday September 08 2016
Hi everbody!
I need some help to get live data working and to also live backtest with IB.
I configured as posted here:  https://www.rightedgesystems.com/Data-Provider-Error.aspx 

1) Now, when going on option one, seems to me there has to be used a plugin named "Interactive Brokers Trader Workstation" , as for the second option states "... DO NOT select the plugin named "Interactive Brokers Trader Workstation".... . Any way using the only Interactive Brokers Plugin, this option (with sockets not enabled in  TWS), connects to live data with this error:

The service plugin RightEdge.TWSCSharpPlugin.TWSPlugin threw an exception of type System.Net.Sockets.SocketException at RightEdge.Shared.ServiceWrapper.DoError(Exception e) at RightEdge.Shared.ServiceWrapper.Connect(ServiceConnectOptions connectOptions) at RightEdge.Shared.LiveDataManager.AddService(String serviceName) at RightEdge.Shared.LiveDataManager.AddSymbols(IEnumerable`1 symbols) at RightEdge.LiveDatawindow.AddSymbols(IEnumerable`1 symbols) at RightEdge.MainForm.884f25645664b9833ef20da5318cc16ff4771519992ef172d7787cc3375b921e() at RightEdge.MainForm.0a1b2826b15703e5c077ced41ce3674eeded862210c6f16b21c5bba1bb828fef(Object , EventArgs )Inner Exception:An exception of type System.Net.Sockets.SocketException was thrown.No connection could be made because the target machine actively refused it 127.0.0.1:7496 at System.Net.Sockets.TcpClient..ctor(String hostname, Int32 port) at Krs.Ats.IBNet.IBClient.Connect(String host, Int32 port, Int32 clientId) at RightEdge.TWSCSharpPlugin.TWSPlugin.Connect(ServiceConnectOptions connectOptions) at RightEdge.Shared.ServiceWrapper.Connect(ServiceConnectOptions connectOptions) 

2 ) When going on the second option, using only TWS; having  enabled sockets and listening port 7496 on 127.0.0.1 (TWS runs on the same virtual machine - parallels), historical data for ie EUR/USD comes OK (by manual request), but no live data comes and no live trade (on paper account) starts. If a manual order is placed a connection error outputs:

Unexpected order cancel: OpenPosition: 4: Market Buy EUR/USD 0/1 - Rejected - Discretionary IB error/warning 200: No security definition has been found for the requestEUR/USDSymbol Script8/9/2016 17:14:08

Many thanks in advance!
jbk
Posted Friday September 09 2016
The page mentioning two different versions of the Interactive Brokers plugin was way out of date.  There's only one.  I've updated that page.

Probably you aren't able to get live data or trade the symbol because you don't have the exchange set to the right value.  An easy way to set up your symbols with TWS is to right click on a folder in the watchlist, select "Add Symbols From", and then select "TWS...".  You will get a dialog like this where you can search for available symbols from Interactive Brokers and then choose them to be added to your watch list:

http://www.rightedgesystems.com/forums/uploads/images/fad45a87-5a17-4e8f-bb64-8d5c.png

You can see that I specified EUR for the symbol name, Forex for the Asset type, and USD for the currency and there is one result, using the exchange IDEALPRO.  So I could go into my symbol configuration and set the exchange to IDEALPRO, or I could just select the symbol in the result grid, click OK, and it would be added to the watchlist folder I originally right clicked on.

Thanks,
Daniel
jbk
Supreme Being (994 reputation)Supreme Being (994 reputation)Supreme Being (994 reputation)Supreme Being (994 reputation)Supreme Being (994 reputation)Supreme Being (994 reputation)Supreme Being (994 reputation)Supreme Being (994 reputation)Supreme Being (994 reputation)
Posted Friday September 09 2016
Hi Daniel,

Thanks for your prompt replay!!

And yes that was my mistake, now adding the symbol that way, all setup and it works perfect!

Again Thank you very much!

jbk



Similar Topics


Reading This Topic


2005-2017 © RightEdge Systems