RightEdge Forums
Main     Home          Members     Calendar     Who's On

Welcome Guest
        



New exception value (key) can not be null Expand / Collapse
Message
Posted 1/12/2010 03:22:13 Post #10464
 

Forum GuruForum GuruForum GuruForum GuruForum GuruForum GuruForum GuruForum Guru
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 Post #10467
 

Lead DeveloperLead DeveloperLead DeveloperLead DeveloperLead DeveloperLead DeveloperLead DeveloperLead Developer
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 Post #10469
 

Forum GuruForum GuruForum GuruForum GuruForum GuruForum GuruForum GuruForum Guru
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 Post #10470
 

Lead DeveloperLead DeveloperLead DeveloperLead DeveloperLead DeveloperLead DeveloperLead DeveloperLead Developer
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 Post #10480
 

Forum GuruForum GuruForum GuruForum GuruForum GuruForum GuruForum GuruForum Guru
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 Post #10486
 

DeveloperDeveloperDeveloperDeveloperDeveloperDeveloperDeveloperDeveloper
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 Post #10491
 

Forum GuruForum GuruForum GuruForum GuruForum GuruForum GuruForum GuruForum Guru
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 Post #10505
 

Forum GuruForum GuruForum GuruForum GuruForum GuruForum GuruForum GuruForum Guru
Issue seems to be resolved with the change.

Regards

Amin

« 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 6:58pm

2005-2007 © RightEdge Systems