RightEdge Forums
Main     Home          Members     Calendar     Who's On

Welcome Guest
        



Updating Symbol.CurrencyType causes exception... Expand / Collapse
Message
Posted 12/9/2009 08:18:51 Post #10216
 

Junior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior Member
Hi,

I am working with a relatively big (~600) watchlist where the components are equities from mixed european countries. While initially creating my watchlist, I have provided only the names of the stocks and let the currencies to be equal to a dummy value 'USD'.

But during my simulation I would like to convert each symbol to its real currency before execution and in order to do that I am calling " Symbol.CurrencyType = CurrencyType.X; " (X is read from a database accordingly) in my MySystem.Startup() method. My expectation is once I provided the currency type and the required forex series, RE will take care of the necessary conversion; but apparently I am getting the below exception. What do I miss?


An exception of type System.Collections.Generic.KeyNotFoundException was thrown.
The given key was not present in the dictionary.
at System.ThrowHelper.ThrowKeyNotFoundException()
at System.Collections.Generic.Dictionary`2.get_Item(TKey key)
at RightEdge.Common.x3da600d6153dd471.get_Item(Symbol key)
at RightEdge.Common.SystemData.xad2b458a905382a5(Symbol xc1db5dbaf009ebd2)
at RightEdge.Common.UserSeries.get_xeeedc627c3d07705()
at RightEdge.Common.UserSeries.get_Count()
at RightEdge.Common.IndicatorManager.UpdateCharts()
at RightEdge.Shared.SystemWrapper.InitializeModule(SystemData systemData, SystemRunInfo dndInfo, ServiceFactory brokerFactory)
at RightEdge.Shared.SystemWrapper.RunSystem(SystemData systemData, SystemRunInfo runInfo, Dictionary`2 historicalData, ServiceFactory brokerFactory)
at RightEdge.Shared.SystemWrapper.RunSystem(DateTime start, String filename, ServiceFactory brokerFactory)
at RightEdge.Shared.SystemWrapper.RunSystem(DateTime start, String filename, ServiceFactory brokerFactory)
at RightEdge.Shared.TradingModuleWrapper.RunSystem(SystemDataCreationSettings settings, Dictionary`2 historicalData, SystemRunInfo dndInfo, ServiceAppDomainFactory brokerFactoryFactory)
at RightEdge.SystemProgress.InitAndRunSystem()



Thanks,
Erk
Posted 12/9/2009 08:26:17 Post #10218
 

Lead DeveloperLead DeveloperLead DeveloperLead DeveloperLead DeveloperLead DeveloperLead DeveloperLead Developer
CurrencyType is part of the key in the Symbol object. Changing this will change the hash table and result in the error that you're seeing. Why are you changing the CurrencyType at runtime? Can you do it in the watchlist instead?
Posted 12/9/2009 09:57:21 Post #10219
 

Junior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior Member
Thanks for the quick reply Bill. I see what the problem is.

Then,initially I want to manipulate my instruments data by a script which reads the corresponding currency type for each instrument from a database and updates it in the folder. The problem is; I can not read and update the binary file type of instruments in the "Data Store" folder. What would you suggest.

Posted 12/10/2009 08:19:44 Post #10232
 

Lead DeveloperLead DeveloperLead DeveloperLead DeveloperLead DeveloperLead DeveloperLead DeveloperLead Developer
The currency type is stored in the watchlist file. Are you looking to change it permanently? If so, modifying the xml file that the symbol configuration is stored in is possible. The symbol data is stored in a file called SymbolConfig.xml. It's human readable and see this post for some source code to read it in from code.

ErkSubasi (12/9/2009)
Thanks for the quick reply Bill. I see what the problem is.

Then,initially I want to manipulate my instruments data by a script which reads the corresponding currency type for each instrument from a database and updates it in the folder. The problem is; I can not read and update the binary file type of instruments in the "Data Store" folder. What would you suggest.

Posted 12/11/2009 00:27:43 Post #10236
 

DeveloperDeveloperDeveloperDeveloperDeveloperDeveloperDeveloperDeveloper
You should be able to update your watchlist by editing SymbolConfig.xml as Bill suggests. The Binary Data store stores the data for each symbol in a separate file, so you can just rename the files in that directory to transfer the data from one symbol to another. The filename comes from calling Symbol.ToUniqueId().

Thanks,
Daniel
« 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:06pm

2005-2007 © RightEdge Systems