大多数专家顾问并不需要一个DLL. 虽然 在MQL编程 相当限制, 它足够用于 99% 专家顾问. DLL编程为MetaTrader 只有适当的时候MQL不提供能力的EA需求.
什么是DLL?
DLL表示动态链接库, 这是没有一丝有助于理解它做什么. 概念化一个完整的工具,工具箱. 该DLL本身就是工具箱. 该 “东东” 在DLL的是,专家顾问或指示器使用做出决定的工具. 该MQL只是决定在这时候使用哪种工具.
MetaTrader的允许专家顾问来控制MQL是否可以使用DLL的能力. 这个选项是第一个出现在上面的截图. 缩进选项 “确认DLL函数调用” 是这个选项的子集. 每当MT4想要使用一个DLL, 它会提示用户提供一个是/否的消息框每一次该DLL用于. It’s very annoying. MetaTrader的会更好没有这个选项,因为它混淆了大多数用户.
当编写一个DLL的MetaTrader
速度
我经常会遇到需要一个DLL,每当我打算做数学密集型 程序设计. MQL运行非常缓慢的 程序设计 语言. 每当EA要处理几百万calcualtions, 它倾向于冻结. MetaTrader的怀疑,它陷入了无限循环和扼流圈.
这些移动计算成DLL通过计算数字更强大的语言的责任. MetaTrader的只喜欢C / C 或Delphi, 这被称为上级. 该 MQL程序员 can control the physical hardware in order to optimize performance if it’s required. 这将成为后容易矫枉过正. 一个普通的DLL程序编写的C运行很多, 很多时候比MQL相同的代码快. 我们只在OneStepRemoved程序的DLL在C或C (读为C加上加).
销售产品的MetaTrader
MQL是 程序设计 语言的设计完全是为了交易. 任何交易的领域之外扩展, 如从一个服务器连接到一个数据库或读取信息的, 不支持.
一个企业,要 销售专家顾问 绝对需要一个DLL. 更高层次的语言轻松支持网络操作,可以验证是谁,并且不允许使用文件.
更重要的是, 高级语言提供了显着更强的加密选项. 反编译的MQL文件, 这意味着打破它打开偷内容, 成本仅约 $10-15 如果你做的不够谷歌搜索. 破解一个DLL文件,需要更多的工作. 即使是未加密的文件可能需要 计划 几个工作全面工作日内开. 破解加密的DLL可能需要几个月,如果裂缝加密是未知. 虽然任何可以被加密理论上可以deencrypted, 它变得规模和资源的问题. Would cracking your file warrant someone’s full time employment for several months? 答案是否定的所有但最敏感的材料.
桥的MetaTrader的多个实例
偶尔, 交易员设计的专家顾问需要接收来自多个券商的信息在同一时间. 券商套利 与贸易复印机落在牢牢这一类. 在贸易复印机的情况下, 想要复制其他账户的MT4账户需要知道发生了什么. 该DLL矗立在它们之间的中间作为路径来传递信息来回.
许多其他的问题是最适当与一个DLL解决. If you aren’t sure if it makes sense for your situation, 那么,请 联系 我.
保罗 sioli 说
ciao
i’m interested in your dll programming capabilities
我绝对需要 mt4 后台测试优化多线程, 有可能使用的 pc 的所有 cpu 内核。, 和我的局域网中的所有 cpu 核心。. 它应该尽可能使用 dll 在 mt4 编程. 你可以帮我吗?
谢谢你
肖恩·奥弗顿 说
嗨,保罗 ·,
MT4 是限于一个单一的核心 – there’s no way to multithread the DLL to speed up your backtests. 我希望我能帮助, but it’s a design flaw in MetaTrader 4.
Reynard 说
肖恩喜,
I have got an indicator that i want to sell online.
How do i use DLL or anything else that prevents people from redistributing my indicator once they purchase my indicator online?
谢谢,
Reynard
肖恩·奥弗顿 说
Hi Reynard,
Please contact me directly. I have a solution named Trader Lockdown that does exactly that.
–肖恩
弗罗林 说
谢谢你这个专业的文章.
Evans Njuguna 说
肖恩喜,,,
Great article and your expertise on metatrader-dll is highly appreciated. I need your help in converting some of the code in my EA into dll,,,,for speed/efficiency purposes and also for security. Kindly assist.
谢谢.
Njuguna.
肖恩·奥弗顿 说
Hi Njuguna,
Please email your EA to info@onestepremoved.com 为了得到的估计.
–肖恩
Johnson 说
So is there a way to have a backtest on a ea you want to test on strategy test That you say “alllow DLL imports “I’m really want to test on my ea on strategy test and is there a way to enable it to run on strategy test?
肖恩·奥弗顿 说
The EA can refuse to run all backtests regardless of whether a DLL is involved or not.
wakup309 说
肖恩喜,
How to Receive mt4 data from proxy server between client and server, can you guide me to general steps , 谢谢 .
肖恩·奥弗顿 说
That’s not something that I expect to cover soon.
Dennis Lai 说
肖恩喜,
thank you for your great sharing above
I have a question, if I’m going to build a EA that wish to check equity or balance if down to certain level, 然后 :
1) close all running and pending orders (even open by other EAs)
2) stop new others from any other EAs
believe (1) no need DLL, while is that needs DLL coding?
thx.
Dennis
肖恩·奥弗顿 说
DLL is completely unnecessary for those tasks.
Kosta 说
你好. I am on the first time on your site. My English is not very well. 抱歉.
I have one question How does any program Expert Advisor reads the price of EURUSD (or GBPUSD ,..) from editor of MT4?
谢谢. Kosta.
肖恩·奥弗顿 说
Use the function MarketInfo()
Khaled 说
Need tour help
I have an EA that i want to sell
But its need to call an indicator ans a dll file
Aldo i have problèmes of checking trade volume before sends orders
Help me please
肖恩·奥弗顿 说
Hi Khaled,
请发送电子邮件 info@onestepremoved.com and ask about Trader Lockdown.
–肖恩
Dee 说
Can someone access all the files on my system through enabling DLL. Or the programmer only have access to my platform
肖恩·奥弗顿 说
Theoretically they could, but your antivirus would likely detect that kind of attempt.