vdemydiuk / mtapi

MetaTrader API (terminal bridge)
MIT License
523 stars 282 forks source link

MT5 crashed on call bool initExpert(); #47

Closed KptKuck closed 7 years ago

KptKuck commented 7 years ago

My Metatrader 5 Build 1545 on Windows 10 crashed on call bool initExpert(int expertHandle, int port, string symbol, double bid, double ask, string& err); in MTApi EA.

Logfile:

MP 0 01:07:29.612 Experts automated trading is enabled HL 2 01:07:35.927 MtApi5 (AUDCAD,H1) Unhandled exception 0xE0434352 DH 2 01:07:35.968 MtApi5 (AUDCAD,H1) 00007FFAD9137720 4881ECD8000000 sub rsp, 0xd8 EI 2 01:07:35.968 MtApi5 (AUDCAD,H1) 00007FFAD9137727 488B0562781D00 mov rax, [rip+0x1d7862] EK 2 01:07:35.968 MtApi5 (AUDCAD,H1) 00007FFAD913772E 4833C4 xor rax, rsp LK 2 01:07:35.968 MtApi5 (AUDCAD,H1) 00007FFAD9137731 48898424C0000000 mov [rsp+0xc0], rax MR 2 01:07:35.968 MtApi5 (AUDCAD,H1) 00007FFAD9137739 488364242800 and qword [rsp+0x28], 0x0 DN 2 01:07:35.968 MtApi5 (AUDCAD,H1) 00007FFAD913773F 488D05DAFFFFFF lea rax, [rip-0x26] NM 2 01:07:35.968 MtApi5 (AUDCAD,H1) 00007FFAD9137746 83E201 and edx, 0x1 IL 2 01:07:35.968 MtApi5 (AUDCAD,H1) 00007FFAD9137749 894C2420 mov [rsp+0x20], ecx IN 2 01:07:35.968 MtApi5 (AUDCAD,H1) 00007FFAD913774D 89542424 mov [rsp+0x24], edx LF 2 01:07:35.968 MtApi5 (AUDCAD,H1) 00007FFAD9137751 4889442430 mov [rsp+0x30], rax FF 2 01:07:35.968 MtApi5 (AUDCAD,H1) 00007FFAD9137756 4D85C9 test r9, r9 DH 2 01:07:35.968 MtApi5 (AUDCAD,H1) 00007FFAD9137759 7445 jz 0x7ffad91377a0 CJ 2 01:07:35.968 MtApi5 (AUDCAD,H1)
QH 2 01:07:35.968 MtApi5 (AUDCAD,H1) 00007FFAD913775B B80F000000 mov eax, 0xf NK 2 01:07:35.968 MtApi5 (AUDCAD,H1) 00007FFAD9137760 488D4C2440 lea rcx, [rsp+0x40] CJ 2 01:07:35.968 MtApi5 (AUDCAD,H1) 00007FFAD9137765 443BC0 cmp r8d, eax QS 2 01:07:35.968 MtApi5 (AUDCAD,H1) 00007FFAD9137768 498BD1 mov rdx, r9 DN 2 01:07:35.968 MtApi5 (AUDCAD,H1) 00007FFAD913776B 440F47C0 cmova r8d, eax GS 2 01:07:35.968 MtApi5 (AUDCAD,H1) 00007FFAD913776F 4489442438 mov [rsp+0x38], r8d PK 2 01:07:35.968 MtApi5 (AUDCAD,H1) 00007FFAD9137774 49C1E003 shl r8, 0x3 QD 2 01:07:35.968 MtApi5 (AUDCAD,H1) 00007FFAD9137778 E807550600 call 0x7ffad919cc84 ; SHExpandEnvironmentStringsA (kernelbase.dll) CN 2 01:07:35.968 MtApi5 (AUDCAD,H1) 00007FFAD913777D 488D4C2420 lea rcx, [rsp+0x20] CD 2 01:07:35.968 MtApi5 (AUDCAD,H1) 00007FFAD9137782 FF15D0081300 call qword near [rip+0x1308d0] ; TerminateProcessOnMemoryExhaustion (kernelbase.dll) IR 2 01:07:35.968 MtApi5 (AUDCAD,H1) crash --> 00007FFAD9137788 488B8C24C0000000 mov rcx, [rsp+0xc0] PL 2 01:07:35.968 MtApi5 (AUDCAD,H1) 00007FFAD9137790 4833CC xor rcx, rsp KS 2 01:07:35.968 MtApi5 (AUDCAD,H1) 00007FFAD9137793 E8981A0600 call 0x7ffad9199230 ; GetSystemWow64DirectoryW (kernelbase.dll) OL 2 01:07:35.968 MtApi5 (AUDCAD,H1) 00007FFAD9137798 4881C4D8000000 add rsp, 0xd8 RO 2 01:07:35.968 MtApi5 (AUDCAD,H1) 00007FFAD913779F C3 ret
CD 2 01:07:35.968 MtApi5 (AUDCAD,H1)
CP 2 01:07:35.968 MtApi5 (AUDCAD,H1) 00007FFAD91377A0 8364243800 and dword [rsp+0x38], 0x0 NL 2 01:07:35.968 MtApi5 (AUDCAD,H1) 00007FFAD91377A5 EBD6 jmp 0x7ffad913777d CR 2 01:07:35.968 MtApi5 (AUDCAD,H1)
IO 2 01:07:35.968 MtApi5 (AUDCAD,H1)
RE 2 01:07:35.968 MtApi5 (AUDCAD,H1) 00: 0x00007FFAD9137788 MN 2 01:07:35.968 MtApi5 (AUDCAD,H1) 01: 0x00000001E06D7363 CF 2 01:07:35.968 MtApi5 (AUDCAD,H1) 02: 0x0000004B365DAE60 IP 2 01:07:35.968 MtApi5 (AUDCAD,H1) 03: 0x0000004B365DB490 HH 2 01:07:35.968 MtApi5 (AUDCAD,H1) 04: 0x0000004B365D9C70 EP 2 01:07:35.968 MtApi5 (AUDCAD,H1) 05: 0x00000001E0434352 KM 2 01:07:35.968 MtApi5 (AUDCAD,H1)

Is this a bug? Or I have created the mt5connector.dll incorrectly. I am using VS15

vdemydiuk commented 7 years ago

Hi. Can you try install MtApi (MT5) installer from release by link and use MtApi.ex5 from installed pack. Does it has also the crash ?

KptKuck commented 7 years ago

Ok, that works. No crash. I look times if I find the error. Thank you

danielscotrim commented 7 years ago

I got the same error when try to build the mt5connector. The exception happens when the MtApi5 ea calls initExpert. What can I do? Thanks

danielscotrim commented 7 years ago

I figured aout. The MtApiService wasn't updated.

vdemydiuk commented 7 years ago

Please contact with me via skype and I will try to help you online, My skype: dem_dw.

vdemydiuk commented 7 years ago

Do you still have this problem during call the function?

vdemydiuk commented 7 years ago

I am closing this issue because I have not received any answer long time and there are no any new feedbacks about this issue.