Posted 1/12/2010 03:22:13
|
|
|
|
| Hello, I got a new exception thrown today. Not sure, what key the exception is actually referring to, I guess it's the symbol's key. Cheers Amin An exception of type System.InvalidOperationException was thrown. Exception thrown while processing message: PortfolioValue at Krs.Ats.IBNet.IBClient.ProcessMsg(IncomingMessage msgId) at Krs.Ats.IBNet.IBClient.Run() at System.Threading.ThreadHelper.ThreadStart_Context(Object state) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) at System.Threading.ThreadHelper.ThreadStart() Inner Exception: An exception of type System.ArgumentNullException was thrown. Value cannot be null. Parameter name: key at System.ThrowHelper.ThrowArgumentNullException(ExceptionArgument argument) at System.Collections.Generic.Dictionary`2.FindEntry(TKey key) at System.Collections.Generic.Dictionary`2.TryGetValue(TKey key, TValue& value) at RightEdge.Common.EnumUtil`1.Parse(String s) at RightEdge.TWSCSharpPlugin.TWSAssetArgs.GetRECurrency(String IBCurrency) at RightEdge.TWSCSharpPlugin.TWSAssetArgs.SymbolFromContract(Contract contract) at RightEdge.TWSCSharpPlugin.TWSPlugin.client_UpdatePortfolio(Object sender, UpdatePortfolioEventArgs e) at Krs.Ats.IBNet.IBClient.RaiseEvent[T](EventHandler`1 event, Object sender, T e) at Krs.Ats.IBNet.IBClient.OnUpdatePortfolio(UpdatePortfolioEventArgs e) at Krs.Ats.IBNet.IBClient.updatePortfolio(Contract contract, Int32 position, Decimal marketPrice, Decimal marketValue, Decimal averageCost, Decimal unrealizedPNL, Decimal realizedPNL, String accountName) at Krs.Ats.IBNet.IBClient.ProcessMsg(IncomingMessage msgId)
|
|
Posted 1/12/2010 08:31:24
|
|
|
|
It seems to be referring to a currency type in the symbol itself. What do you have as the symbol's currency?
Amin (1/12/2010) Hello,
I got a new exception thrown today. Not sure, what key the exception is actually referring to, I guess it's the symbol's key.
Cheers
Amin
An exception of type System.InvalidOperationException was thrown.
Exception thrown while processing message: PortfolioValue
at Krs.Ats.IBNet.IBClient.ProcessMsg(IncomingMessage msgId)
at Krs.Ats.IBNet.IBClient.Run()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
Inner Exception:
An exception of type System.ArgumentNullException was thrown.
Value cannot be null.
Parameter name: key
at System.ThrowHelper.ThrowArgumentNullException(ExceptionArgument argument)
at System.Collections.Generic.Dictionary`2.FindEntry(TKey key)
at System.Collections.Generic.Dictionary`2.TryGetValue(TKey key, TValue& value)
at RightEdge.Common.EnumUtil`1.Parse(String s)
at RightEdge.TWSCSharpPlugin.TWSAssetArgs.GetRECurrency(String IBCurrency)
at RightEdge.TWSCSharpPlugin.TWSAssetArgs.SymbolFromContract(Contract contract)
at RightEdge.TWSCSharpPlugin.TWSPlugin.client_UpdatePortfolio(Object sender, UpdatePortfolioEventArgs e)
at Krs.Ats.IBNet.IBClient.RaiseEvent[T](EventHandler`1 event, Object sender, T e)
at Krs.Ats.IBNet.IBClient.OnUpdatePortfolio(UpdatePortfolioEventArgs e)
at Krs.Ats.IBNet.IBClient.updatePortfolio(Contract contract, Int32 position, Decimal marketPrice, Decimal marketValue, Decimal averageCost, Decimal unrealizedPNL, Decimal realizedPNL, String accountName)
at Krs.Ats.IBNet.IBClient.ProcessMsg(IncomingMessage msgId)
|
|
Posted 1/12/2010 09:00:34
|
|
|
|
| Hi Bill, I have 8 different currency pairs setup as symbols. They worked fine for a couple of weeks now. I can retrieve tick data and run systems. Just today this error message came, so I am not sure, if it is a wrong setup or some processing that messed up here. Regards Amin
|
|
Posted 1/12/2010 10:20:24
|
|
|
|
Is it happening consistently? If so, is it the same symbol or different symbols?
Amin (1/12/2010) Hi Bill,
I have 8 different currency pairs setup as symbols. They worked fine for a couple of weeks now. I can retrieve tick data and run systems. Just today this error message came, so I am not sure, if it is a wrong setup or some processing that messed up here.
Regards
Amin
|
|
Posted 1/12/2010 18:01:59
|
|
|
|
| No, it happened for the first time. I don't know which symbol was affected. The trading system ran unattended - yeah, call me brave ;-) - and when I lokked at the results in the morning I saw the exception. But it must have been thrown from the tick data retrieval, because my systems did not trade anymore at the time, when the exception occured. That is all that I know. Regards Amin
|
|
Posted 1/12/2010 23:50:39
|
|
|
|
It looks like the currency from the KRS library was null for one of the symbols. I'm not sure why that happened, but you can update the GetRECurrency method in the TWS plugin and add this line at the start of it:
if (IBCurrency == null) return CurrencyType.None;
This will be fixed in the next build.
Thanks,
Daniel
|
|
Posted 1/13/2010 03:04:29
|
|
|
|
| Thanks Daniel, will do so and let you know, if that is happening again. FYI, I had the same exception this night. Regards Amin
|
|
Posted 1/14/2010 03:25:23
|
|
|
|
| Issue seems to be resolved with the change. Regards Amin
|
|
|
|