Examples: Integrating MetaTrader 4 Client Terminal with MS SQL Server

 

New article Integrating MetaTrader 4 Client Terminal with MS SQL Server has been published:

The article gives an example of integrating MetaTrader 4 Client Terminal with MS SQL Server using a dll. Attached are both source codes in С++ and in MQL4, and a ready-made and compiled Visual C++ 6.0 SP5 project.

The use of integrations with other products offers additional challenge in trading.

You can collect ticks and pass them to MS SQL SERVER for further analysis. Having a large tick history, you can collect any period starting from the minimum time slice and up to any non-standard periods. Having real tick quotes, you may debug tick-data dependent strategies known as 'scalpers'.

You can use a store for quick analysis of data taken from other applications, for example, from MS Excel or other third-party software or from you own products.

For example, you can unload the entire history from History Center of the terminal into MS SQL. Then you won't need to store the history in MT4. This will help to relieve the terminal memory.

You can calculate neural networks using quotes stored in MS SQL SERVER: for example, STATISTICA - 7.8 to allow you to download quotes from SQL can be solved in the real-time mode by passing the network signals into MT4.

You can develop your own program in another language and for another symbol, and pass signals using MS SQL SERVER, having left only executing functions for the client terminal and relieving it from serious calculations.

Author: Yuriy Zaytsev

 

Thank You.

Please a sample Mysql, Firebird.

 
Can this be use to connect ms sql 2005? I tried to but seems to be unsuccessful in doing so.
 

Can anyone looking at this give me any more help with this?

I need a metatrader-compatible dll that i can reference within an expert advisor program. The purpose will be to send SQL statements to a MS SQL Server database. I will need to send a connection string and a SQL string to the function, and return an array or xml string that my MQL code can read and process. The SQL will be either select statments or update/insert statements. In the case of the latter, the return value will be "success", or the error text returned from the DBMS.

 

I have tried to make the code in this article work with my database. I compile the dll again only changing the database-name, username and password in the .cpp file. After compiling and running the EA I get the "cannot load library 'YZMSSQLExpertSample.dll' (error 126)" error. It works with the old DLL file, but it have the not my database, username and password. So I guess something went wrong in the compiling. I used the newest version of C++ and not the 6.0. Schould this be a problem? Or do I have to look elsewhere?


I also tried to make a database called the same as in the article and run the articles dll and codes. Still doesnt work, I dont get the "cant load dll" error, but no data is filled into the database. I made the DSN in my windows server 2008, with windows NT autentication with Network ID, cos I couldnt use the username and password specified for the database created with the script.


Im not sure why its not working for me any ideas?

 
What is MDAC 7 ? When I google it I only find versions called 2.7 or 2.8 from ms.
 
Okay its working for me now. I changed the dll with an hex editor, as I couldnt make it work with recompiling in c++ 9.
 

Hi,


I am a very beginner in the programming field. It happens that i have a trading strategy that might work well if i have a hybrid EA including NN. However,i couldnot afford time or effort to start learning everything about advanced programming, genetic algorithms or Neural networks. I surfed to find out if there is a software can enable me to build an EA without the need of advanced programming knowledge.Actually, if this will work, i could design, my what i call it, prototype EA. If this prototype EA shows promising results, i might go further to professionally produce it. For example, by hiring a professional programmer or contacting a reputable programming company.


Now, i found Neuroshell software could satisfy me with my need in this area of designing and building an EA without much programming knowlege.

My wondering, if you know guys any of their compititors that i could look at and make a fair comparison based on my needs and what they offer so i could decide which one i will go for??


Thanks for you patience and time


Hope to hear from you soon.

Email: McGene2010@yahoo.com


 
EAProgrammer:

I have tried to make the code in this article work with my database. I compile the dll again only changing the database-name, username and password in the .cpp file. After compiling and running the EA I get the "cannot load library 'YZMSSQLExpertSample.dll' (error 126)" error. It works with the old DLL file, but it have the not my database, username and password. So I guess something went wrong in the compiling. I used the newest version of C++ and not the 6.0. Schould this be a problem? Or do I have to look elsewhere?


I also tried to make a database called the same as in the article and run the articles dll and codes. Still doesnt work, I dont get the "cant load dll" error, but no data is filled into the database. I made the DSN in my windows server 2008, with windows NT autentication with Network ID, cos I couldnt use the username and password specified for the database created with the script.


Im not sure why its not working for me any ideas?


I'm getting the same problem as you.

I followed the instructions to the letter, using the same version of SQL Server 2000 on a Windows 2000 Server virtual PC, created a login account 'yuraz' 'qwerty', used the same username and password provided in the SQL script for the DSN connection, the DSN name is the same, all database names and stored procedures are also the same as the author's and SQL authentication is enabled, as opposed to Windows authentication in SQL server and for the DSN.

The expert SQLGETHISTORY is attached to the chart and loads the ready made .dll successfully, but no data is filled in to the database tables.

One thing I did notice was the Expert, when attached to the chart and enabled, has a unhappy face :-(. I was wondering if this should be a happy face for everything to be working correctly?

The counter is counting down from 5000 to 0 and the starts over again.

Did you manage to get this to work?

Does anyone know where I may have gone wrong?

Reason: