MQL4 从EA添加指标到图表 - 页 6 123456 新评论 prg_mt4 2021.02.25 22:20 #51 Alain Verleyen: #import "user32.dll" int RegisterWindowMessageW(string MessageName); int PostMessageW(int hwnd,int msg,int wparam,uchar &Name[]); #import #define INDICATOR_NAME "Indicator_name" //+------------------------------------------------------------------+ //| | //+------------------------------------------------------------------+ void StartCustomIndicator(int hWnd,string IndicatorName,bool AutomaticallyAcceptDefaults=false) { uchar name2[]; StringToCharArray(IndicatorName,name2,0,StringLen(IndicatorName)); int MessageNumber=RegisterWindowMessageW("MetaTrader4_Internal_Message"); int r=PostMessageW(hWnd,MessageNumber,15,name2); Sleep(10); } //+------------------------------------------------------------------+ //| | //+------------------------------------------------------------------+ int OnInit() { //--- // In my code where I launch the indicator int hWnd=WindowHandle(Symbol(),0); StartCustomIndicator(hWnd,INDICATOR_NAME); return(INIT_SUCCEEDED); } 你好 我试图在SCRIPT中使用这段代码,但有时我的metatrader关闭得很厉害。 你知道问题出在哪里吗? Philippe Pauleau 2021.08.18 23:24 #52 Chart.mqh是相当明显的........ //+------------------------------------------------------------------+ //| Chart.mqh | //| Copyright 2009-2016, MetaQuotes Software Corp. | //| http://www.mql5.com | //+------------------------------------------------------------------+ #include <Object.mqh> //--- #ifdef __MQL4__ bool ChartIndicatorAdd(long chart_id,int subwin,int handle) { return(false); } #endif Dadas 2022.03.07 11:04 #53 Alain Verleyen 添加代码 来模拟按键,就像你手动操作一样。 不起作用。我需要从一个指标中执行添加指标的代码。我尝试了很多解决方案,但没有得到任何结果。我想添加的指标被添加了,但指标配置窗口一直开着,等待手动确认。 我是在MT4 Build 1353中这样做的。 说白了,这些代码在脚本中运行良好,键盘模拟也在脚本中运行。 从指标上看,运气不好... Raphael Adetunji Olaiyapo 2022.04.30 22:27 #54 Nicolas Baptista 自定义指标,否则请更改窗口名称。 注2:不要使用超过15个字符的指标(在".ex4 "之前)。 优秀 Daying Cao 2022.07.17 00:04 #55 Alain Verleyen #: Hello! When this method starts the indicator, the indicator parameter window pops up. Can you run the indicator directly without popping the parameter window? 123456 新评论 您错过了交易机会: 免费交易应用程序 8,000+信号可供复制 探索金融市场的经济新闻 注册 登录 拉丁字符(不带空格) 密码将被发送至该邮箱 发生错误 使用 Google 登录 您同意网站政策和使用条款 如果您没有帐号,请注册 可以使用cookies登录MQL5.com网站。 请在您的浏览器中启用必要的设置,否则您将无法登录。 忘记您的登录名/密码? 使用 Google 登录
Alain Verleyen:
你好
我试图在SCRIPT中使用这段代码,但有时我的metatrader关闭得很厉害。
你知道问题出在哪里吗?
Chart.mqh是相当明显的........
不起作用。我需要从一个指标中执行添加指标的代码。我尝试了很多解决方案,但没有得到任何结果。我想添加的指标被添加了,但指标配置窗口一直开着,等待手动确认。
说白了,这些代码在脚本中运行良好,键盘模拟也在脚本中运行。我是在MT4 Build 1353中这样做的。
从指标上看,运气不好...
注2:不要使用超过15个字符的指标(在".ex4 "之前)。
Hello!
When this method starts the indicator, the indicator parameter window pops up. Can you run the indicator directly without popping the parameter window?