Welcome to Forex-TSD!, one of the largest Forex forums worldwide, where you will be able to find the most complete and reliable Forex information imaginable.
From the list below, select the forum that you want to visit and register to post, as many times you want. It’s absolutely free. Click here for registering on Forex-TSD.
Exclusive Forum
The Exclusive Forum is the only paid section. Once you subscribe, you will get free access to real cutting-edge Trading Systems (automated and not), Indicators, Signals, Articles, etc., that will help and guide you, in ways that you could only imagine, with your Forex trading.
Elite Section
Get access to private discussions, specialized support, indicators and trading systems reported every week.
Advanced Elite Section
For professional traders, trading system developers and any other member who may need to use and/or convert, the most cutting-edge exclusive indicators and trading systems for MT4 and MT5.
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:
Quote:
LIBRARY ExpertSample
EXPORTS Test
3. I compile, no error, and i put the ExpertSample.dll in the \experts\libraries folder
4. i create my mq4 test file:
Quote:
#property indicator_chart_window
#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?
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.
Has anyone tried to write dll for MT4 with C# using VisualStudio2005? I've made an attempt but I keep geting error 127. Perhaps .net is not a good technology to write libraries for MT4?
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.
Just finished a video on how to write a DLL for MT4 ... I tried to make an example that returns an array since it's really what I though was missing when I first started to look into the sample provided by MetaQuotes.