RightEdge Forums
Main     Home          Members     Calendar     Who's On

Welcome Guest
        



Decimal separator bug Expand / Collapse
Message
Posted 1/25/2010 14:03:41 Post #10573
 

Forum MemberForum MemberForum MemberForum MemberForum MemberForum MemberForum MemberForum Member
In my country decimal separator for numbers is comma, not dot.
I have installed MS Visual Studio 2008 Pro.

When I try to run live any trading system (even without any my code) RE throws exception and crashes.
It stops on step 4 of 6.

Normally I could change locale within C# code, but it not works in RE:
Thread.CurrentThread.CurrentCulture = new CultureInfo("en-US",false);

What to do?



An exception of type System.InvalidOperationException was thrown.
Exception thrown while processing message: AccountValue
w Krs.Ats.IBNet.IBClient.ProcessMsg(IncomingMessage msgId)
w Krs.Ats.IBNet.IBClient.Run()
w System.Threading.ThreadHelper.ThreadStart_Context(Object state)
w System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
w System.Threading.ThreadHelper.ThreadStart()

Inner Exception:
An exception of type System.FormatException was thrown.
Nieprawidłowy format ciągu wejściowego.
w System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal)
w System.Number.ParseDouble(String value, NumberStyles options, NumberFormatInfo numfmt)
w System.Double.Parse(String s, NumberStyles style, NumberFormatInfo info)
w System.Convert.ToDouble(String value)
w RightEdge.TWSCSharpPlugin.TWSPlugin.client_UpdateAccountValue(Object sender, UpdateAccountValueEventArgs e)
w Krs.Ats.IBNet.IBClient.RaiseEvent[T](EventHandler`1 event, Object sender, T e)
w Krs.Ats.IBNet.IBClient.OnUpdateAccountValue(UpdateAccountValueEventArgs e)
w Krs.Ats.IBNet.IBClient.updateAccountValue(String key, String value, String currency, String accountName)
w Krs.Ats.IBNet.IBClient.ProcessMsg(IncomingMessage msgId)
Posted 1/26/2010 02:16:08 Post #10579
 

DeveloperDeveloperDeveloperDeveloperDeveloperDeveloperDeveloperDeveloper
This will be fixed in the next build, which should be out soon. Until then, you can download the source code for the TWS plugin and fix it yourself. See here for details on how to get the source. You will want to update the client_UpdateAccountValue method in TWSPlugin.cs to use the invariant culture when parsing the account value, like this:

buyingPower = Convert.ToDouble(e.Value, CultureInfo.InvariantCulture);

Thanks,
Daniel
Posted 1/26/2010 05:20:55 Post #10581
 

Forum MemberForum MemberForum MemberForum MemberForum MemberForum MemberForum MemberForum Member
Thank you, Daniel!

Temporarily I changed decimal separator in Windows globally, it works, I can wait for Beta 15 version with this.
« Prev Topic | Next Topic »


Reading This Topic Expand / Collapse
Active Users: 0 (0 guests, 0 members, 0 anonymous members)
No members currently viewing this topic.
Forum Moderators: billb, young, dplaisted

Permissions Expand / Collapse

All times are GMT -5:00, Time now is 5:04pm

2005-2007 © RightEdge Systems