You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Just look in the settings - everything is disabled (DLLs are disabled by default):
If one wants to use external DLLs, just enable the "Acknowledge each DLL function call" button and see what is being called. This is also protection. Just like protecting all embedded file operations with access only to /history and /files directories.
library MetaDLL;
uses
SysUtils,
Classes,
windows;
{$R *.res}
{-----Initialize-------------------------------------------------------------}
procedure InitDllData(CurrencyName: PChar); stdcall;
begin
// do something
end;
{-----Finalize---------------------------------------------------------------}
procedure FreeDllData; stdcall;
begin
// do something
end;
{-----Process tick-----------------------------------------------------------}
procedure ProcessTick(CurrencyName: PChar; bid, ask: double; time: integer); stdcall;
var
f: file;
DateTime: TDateTime;
begin
try
AssignFile(f, WorkDir + CurrencyName + '.tik');
try
reset(f, 1);
except
rewrite(f, 1);
end;
try
DateTime := MTTimeToNormal(time);
seek(f, FileSize(f));
BlockWrite(f, DateTime, sizeof(DateTime));
BlockWrite(f, bid, sizeof(bid));
finally
CloseFile(f);
end;
except
//
end;
end;
exports
ProcessTick, InitDllData, FreeDllData;
end.
Don't forget to set all your functions as stdcall, use only standard Windows types (strings only as PChar), also don't forget to specify in export directive all your exported functions and you will be happy.
Yes, and also look at the picture posted by Renat on how to allow the use of dll in EA.
#import "MetaDLL.dll"
void ProcessTick(string CurrencyName, double aBid, double aAsk, int aTime);
void InitDllData(string CurrencyName);
void FreeDllData();
and then you can call any function
library MetaDLL;
uses
SysUtils,
Classes,
windows;
...
Sorry for another silly question: Is it possible to use VCL in this DLL (to be more precise, was it possible for you)? Because when I connect "form" to ddl, MetaTrader still crashes with "error" at startup (or when connecting a corresponding Expert Advisor).
I'm actually only interested in TDatabase, TDataSource, TQuery
I am very interested in your emulator, that you can practice on history. Unfortunately as far as I know MT is not going to make it. As I understand you do not really want to sell it because you make good money on Forex. But I've been looking for something similar on the web for a long time, so far without success. I would be glad if you let me use your development. From my part I can offer you MTS, perhaps it is the only thing that may interest you.
I hope for your cooperation, Alexander. f1-forum@mail.ru