Thanks a lot!
Create your own MetaTrader extension (dll) - Part 1
Create your own MetaTrader extension (dll) - Part 2
There'll be another part (or 2) which I'm writing them!
Hope you enjoy them!WOOT WOOT WOOT!
EXCITING!!!!!
Codersguru you are FANTASTIC! THANKS!
dee
Excellent Resource !!!
Hello codersguru!
Great courses you write there. Thanks.
I try to create a dll and test it on MT4. I have an error code 127 (cannot call function 'Test' from dll 'ExpertSample.dll' (error 127))
Here is all the process i do:
1. write the .cpp:
#define MT4_EXPFUNC __declspec(dllexport)
#include
BOOL APIENTRY DllMain(HANDLE hModule,DWORD ul_reason_for_call,LPVOID lpReserved)
{
switch(ul_reason_for_call)
{
case DLL_PROCESS_ATTACH:
case DLL_THREAD_ATTACH:
case DLL_THREAD_DETACH:
case DLL_PROCESS_DETACH:
break;
}
return(TRUE);
}
MT4_EXPFUNC int __stdcall Test()
{
return(12);
}2. i write the .def:
3. I compile, no error, and i put the ExpertSample.dll in the \experts\libraries folder
4. i create my mq4 test file:
#import "ExpertSample.dll"
int Test();
#import
int init() { return(0); }
int deinit() { return(0); }
int start() { Alert( Test() ); return(0); }5. i compile, no error
6. Attach the indy test on chart, check allow dll and ... error 127.
In VC++ i have problem to compile because of windows.h is not find. Then i use DevC++ or Code::Blocks with no error at compile.
My questions: did i forget something, in coding, in c++ project parameters or something else?
Thanks for your help.
FerruFx
I'm far from expert on writing dll's on windows, but I did manage to write one for MT4 by using gcc on cygwin. Apart from the incantations in the code, the compiler needed some arguments in order to avoid using its defaults for dependent dll's. Maybe you have a similar problem?
The gcc arguments I used were: -shared -Wl,--add-stdcall-alias -mno-cygwin
Of course I don't know your compiler, so maybe this is of no help at all.
Where to get the script of ProfitProtector Expert Advisor
Hi codersguru,
I am very new to the MQL4 programming. I have downloaded your pdf manual. And I have found that you have explained the code snipets very well in the manual. I am very interested in learing about the Expert Advisor and surprised to learn that you can do a lot of things with this language for trading. In the manual, youu have mentioned that I can download the ProfitProtector script from your site. So far, I am not able to find the script. Please guide me how to download the sample script.
Thanks
Sweet, thanks for the video
video
Hi Patrick,
Thank you for the very interesting video! Just what I was looking for.
I hardly dare to ask, but would it also be possible to make an instruction for a server side dll and a client side dll in combination with metatrader? That would be really great.

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Create your own MetaTrader extension (dll) - Part 1
Create your own MetaTrader extension (dll) - Part 2
There'll be another part (or 2) which I'm writing them!
Hope you enjoy them!