Libraries: EAX_Mysql - mysql library

 

EAX_Mysql - mysql library:

This library allows an easy interface to mysql.

Author: Michael Schoen

 
Automated-Trading:

EAX_Mysql - mysql library:

Author: Michael Schoen

Hi Michael,

There is some typos on your example script, e.g. EAX_mysql should be EAX_Mysql (case-sensitive) but anyway thanks for the great script.

 
Opens Up EA Interfacing In Another Direction...
 

Good work ... but... . bravo !

 

Thanks very much for taking the time to build and share this. Just another quick fix:

  • Download Connector/C (libmysql) for your environment (32 or 64bit) and put libymsql.dll into "MQL5\Include".

 The .dll should go in MQL5\Libraries, not in MQL5\Include.

 
danken00:

Thanks very much for taking the time to build and share this. Just another quick fix:

  • Download Connector/C (libmysql) for your environment (32 or 64bit) and put libymsql.dll into "MQL5\Include".

 The .dll should go in MQL5\Libraries, not in MQL5\Include.

Thank you. Fixed.
 

Dear Michael,

 I try to use your  library.

Unfortunately I have not been able to able to make it work.

 

I found two little typo error in the example "Reading Data":

  • at the end of line of code "db.connect("myhost.mydomain.com", "myusername", "mypassword", "mydatabase", "mytable")" the ";" is missing
  • In the line EAX_mysql *db = new EAX_Mysql(); ==> EAX_Mysql*db = new EAX_Mysql() (the case of "EAX_mysql");

 

I follow your installing guide. Using the  debug I see all block at function "connect" at row 416 with the call "mysql_init(0)".

I have use the mysql-connector-c-6.1.2-winx64. 

 

Thanks

 Gianfrancioschio


 

Hi gianfrancio,

I'd assume that the DLL's do not fit your metatrader platform; you will need a 64 bit mysql DLL if you use a 64bit of metatrader and a 32bit mysql DLL for 32bit metatrader...
Thx for the doc remarks.. I'll try to fix it ...

 

I found error  .

DS 2 14:14:56.980 DbTest01 (CHG,M5) 2015.01.01 00:00:00   Access violation at 0x00007FFE02A4560E read to 0x0000000088FE0C50 in 'C:\Users\arno\AppData\Roaming\MetaQuotes\Tester\D0E8209F77C8CF37AD8BF550E51FF075\Agent-127.0.0.1-3000\MQL5\Libraries\libmysql.dll'
DL 2 14:14:56.989 DbTest01 (CHG,M5) 2015.01.01 00:00:00                 00007FFE02A455A0 4055              push       rbp
FO 2 14:14:56.989 DbTest01 (CHG,M5) 2015.01.01 00:00:00                 00007FFE02A455A2 53                push       rbx
LO 2 14:14:56.989 DbTest01 (CHG,M5) 2015.01.01 00:00:00                 00007FFE02A455A3 56                push       rsi
EO 2 14:14:56.989 DbTest01 (CHG,M5) 2015.01.01 00:00:00                 00007FFE02A455A4 57                push       rdi
PP 2 14:14:56.989 DbTest01 (CHG,M5) 2015.01.01 00:00:00                 00007FFE02A455A5 4154              push       r12
HP 2 14:14:56.989 DbTest01 (CHG,M5) 2015.01.01 00:00:00                 00007FFE02A455A7 4155              push       r13
DQ 2 14:14:56.989 DbTest01 (CHG,M5) 2015.01.01 00:00:00                 00007FFE02A455A9 4156              push       r14
CN 2 14:14:56.989 DbTest01 (CHG,M5) 2015.01.01 00:00:00                 00007FFE02A455AB 4157              push       r15
GP 2 14:14:56.989 DbTest01 (CHG,M5) 2015.01.01 00:00:00                 00007FFE02A455AD 488DAC2478FEFFFF  lea        rbp, [rsp-0x188]
MN 2 14:14:56.989 DbTest01 (CHG,M5) 2015.01.01 00:00:00                 00007FFE02A455B5 4881EC88020000    sub        rsp, 0x288
DP 2 14:14:56.989 DbTest01 (CHG,M5) 2015.01.01 00:00:00                 00007FFE02A455BC 488B052D684300    mov        rax, [rip+0x43682d]
QO 2 14:14:56.989 DbTest01 (CHG,M5) 2015.01.01 00:00:00                 00007FFE02A455C3 4833C4            xor        rax, rsp
OR 2 14:14:56.989 DbTest01 (CHG,M5) 2015.01.01 00:00:00                 00007FFE02A455C6 48898570010000    mov        [rbp+0x170], rax
PM 2 14:14:56.989 DbTest01 (CHG,M5) 2015.01.01 00:00:00                 00007FFE02A455CD 4C8BAD00020000    mov        r13, [rbp+0x200]
NR 2 14:14:56.989 DbTest01 (CHG,M5) 2015.01.01 00:00:00                 00007FFE02A455D4 488BB5F0010000    mov        rsi, [rbp+0x1f0]
QN 2 14:14:56.990 DbTest01 (CHG,M5) 2015.01.01 00:00:00                 00007FFE02A455DB 4533FF            xor        r15d, r15d
HM 2 14:14:56.990 DbTest01 (CHG,M5) 2015.01.01 00:00:00                 00007FFE02A455DE 498BF9            mov        rdi, r9
GR 2 14:14:56.990 DbTest01 (CHG,M5) 2015.01.01 00:00:00                 00007FFE02A455E1 4C894DB8          mov        [rbp-0x48], r9
MS 2 14:14:56.990 DbTest01 (CHG,M5) 2015.01.01 00:00:00                 00007FFE02A455E5 4D8BE0            mov        r12, r8
LP 2 14:14:56.990 DbTest01 (CHG,M5) 2015.01.01 00:00:00                 00007FFE02A455E8 488975C0          mov        [rbp-0x40], rsi
IG 2 14:14:56.990 DbTest01 (CHG,M5) 2015.01.01 00:00:00                 00007FFE02A455EC 4C896C2470        mov        [rsp+0x70], r13
HI 2 14:14:56.990 DbTest01 (CHG,M5) 2015.01.01 00:00:00                 00007FFE02A455F1 4C896C2468        mov        [rsp+0x68], r13
RE 2 14:14:56.990 DbTest01 (CHG,M5) 2015.01.01 00:00:00                 00007FFE02A455F6 4C8945C8          mov        [rbp-0x38], r8
CJ 2 14:14:56.990 DbTest01 (CHG,M5) 2015.01.01 00:00:00                 00007FFE02A455FA 4C8BF2            mov        r14, rdx
RD 2 14:14:56.990 DbTest01 (CHG,M5) 2015.01.01 00:00:00                 00007FFE02A455FD 488BD9            mov        rbx, rcx
ME 2 14:14:56.990 DbTest01 (CHG,M5) 2015.01.01 00:00:00                 00007FFE02A45600 4889542460        mov        [rsp+0x60], rdx
OG 2 14:14:56.990 DbTest01 (CHG,M5) 2015.01.01 00:00:00                 00007FFE02A45605 44897C2478        mov        [rsp+0x78], r15d
QK 2 14:14:56.990 DbTest01 (CHG,M5) 2015.01.01 00:00:00                 00007FFE02A4560A 4C897DB0          mov        [rbp-0x50], r15
HH 2 14:14:56.990 DbTest01 (CHG,M5) 2015.01.01 00:00:00      crash -->  00007FFE02A4560E 4C3939            cmp        [rcx], r15
RJ 2 14:14:56.990 DbTest01 (CHG,M5) 2015.01.01 00:00:00                 00007FFE02A45611 7416              jz         0x7ffe02a45629
GG 2 14:14:56.990 DbTest01 (CHG,M5) 2015.01.01 00:00:00   
NN 2 14:14:56.990 DbTest01 (CHG,M5) 2015.01.01 00:00:00                 00007FFE02A45613 4C8B052E694300    mov        r8, [rip+0x43692e]
MM 2 14:14:56.990 DbTest01 (CHG,M5) 2015.01.01 00:00:00                 00007FFE02A4561A BA0A080000        mov        edx, 0x80a
RR 2 14:14:56.990 DbTest01 (CHG,M5) 2015.01.01 00:00:00                 00007FFE02A4561F E86CC0FFFF        call       0x7ffe02a41690  ; mysql_session_track_get_next (libmysql.dll)
QI 2 14:14:56.990 DbTest01 (CHG,M5) 2015.01.01 00:00:00                 00007FFE02A45624 E914070000        jmp        0x7ffe02a45d3d
HH 2 14:14:56.990 DbTest01 (CHG,M5) 2015.01.01 00:00:00   
KN 2 14:14:56.990 DbTest01 (CHG,M5) 2015.01.01 00:00:00                 00007FFE02A45629 488D5510          lea        rdx, [rbp+0x10]
MP 2 14:14:56.990 DbTest01 (CHG,M5) 2015.01.01 00:00:00   
PI 2 14:14:56.990 DbTest01 (CHG,M5) 2015.01.01 00:00:00   00: 0x00007FFE02A4560E
IH 2 14:14:56.990 DbTest01 (CHG,M5) 2015.01.01 00:00:00   01: 0x0000000000040018
IL 2 14:14:56.990 DbTest01 (CHG,M5) 2015.01.01 00:00:00   
QI 2 14:14:56.990 Tester OnInit critical error
FQ 0 14:14:56.991 Tester log file "C:\Users\arno\AppData\Roaming\MetaQuotes\Tester\D0E8209F77C8CF37AD8BF550E51FF075\Agent-127.0.0.1-3000\logs\20170110.log" written

 

Hey man,

I am trying to run a backtest here and I get an error "Cannot call 'mysql_init', 'libmysql.dll' is not loaded".

Apparently he is not being able to load the DLL file but I checked and it is there. Any idea?

PS: I have the Allow DLL checked in the Terminal Options --> Expert Advisor

Testing trading strategies on real ticks
Testing trading strategies on real ticks
  • www.mql5.com
The article provides the results of testing a simple trading strategy in three modes: "1 minute OHLC" using only Open, High, Low and Close prices of minute bars; detailed modeling in "Every tick" mode, as well as the most accurate "Every tick based on real ticks" mode applying actual historical data. Comparing the results allows us to assess...