Profile Picture


Posted By jkhax0r 9 Years Ago
Posted Wednesday July 22 2009
Kind of annoying bug that keeps causing crashing and should be an easy fix.

RightEdge Ed1 - 384.

Anytime I press F3 (actually I am doing it with the intention of performing "Find Next" out of habit in my code editor!), I get the following crash. It seems to handle the exception properly when I click the "start" button but not after pressing F3. I get the following exception report, and then after clicking OK the program closes with the typical message to send error report to Microsoft. I'm guessing this call stack is useless since it happens AFTER clicking OK on the exception dialog, but here you go anyway.

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.xfb471916970b0c9e.xe6866150eef6f995(String x16284292da96d0ba)
at RightEdge.xfb471916970b0c9e.AddSymbol(SymbolSetup symbol)
at RightEdge.xf266856f631ec016.x241715eb000ca8fc()
at RightEdge.xf266856f631ec016.xa927fcc2ce303480(Object xe0292b9ed559da7d, EventArgs xfbf34718e704c6bc)
at TD.SandBar.ToolbarItemBase.OnActivate()
at TD.SandBar.ButtonItemBase.OnActivate()
at TD.SandBar.ShortcutListener.ShortcutActivated(Keys keys, Boolean primary)
at TD.SandBar.ShortcutListener.System.Windows.Forms.IMessageFilter.PreFilterMessage(Message& m)
at System.Windows.Forms.Application.ThreadContext.ProcessFilters(MSG& msg, Boolean& modified)
at System.Windows.Forms.Application.ThreadContext.PreTranslateMessage(MSG& msg)
at System.Windows.Forms.Application.ThreadContext.System.Windows.Forms.UnsafeNativeMethods.IMsoComponent.FPreTranslateMessage(MSG& msg)
at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.Run(Form mainForm)
at RightEdge.AppMain.Main(String[] args)

Inner Exception:
An exception of type System.Net.Sockets.SocketException was thrown.
No connection could be made because the target machine actively refused it
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)
Supreme Being (75,003 reputation)Supreme Being (75,003 reputation)Supreme Being (75,003 reputation)Supreme Being (75,003 reputation)Supreme Being (75,003 reputation)Supreme Being (75,003 reputation)Supreme Being (75,003 reputation)Supreme Being (75,003 reputation)Supreme Being (75,003 reputation)
Posted Wednesday July 22 2009
That looks like a user setup problem. Did a dialog not appear requesting permission to proceed with the connection?

In any event, on TWS click Configure > API > All API Settings. Under Trusted IP Addresses enter (and the IP addresses of any other machines on a LAN that might access that instance of TWI via socket).


Posted Wednesday July 22 2009
phg gives good suggestions, in addition to his, I'd like to add that the meat of this error is this:

No connection could be made because the target machine actively refused it

Something on your machine is preventing us from connecting to TWS. In my experience this could be a couple of things, TWS is not running or does not have ActiveX/Socket permissions granted (as phg pointed out). Also, a local firewall could be blocking the connection. We connect via sockets.
Posted Wednesday July 22 2009
Yes, I understand why it gives the exception. The error message makes it clear - I did not even have TWS running. I never leave it running when backtesting because it uses ~250MB of my precious memory that is all needed by RE during backtesting.

The bug is that after the exception (which was handled and displayed appropriately) when I click the OK button, RE crashes.

Setup IB as your live broker but dont run TWS at all, and press F3. The exception makes sense, but after closing the exception dialog, RE will crash on you and terminate.

Not a big deal, but just annoying, especially if I haven't saved lately. I am slowly getting out of the habit of pressing F3 (to attempt to search text) while writing code. Is there anyway to change the hotkeys? Would be a convenient feature, but not very high priority by any means. I'd be surprised if the GUI library doesn't already have support for lettings users change hot-keys.
Posted Friday July 24 2009
Thanks for the report, this will be fixed in the next build.


Similar Topics

Reading This Topic

2005-2018 © RightEdge Systems