欢迎访问 外汇EA下载与MT4/MT5自动交易资源 - 聚合外汇EA、黄金EA、量化交易工具与自动化交易实战内容。
登录 注册

Error_Break_Script_V2 - This script is a general example of using error brake in any strategy - Break on Code Error Sample Strategy - script for MetaTrader 4

author emer | 484 人阅读 | 0 人评论 |

Error_Break_Script_V2  - This script is a general example of using error brake in any strategy - Break on Code Error Sample Strategy - script for MetaTrader 4

Error_Break_Script_V2  - This script is a general example of using error brake in any strategy - Break on Code Error Sample Strategy - script for MetaTrader 4

Error_Break_Script_V2 修订

版本 1 - Error_Break_Script_V1 已删除

Version2 中的修复实现:

//+------------------------------------------------------------------+

//| Break_On_Error                                                        |

//+------------------------------------------------------------------+

int Break_On_Error(){

    int error_code = GetLastError();

    字符串 error_string = ErrorDescription(error_code);

    Print("错误:", error_string," ",error_code);

    返回错误代码;

//+------------------------------------------------------------------+

测试成功:

Error_Break_Script_V2  - This script is a general example of using error brake in any strategy - Break on Code Error Sample Strategy - script for MetaTrader 4

Error_Break_Script_V2  - This script is a general example of using error brake in any strategy - Break on Code Error Sample Strategy - script for MetaTrader 4


附件下载

📎 error_break_script_v2.mq4 (10.56 KB)

Source: MQL5 #48803

🔐
请登录后参与评论
注册满12小时后评论,即可解锁附件下载
立即登录