Welcome to NexusFi: the best trading community on the planet, with over 150,000 members Sign Up Now for Free
Genuine reviews from real traders, not fake reviews from stealth vendors
Quality education from leading professional traders
We are a friendly, helpful, and positive community
We do not tolerate rude behavior, trolling, or vendors advertising in posts
We are here to help, just let us know what you need
You'll need to register in order to view the content of the threads and start contributing to our community. It's free for basic access, or support us by becoming an Elite Member -- see if you qualify for a discount below.
-- Big Mike, Site Administrator
(If you already have an account, login at the top of the page)
I've written code so that one of my indicators can write directly to MySQL. The following works fine with a simple Windows Form I created but prints
"Error on calling 'OnBarUpdate' method for indicator '[indicator]' on bar 0: AssemblyResolveEvent handlers cannot return Assemblies loaded for reflection only."
in my output window when attempting to use with Ninja. I've been through this, and other, forums and can't find the answer.
Thanks,
DS
Can you help answer these questions from other members on NexusFi?
Sorry I don't have specific advise on the error. But I played with mysql db collection from Ninja a few years ago, here are some tips based on what I remember:
1) Don't create/destroy the connection OnBarUpdate. Instead just open it once, and close it once.
2) Don't write (INSERT) on every OnBarUpdate or OnMarketData. Instead use some sort of array or collection and write every 'x' ticks or every 'x' seconds. If you are timestamping, you can generate the timestamp within the collection or array so that when written it will retain the original timestamp.
I was able to record a dozen or more instruments at the tick level doing this, using a remote mysql server on my local network.
I have since deleted the code (by accident) so can't post, sorry.
Error on calling 'OnStartUp' method for indicator '[indicator]': AssemblyResolveEvent handlers cannot return Assemblies loaded for reflection only. and
Error on calling 'OnTermination' method for indicator '[indicator]': AssemblyResolveEvent handlers cannot return Assemblies loaded for reflection only.
Hi,
Just wanted to share a short example demonstrating how to connect NinjaTrader7 --> MySQL --> R(2.12). The example is just trivial, pulling a vector of closing values from NT7 into R, but it demonstrates the power.
Assumes NT7, MySQL, MySQL Connector/Net, …
I am also looking for very similar but trying to use sqlserver ( or sql CE) with an intention of using certain other plug-ins in the future. Have to see how it goes.
dsraider - if you can find a solution using mySQL - can you post the result as well?
I have absolutely no idea whatsoever why this worked but all I had to do was remove the System.Data.dll reference to .NET 4.0 and replace with with the same one from 2.0.
I am now happily writing to MySQL. Hope this helps anyone who's going through the same thing.
Mike, will still gladly take your advice on where to put what. I hadn't even thought of that so thanks again.
Glad to hear it. I was using NT 6.5 and it was about 3 years ago, using 5 year old hardware, so I am sure you can record a 100+ tick level instruments using an efficient method.
As you've probably read, I'm going to be moving things around but this got me writing to MySQL through OnBarUpdate():
One thing worth noting is that my table has an auto-increment column, column 1, but I did NOT use that in this code. "column1" up above is the first variable I'm looking to save. I ignored AI completely and it worked perfectly.
I'm shutting down for the night but if you have any issues, please note any error messages or output window statements. I came across many during this journey and they might ring a bell for me.