Jobs By Location
Jobs by Programming
Jobs by Role
Jobs by Sector
Subscribe to RSS Feeds
| Poster |
Thread |
| Anonymous |
Posted: 2011/2/3 21:41 Updated: 2011/2/3 21:41 |
| |
 Pairs trade finder from Yahoo Finance in C# I tried building this application but received the following error. Any help would be greatly appreciated.
System.Windows.Markup.XamlParseException was unhandled Message="Cannot create instance of 'Window1' defined in assembly 'yahootest, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'. Exception has been thrown by the target of an invocation. Error in markup file 'Window1.xaml'." Source="PresentationFramework" LineNumber=0 LinePosition=0 StackTrace: at System.Windows.Markup.XamlParseException.ThrowException(String message, Exception innerException, Int32 lineNumber, Int32 linePosition, Uri baseUri, XamlObjectIds currentXamlObjectIds, XamlObjectIds contextXamlObjectIds, Type objectType) at System.Windows.Markup.XamlParseException.ThrowException(ParserContext parserContext, Int32 lineNumber, Int32 linePosition, String message, Exception innerException) at System.Windows.Markup.BamlRecordReader.ThrowExceptionWithLine(String message, Exception innerException) at System.Windows.Markup.BamlRecordReader.CreateInstanceFromType(Type type, Int16 typeId, Boolean throwOnFail) at System.Windows.Markup.BamlRecordReader.GetElementAndFlags(BamlElementStartRecord bamlElementStartRecord, Object& element, ReaderFlags& flags, Type& delayCreatedType, Int16& delayCreatedTypeId) at System.Windows.Markup.BamlRecordReader.BaseReadElementStartRecord(BamlElementStartRecord bamlElementRecord) at System.Windows.Markup.BamlRecordReader.ReadElementStartRecord(BamlElementStartRecord bamlElementRecord) at System.Windows.Markup.BamlRecordReader.ReadRecord(BamlRecord bamlRecord) at System.Windows.Markup.BamlRecordReader.Read(Boolean singleRecord) at System.Windows.Markup.TreeBuilderBamlTranslator.ParseFragment() at System.Windows.Markup.TreeBuilder.Parse() at System.Windows.Markup.XamlReader.LoadBaml(Stream stream, ParserContext parserContext, Object parent, Boolean closeStream) at System.Windows.Application.LoadBamlStreamWithSyncInfo(Stream stream, ParserContext pc) at System.Windows.Application.LoadComponent(Uri resourceLocator, Boolean bSkipJournaledProperties) at System.Windows.Application.DoStartup() at System.Windows.Application.<.ctor>b__0(Object unused) at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Boolean isSingleParameter) at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler) at System.Windows.Threading.Dispatcher.WrappedInvoke(Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler) at System.Windows.Threading.DispatcherOperation.InvokeImpl() at System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(Object state) at System.Threading.ExecutionContext.runTryCode(Object userData) at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData) at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) at System.Windows.Threading.DispatcherOperation.Invoke() at System.Windows.Threading.Dispatcher.ProcessQueue() at System.Windows.Threading.Dispatcher.WndProcHook(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled) at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled) at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o) at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Boolean isSingleParameter) at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler) at System.Windows.Threading.Dispatcher.WrappedInvoke(Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler) at System.Windows.Threading.Dispatcher.InvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Boolean isSingleParameter) at System.Windows.Threading.Dispatcher.Invoke(DispatcherPriority priority, Delegate method, Object arg) at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam) at MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg) at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame) at System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame) at System.Windows.Threading.Dispatcher.Run() at System.Windows.Application.RunDispatcher(Object ignore) at System.Windows.Application.RunInternal(Window window) at System.Windows.Application.Run(Window window) at System.Windows.Application.Run() at yahootest.App.Main() in C:\Documents and Settings\Mike\Desktop\yahootest\yahootest\obj\Release\App.g.cs:line 0 InnerException: System.Reflection.TargetInvocationException Message="Exception has been thrown by the target of an invocation." Source="mscorlib" StackTrace: at System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandle& ctor, Boolean& bNeedSecurityCheck) at System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean fillCache) at System.RuntimeType.CreateInstanceImpl(Boolean publicOnly, Boolean skipVisibilityChecks, Boolean fillCache) at System.Activator.CreateInstance(Type type, Boolean nonPublic) at System.Windows.Markup.BamlRecordReader.CreateInstanceFromType(Type type, Int16 typeId, Boolean throwOnFail) InnerException: MySql.Data.MySqlClient.MySqlException Message="Unable to connect to any of the specified MySQL hosts." Source="MySql.Data" ErrorCode=-2147467259 Number=1042 StackTrace: at MySql.Data.MySqlClient.NativeDriver.Open() at MySql.Data.MySqlClient.Driver.Open() at MySql.Data.MySqlClient.Driver.Create(MySqlConnectionStringBuilder settings) at MySql.Data.MySqlClient.MySqlPool.CreateNewPooledConnection() at MySql.Data.MySqlClient.MySqlPool.GetPooledConnection() at MySql.Data.MySqlClient.MySqlPool.TryToGetDriver() at MySql.Data.MySqlClient.MySqlPool.GetConnection() at MySql.Data.MySqlClient.MySqlConnection.Open() at yahootest.Window1..ctor() in C:\Documents and Settings\Mike\Desktop\yahootest\yahootest\Window1.xaml.cs:line 45 InnerException: System.ArgumentException Message="Invalid handle.\r\nParameter name: handle" Source="mscorlib" ParamName="handle" StackTrace: at System.IO.FileStream..ctor(SafeFileHandle handle, FileAccess access, Int32 bufferSize, Boolean isAsync) at MySql.Data.Common.NamedPipeStream.Open(String path, FileAccess mode, UInt32 timeout) at MySql.Data.Common.NamedPipeStream..ctor(String path, FileAccess mode, UInt32 timeout) at MySql.Data.Common.NamedPipeStream.Create(String pipeName, String hostname, UInt32 timeout) at MySql.Data.Common.StreamCreator.GetStream(UInt32 timeout) at MySql.Data.MySqlClient.NativeDriver.Open() InnerException:
|
|
|
| Poster |
Thread |
| Anonymous |
Posted: 2011/2/4 0:48 Updated: 2011/2/4 0:48 |
| |
 Pairs trade finder from Yahoo Finance in C# Hi, Thanks for your feedback. I am guessing it is an error in database connection. Can you please change this line in file Window1.xaml.cs: "static string _connstr = "User ID=root; Protocol=pipe; Password=mypassword;Host=localhost;Database=test;";" "mypassword" will need to be replaced with h your chosen password during MySql installation, and "test" database with the name of your chosen database. Please let me know if you still find issue. A note : There is a memory leak during cointegration check, and application was getting killed after 5 minutes. Hence I have a timer which restarts the application after every 1 min. (It is a temporary fix, I think I have found the cause and will post the fix in a few days.) Thanks for using QuantCode - vanna
|
|
|
| Poster |
Thread |
| Anonymous |
Posted: 2011/2/4 15:54 Updated: 2011/2/4 15:54 |
| |
 Pairs trade finder from Yahoo Finance in C# I think I had hard coded databasename in the filw to "test", eg., I was referencing test.dailydata. my bad! Can you please either of the below : 1. Create a databse called "test", and install the script in that database. 2. If you have already installed it in you rdatabase, please change "test.dailydata" (similarly for other tables) to your datbasename eg., "mydbname.dailydata" Sorry for the trouble. Regards - vanna
|
|
|
| Poster |
Thread |
| Anonymous |
Posted: 2011/2/4 15:55 Updated: 2011/2/4 15:55 |
| |
 Pairs trade finder from Yahoo Finance in C# The file link you have given is correct - vanna
|
|
|
| Poster |
Thread |
| Anonymous |
Posted: 2011/2/5 21:28 Updated: 2011/2/5 21:28 |
| |
 Pairs trade finder from Yahoo Finance in C# I am struggling to figure out how to use MySql more than anything...not sure how to create the database
|
|
|
|
| Poster |
Thread |
| vanna |
Posted: 2011/2/5 22:15 Updated: 2011/2/5 22:41 |
Just can't stay away   Joined: 2007/3/21 From: Posts: 104 |
 Re: Pairs trade finder from Yahoo Finance in C# Step 1: Open SQL workbench and click on Local host  Step 2: Click on "Create new schema button" and create it with name "test" (as per terminology, schema is a database in MySql)  Step 3: Select default schema as "test", and then copy paste text from script file in pairsdb.sql. Then click on execute button 
|
|
|
|
| Poster |
Thread |
| Anonymous |
Posted: 2011/2/5 22:07 Updated: 2011/2/5 22:07 |
| |
 Pairs trade finder from Yahoo Finance in C# is it local connection, i.e., did you use pipe or tcp/ip ? pipe is much simpler.
|
|
|
| Poster |
Thread |
| Anonymous |
Posted: 2011/4/5 12:50 Updated: 2011/4/5 12:50 |
| |
 Pairs trade finder from Yahoo Finance in C# I set the proper database name and password and still get the "Message="Cannot create instance of 'Window1' defined in assembly 'yahootest, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'. Exception has been thrown by the target of an invocation." issue. What can I do to resolve this?
|
|
|
| Poster |
Thread |
| Anonymous |
Posted: 2011/4/5 12:55 Updated: 2011/4/5 12:55 |
| |
 Pairs trade finder from Yahoo Finance in C# More info:
System.Windows.Markup.XamlParseException was unhandled Message="Cannot create instance of 'Window1' defined in assembly 'yahootest, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'. Exception has been thrown by the target of an invocation. Error in markup file 'Window1.xaml' Line 1 Position 9." Source="PresentationFramework" LineNumber=1 LinePosition=9 StackTrace: at System.Windows.Markup.XamlParseException.ThrowException(String message, Exception innerException, Int32 lineNumber, Int32 linePosition, Uri baseUri, XamlObjectIds currentXamlObjectIds, XamlObjectIds contextXamlObjectIds, Type objectType) at System.Windows.Markup.XamlParseException.ThrowException(ParserContext parserContext, Int32 lineNumber, Int32 linePosition, String message, Exception innerException) at System.Windows.Markup.BamlRecordReader.ThrowExceptionWithLine(String message, Exception innerException) at System.Windows.Markup.BamlRecordReader.CreateInstanceFromType(Type type, Int16 typeId, Boolean throwOnFail) at System.Windows.Markup.BamlRecordReader.GetElementAndFlags(BamlElementStartRecord bamlElementStartRecord, Object& element, ReaderFlags& flags, Type& delayCreatedType, Int16& delayCreatedTypeId) at System.Windows.Markup.BamlRecordReader.BaseReadElementStartRecord(BamlElementStartRecord bamlElementRecord) at System.Windows.Markup.BamlRecordReader.ReadElementStartRecord(BamlElementStartRecord bamlElementRecord) at System.Windows.Markup.BamlRecordReader.ReadRecord(BamlRecord bamlRecord) at System.Windows.Markup.BamlRecordReader.Read(Boolean singleRecord) at System.Windows.Markup.TreeBuilderBamlTranslator.ParseFragment() at System.Windows.Markup.TreeBuilder.Parse() at System.Windows.Markup.XamlReader.LoadBaml(Stream stream, ParserContext parserContext, Object parent, Boolean closeStream) at System.Windows.Application.LoadBamlStreamWithSyncInfo(Stream stream, ParserContext pc) at System.Windows.Application.LoadComponent(Uri resourceLocator, Boolean bSkipJournaledProperties) at System.Windows.Application.DoStartup() at System.Windows.Application.<.ctor>b__0(Object unused) at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Boolean isSingleParameter) at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler) at System.Windows.Threading.Dispatcher.WrappedInvoke(Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler) at System.Windows.Threading.DispatcherOperation.InvokeImpl() at System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(Object state) at System.Threading.ExecutionContext.runTryCode(Object userData) at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData) at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) at System.Windows.Threading.DispatcherOperation.Invoke() at System.Windows.Threading.Dispatcher.ProcessQueue() at System.Windows.Threading.Dispatcher.WndProcHook(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled) at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled) at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o) at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Boolean isSingleParameter) at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler) at System.Windows.Threading.Dispatcher.WrappedInvoke(Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler) at System.Windows.Threading.Dispatcher.InvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Boolean isSingleParameter) at System.Windows.Threading.Dispatcher.Invoke(DispatcherPriority priority, Delegate method, Object arg) at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam) at MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg) at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame) at System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame) at System.Windows.Threading.Dispatcher.Run() at System.Windows.Application.RunDispatcher(Object ignore) at System.Windows.Application.RunInternal(Window window) at System.Windows.Application.Run(Window window) at System.Windows.Application.Run() at yahootest.App.Main() in C:\downloads\yahootest\obj\Debug\App.g.cs:line 0 at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args) at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args) at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly() at System.Threading.ThreadHelper.ThreadStart_Context(Object state) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) at System.Threading.ThreadHelper.ThreadStart() InnerException: System.Reflection.TargetInvocationException Message="Exception has been thrown by the target of an invocation." Source="mscorlib" StackTrace: at System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandle& ctor, Boolean& bNeedSecurityCheck) at System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean fillCache) at System.RuntimeType.CreateInstanceImpl(Boolean publicOnly, Boolean skipVisibilityChecks, Boolean fillCache) at System.Activator.CreateInstance(Type type, Boolean nonPublic) at System.Windows.Markup.BamlRecordReader.CreateInstanceFromType(Type type, Int16 typeId, Boolean throwOnFail) InnerException: MySql.Data.MySqlClient.MySqlException Message="Unable to connect to any of the specified MySQL hosts." Source="MySql.Data" ErrorCode=-2147467259 Number=1042 StackTrace: at MySql.Data.MySqlClient.NativeDriver.Open() at MySql.Data.MySqlClient.Driver.Open() at MySql.Data.MySqlClient.Driver.Create(MySqlConnectionStringBuilder settings) at MySql.Data.MySqlClient.MySqlPool.CreateNewPooledConnection() at MySql.Data.MySqlClient.MySqlPool.GetPooledConnection() at MySql.Data.MySqlClient.MySqlPool.TryToGetDriver() at MySql.Data.MySqlClient.MySqlPool.GetConnection() at MySql.Data.MySqlClient.MySqlConnection.Open() at yahootest.Window1..ctor() in C:\downloads\yahootest\Window1.xaml.cs:line 45 InnerException: System.ArgumentException Message="Invalid handle.\r\nParameter name: handle" Source="mscorlib" ParamName="handle" StackTrace: at System.IO.FileStream..ctor(SafeFileHandle handle, FileAccess access, Int32 bufferSize, Boolean isAsync) at MySql.Data.Common.NamedPipeStream.Open(String path, FileAccess mode, UInt32 timeout) at MySql.Data.Common.NamedPipeStream..ctor(String path, FileAccess mode, UInt32 timeout) at MySql.Data.Common.NamedPipeStream.Create(String pipeName, String hostname, UInt32 timeout) at MySql.Data.Common.StreamCreator.GetStream(UInt32 timeout) at MySql.Data.MySqlClient.NativeDriver.Open() InnerException:
|
|
|
| Poster |
Thread |
| Anonymous |
Posted: 2012/1/30 12:08 Updated: 2012/1/30 21:05 |
| |
 Pairs trade finder from Yahoo Finance in C# Your zip file does not appear to include the lib_gsl_d.dll or libgslcblas_d.dll. I found those libraries elsewhere. When I try to run the program, it crashes inside DoMultiParameterFit with the message: "A call to PInvoke function 'yahootest!yahootest.GSL::gsl_vector_alloc' has unbalanced the stack. This is likely because the managed PInvoke signature does not match the unmanaged target signature. Check that the calling convention and parameters of the PInvoke signature match the target unmanaged signature."
|
|
|
| Poster |
Thread |
| Anonymous |
Posted: 2012/2/24 1:53 Updated: 2012/3/18 11:08 |
| |
 Pairs trade finder from Yahoo Finance in C# I downloaded your 64-bit gsl library to replace the 32-bit, but the problem of "A call to PInvoke function 'yahootest!yahootest.GSL::gsl_vector_alloc' has unbalanced " Still exist...how can this be solved? thanks
|
|
|
| Poster |
Thread |
| Anonymous |
Posted: 2012/2/24 2:55 Updated: 2012/3/18 11:08 |
| |
 Pairs trade finder from Yahoo Finance in C# i also having this problem, how can this be solved?
|
|
|
| Poster |
Thread |
| Anonymous |
Posted: 2012/3/22 11:21 Updated: 2012/5/6 19:24 |
| |
 Pairs trade finder from Yahoo Finance in C# Will this run in XP64 with Excel 2007 & MYSQL Server 5.1 & MYSQL Workbench 5.2 CE? Is the code available? It appears, for each equity, the entire file is downloaded rather than updated. For a few equities, this is ok, but for hundreds it does not seem practical. In your snapshot, it appears you have many stocks; how many were there and how long did the entire run take? What are the parameters? Can they be modified? Where are the list of stocks defined; I’d prefer to analyze several small groups rather than the entire collection against itself. How can this be done?
|
|
|
| Poster |
Thread |
| Anonymous |
Posted: 2012/3/30 1:23 Updated: 2012/5/6 19:24 |
| |
 Pairs trade finder from Yahoo Finance in C# It works if you switch the target framework to .NET Framework 3.5.
|
|
|
Discuss this file. Just enter your message and click on submit. No registration is required.
Subscribe to RSS or daily email updates of latest quantitative finance code listings
|
|
|
|
|
|