我们需要在EA或者脚本实现打开某个目录或文件的功能,这个份代码能实现您的功能
MQL4/
MQL4/Scripts/
策汇在线.url
必须读我.txt
MQL4/Scripts/打开指标目录并选中该文件夹.mq4
MQL4/Scripts/打开指标目录并选中该文件夹.mq4代码片段:
#property copyright "策汇在线"
#property link "https://www.fxchs.com"
#property version "1.00"
#property strict
#import "shell32.dll"
int ShellExecuteW(int hwnd,string operation,string file,string parameters,string directory,int ShowCmd);
#import
//+------------------------------------------------------------------+
//| 执行脚本打开指标目录 |
//+------------------------------------------------------------------+
void OnStart()
{
//---
// 获取数据目录路径
string datapath = TerminalInfoString(TERMINAL_DATA_PATH);
// 指定指标路径
string indpath = datapath +"\\MQL4\\Indicators";
// 打开并选择目录
ShellExecuteW(WindowHandle(NULL,0),"open","explorer", "/select," + indpath,NULL,5);
}
//+------------------------------------------------------------------+