mtapi icon indicating copy to clipboard operation
mtapi copied to clipboard

MTConnector failed

Open mhdbzr opened this issue 6 years ago • 14 comments

Hi, I've installed MtApi.exe on 3 VPS. I get error "cannot load MTConnector.dll" in last Mt4 platform, while two other VPS were ok. What can be wrong in last VPS? // have you any suggestion how repair this problem? The only difference I found is number of installed platforms. First two vps have two platforms, but last one has 19 installed platforms. Is it effective parameter!?

mhdbzr avatar Jan 19 '18 19:01 mhdbzr

MtApi does not have any restrictions of installations on different PC. The problem can be in different environment of VPS or values of MetaTrader parameters. Have you set parameter "Allow DLL imports" in Options of MetaTrader?

vdemydiuk avatar Jan 19 '18 20:01 vdemydiuk

Yes, I checked it. (if this option is unchecked, EA alerts.) Is MTConnector first dll call? EA has 2 other dll dependencies and they don't miss. What is "different environment of VPS" ?

If DLL Import not allowed : MtApi GBPCHF,H1: [ERROR] SendMtEvent: The given key was not present in the dictionary. with an alert message.

mhdbzr avatar Jan 19 '18 22:01 mhdbzr

Please contact with me via skype (dem_dw). I need to check the error online on your side.

vdemydiuk avatar Jan 20 '18 13:01 vdemydiuk

I will contact you, thank you.

mhdbzr avatar Jan 20 '18 15:01 mhdbzr

We have checked this problem online and found that some dlls are not present on VPS (Windows Server 2012). I have collected some dll from my PC and attached it to this issue using link to dropbox: https://www.dropbox.com/s/636u9w4l4jqjb2i/crt-dll.zip?dl=0

I have found information described a similar problem: https://support.efolder.net/hc/en-us/articles/115010513067-Online-Backup-Manager-api-ms-win-crt-runtime-l1-1-0-dll-Error I hope it can help to fix this problem too.

vdemydiuk avatar Jan 21 '18 17:01 vdemydiuk

I have similar problem when trying to connect your testing application to MT4 on a VPS (Windows Server 2012 R2). The connection fails by simply stating this in status bar. Thanks to this question I checked and found some skipped updates. I'll post update how it worked.

You could consider adding more verbose message in your test app when connection fails. My use case is I'm new to MtApi and testing it with your test app. After a local success I tried moving the test app to VPS where runs live MT4 terminal. Unlike on my PC, connection fails. I think that newcomers could have similar progression and it could help more of us.

EDIT: I managed to connect in the end. Honestly I don't know what was the culprit. The other reason could be I might have accidentally used the MtApi expert copied from my local PC to the remote VPS, not the one from remotely installed directory.

EDIT2: Yes, when I use the expert file installed on local PC and copy it to the remote VPS MT4 terminal, the connection fails.

sn50 avatar Mar 12 '18 16:03 sn50

Hello. Thank you for this information. This is very major to collect all problems with the project on all systems. Unfortunately, I don't have environment with Windows Server 2012 R2 to test it so I appreciate your help. As for test application, you are right, I will try to improve it to get maximum information and descriptions of the problems.

vdemydiuk avatar Mar 13 '18 08:03 vdemydiuk

You're very welcome, I really like your project.

I also struggled with expert setting "Allow live trading", which I thought didn't have any impact on ability to simply connect to the terminal, but it has. In other words, it has to be allowed, or connection fails. So, as a result, I really don't know what was the real problem. Maybe there were more of them at the same time. :)

sn50 avatar Mar 16 '18 13:03 sn50

MtApi5 MQL expert has condition to check "allow live trading". I don't remember why I have added it.

if (MQL5InfoInteger(MQL5_TRADE_ALLOWED) == false) { MessageBox("Trade not allowed.", "MtApi", 0); isCrashed = true; return (1); }

I will try to test the expert without this condition and if it will work stable I will make release that will not require live trading enabled.

vdemydiuk avatar Mar 19 '18 08:03 vdemydiuk

Yes, that would make sense. The question is, does the API count with being able to connect but at the same time not being able to make trades? Maybe the condition should be checked in the "send order" part...

Btw. I use the MT4, not MT5.

sn50 avatar Mar 19 '18 08:03 sn50

Hi, so I have this working on my local machine but when I try use it on a windows server 19 VM it doesn't work much like the author of this ticket. I have double checked the version but no joy. Installed both mt5 and mt4 from installer and installed wix. image

Thanks

BryanStackpole avatar Jan 29 '21 05:01 BryanStackpole

@BryanStackpole Do you still have the error?

vdemydiuk avatar Feb 07 '21 18:02 vdemydiuk

@vdemydiuk I'm facing this error as well.... My vps is using windows server 2012

oscarutomo avatar Nov 28 '21 17:11 oscarutomo

Had the same issue on Windows Server 2016. Installed VS2022 with c++ and c# dependencies and that solved the problem.

knight-dev avatar Jun 20 '22 18:06 knight-dev