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)
Thanks for letting me know. My 3.5 dll wasn't readily available (read I was tired and frustrated and couldn't find it at first glance) so I went with 2.0, wrote to MySQL and promptly ran away. Would definitely be interested to hear if 3.5 works out better for you.
P.S. Mike, I didn't realize you'd written the my_sql_db code from which I based mine so thanks yet again.
Wondering if anyone has successfully separated code in the following way:
OnStartUp() - open connection
OnBarUpdate() - execute insert command (though will change later per Mike's suggestion)
OnTermination() close connection
While Print statements are telling me each of these are being called, and everything compiles properly, it's simply not working.
Placing connection.Open() in OnStartUp() gives me: Error on calling 'OnBarUpdate' method for indicator '[indicator]' on bar 0: Connection must be valid and open.
Placing connection.Close() in OnTermination gives me a message about pooling, which I've found out means I've opened too many connections WITHOUT closing any (this occurs when moving connection.Open() back to OnBarUpdate() with insert code).
NT7 was before my time with this So I can't comment much, except to say just add more debug print statements to see what is going on and track down the bad code.
Also check your MySQL settings, make sure the timeout is sufficiently high to not force close the connection on the server side between inserts if you choose to keep the connection open on the client (which would be my choice).
Hi guys, time for a YAGOF (Yet another Gom framework ;-) )
I had a problem not being able to access Trades and Trade history from Indicators.
In Ninja's mind, Indicators do the drawing , Strategies run the trades, but what if you want to draw stuff …
Since you haven't included any code I can only offer a couple of thoughts
1) make sure your connection object has class scope, and is not a variable declared within your OnStartUp() method.
2) I would initialize and open the connection in OnBarUpdate() but only if the connection object is null. This helps prevent issues assuming that OnStartUp() will only be called once and only once at the beginning of the strategy's execution.
I have not done this with MySql, but I have done it with MS SQL, which you can download for free, and .NET is much more friendly to SQL Server out of the box. It's possible you need a .NET 4-friendly MySql driver, or use the older driver as some have done.
Apologies for the delayed response. They're trying to kill me in the real world...
Thank you to everyone for your suggestions. Unfortunately, nothing I've tried has worked. shodson, I've actually including my current working code early on in this thread. If you have time to check it out, I'd definitely appreciate it. I'm starting to think it might be an NT issue but this is "Unsupported."