此资源为星钻会员专享,每日更新,收录于《大白EA宝库:星钻会员专属合集》。
为所有订单和所有品种统一设置追踪止损的工具 EA:不用逐单逐品种设,挂上后全账户的持仓按同一规则跟随移动止损位。
源码预览(先看代码,再决定下不下)
本帖是源码 EA:Trailing_StopLoss_for_All_orders_and_symbols.mq4,全文共 93 行。下面是它的全部可调参数与文件开头,完整源码在上方下载区,星钻会员可见。
可调参数(2 个)
int TrailStart = 20;(Trailing start level in pips)int TrailStop = 10;(Trailing stop level in pips)
//+------------------------------------------------------------------+
//| Trailing_StopLoss_for All_orders_and_symbols.mq4 |
//| Copyright 2023, MetaQuotes Ltd. |
//| https://www.b123.com/ |
//+------------------------------------------------------------------+
//+------------------------------------------------------------------+
//|This script will trail the stop loss of all open buy and sell orders.
//|Adjust the TrailStart and TrailStop parameters to your preferred levels.
//|This is a basic example and can be further optimized and customized
//|based on your specific requirements.
//+------------------------------------------------------------------+
#property copyright "Copyright 2024, MetaQuotes Ltd."
#property link "https://www.b123.com/"
#property version "1.01"
#property description "https://www.b123.com/"
#property description "IP 2024 - free open source"
#property description "Trailing_StopLoss_for All_orders_and_symbols"
#property description ""
#property description "WARNING: Use this software at your own risk."
#property description "The creator of this script cannot be held responsible for any damage or loss."
#property description ""
#property strict
#property show_inputs
#property script_show_inputs
// Input parameters
extern int TrailStart = 20; // Trailing start level in pips
extern int TrailStop = 10; // Trailing stop level in pips
//+------------------------------------------------------------------+
//| Expert initialization function |
//+------------------------------------------------------------------+
void OnInit()
{
}
风险提示:EA 交易有风险,过往与参数表现不代表未来。正式使用前先在模拟盘跑够样本,确认在自己的点差、滑点环境下仍符合预期,再决定是否上实盘。
版本说明:资源随 MT4/MT5 版本迭代可能失效,如遇失效请在本帖留言反馈。

