//+------------------------------------------------------------------+ //| ZigZagBollingerEA.mq4 | //| Copyright 2024, MetaQuotes Software Corp. | //| https://www.mql5.com | //+------------------------------------------------------------------+ #property copyright "Copyright 2024, MetaQuotes Software Corp." #property link "https://www.mql5.com" #property version "1.00" #pro


al()-1; i>=0; i--) { if(OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) { if(OrderSymbol() == Symbol() && OrderType() == OP_BUY) { OrderClose(OrderTicket(), OrderLots(), Bid, 3, Red); } } } } //+------------------------------------------------------------------+ //| 统计当前订单数量 | //+------------------------------------------------------------------+ int CountOrders() { int count = 0; for(int i=0; i<OrdersTotal(); i++) { if(OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) { if(OrderSymbol() == Symbol()) { count++; } } } return count; } //+------------------------------------------------------------------+ //| 判断是否是新K线 | //+------------------------------------------------------------------+ bool IsNewBar() { static datetime lastBarTime = 0; datetime currentBarTime = Time[0]; if(lastBarTime != currentBarTime) { lastBarTime = currentBarTime; return true; } return false; } 这个EA交易策略基于ZigZag指标和布林带指标设计,主要逻辑是: 1. 当ZigZag指标从布林带下轨下方反弹至上轨上方时开立买单 2. 当ZigZag指标触及布林带上轨时平仓 3. 使用固定点数止损 代码结构清晰,包含必要的功能模块: - 初始化指标句柄 - 检测新K线 - 查找ZigZag转折点 - 开仓和平仓逻辑 - 订单管理功能 潜在改进建议: 1. 增加止盈策略 2. 添加卖出信号逻辑 3. 考虑加入资金管理规则 4. 增加交易时间过滤 5. 添加错误处理和日志记录 该EA适合在趋势行情中使用,在震荡行情中可能会频繁交易。建议在实盘前进行充分测试,调整参数以适应不同市场条件。 [2025-04-23 10:57:55 | AI问答 | 446点数解答]
- //+------------------------------------------------------------------+ //| ZigZagBollingerEA.mq4 | //| Copyright 2024, MetaQuotes Software Corp. | //| https://www.mql5.com | //+------------------------------------------------------------------+ #property copyright "Copyright 2024, MetaQuotes Software Corp." #property link "https://www.mql5.com" #property version "1.00" #pro(504点数解答 | 2025-04-23 10:56:16)104
- //+------------------------------------------------------------------+ //| ZigZagBollingerEA.mq4 | //| Copyright 2024, MetaQuotes Software Corp. | //| https://www.mql5.com | //+------------------------------------------------------------------+ #property copyright "Copyright 2024, MetaQuotes Software Corp." #property link "https://www.mql5.com" #property version "1.00" #pro(446点数解答 | 2025-04-23 10:57:55)101
- //+------------------------------------------------------------------+ //| 12.mq4 | //| Copyright 2025, MetaQuotes Ltd. | //| https://www.mql5.com | //+------------------------------------------------------------------+ #property copyright "Copyright 2025, MetaQuotes Ltd." #property link "https://www.mql5.com" #property version "1.00" #property strict //+-(1140点数解答 | 2025-04-22 16:27:33)111
- //+------------------------------------------------------------------+ //| 12.mq4 | //| Copyright 2025, MetaQuotes Ltd. | //| https://www.mql5.com | //+------------------------------------------------------------------+ #property copyright "Copyright 2025, MetaQuotes Ltd." #property link "https://www.mql5.com" #property version "1.00" #property strict //+-(376点数解答 | 2025-04-22 16:30:23)123
- //+------------------------------------------------------------------+ //| 12.mq4 | //| Copyright 2025, MetaQuotes Ltd. | //| https://www.mql5.com | //+------------------------------------------------------------------+ #property copyright "Copyright 2025, MetaQuotes Ltd." #property link "https://www.mql5.com" #property version "1.00" #property strict //+-(542点数解答 | 2025-04-22 19:11:15)121
- //+------------------------------------------------------------------+ //| 12.mq4 | //| Copyright 2025, MetaQuotes Ltd. | //| https://www.mql5.com | //+------------------------------------------------------------------+ #property copyright "Copyright 2025, MetaQuotes Ltd." #property link "https://www.mql5.com" #property version "1.00" #property strict //+-(415点数解答 | 2025-04-22 19:15:40)158
- 按照本框架整理代码策略用于外汇EA自动交易//+------------------------------------------------------------------+ //| 12.mq4 | //| Copyright 2025, MetaQuotes Ltd. | //| https://www.mql5.com | //+------------------------------------------------------------------+ #property strict //+------------------------------------------------------------------+ //| Expert initialization function | //+-------------------- 买入条件:阴阳烛的最低价同时低于周期为2的平均线周期和为20的布林带下轨线,并且随机指标(Stochastic)的值小于5,MACD值小于5,下买单,每根阴阳烛触发次数小于3,设置固定的止损值为30,固定止盈800。阴阳(405点数解答 | 2025-04-24 11:26:01)108
- 按照本框架整理代码策略用于外汇EA自动交易//+------------------------------------------------------------------+ //| 12.mq4 | //| Copyright 2025, MetaQuotes Ltd. | //| https://www.mql5.com | //+------------------------------------------------------------------+ #property strict //+------------------------------------------------------------------+ //| Expert initialization function | //+-------------------- 买入条件:阴阳烛的最低价同时低于周期为2的平均线周期和为20的布林带下轨线,并且随机指标(Stochastic)的值小于5,MACD值小于5,下买单,每根阴阳烛触发次数小于3,设置固定的止损值为30,固定止盈800。阴阳(1184点数解答 | 2025-04-24 11:27:55)101
- select uid, msg_id, session_id, msg_created_time, sender_role_type, msg_title, msg_content, question_id, answer_scene from atta_boss.dwd_fact_boss_im_message_h where pt = '20240928' and p_hour = '23' and sender_role_type in ('sale','acct_user') and msg_created_time between '2024-09-01 00:00:00' and '2024-09-29 00:00:00' and msg_content like "%美国|英国|澳大利亚%" limit 1000; 上述sql有什么语法错误(341点数解答 | 2024-09-29 21:37:36)199
- ssd_send(0x11,ff,03,98,81,03); //gip_1 ssd_send(0x11,01,01,00); ssd_send(0x11,02,01,00); ssd_send(0x11,03,01,53); ssd_send(0x11,04,01,13); ssd_send(0x11,05,01,00); ssd_send(0x11,06,01,04); ssd_send(0x11,07,01,00); ssd_send(0x11,08,01,00); ssd_send(0x11,09,01,22); ssd_send(0x11,0a,01,22); ssd_send(0x11,0b,01,00); ssd_send(0x11,0c,01,01); ssd_send(0x11,0d,01,00); ssd_send(0x11,0e,01,00); ssd_send(0x11,0f,01,25);(64点数解答 | 2024-11-06 16:52:19)232
- 救援争先 内存限制: 256 Mb时间限制: 1000 ms 题目描述 某地出现了灾害,各地派出了 n n 只救援队。这些救援队是在同一天出发的,但出发时间不一样,路程也有长有短,所以达到时间有先有后。 给定每个队伍的出发时间,以及每只队伍的路程,请按照到达时间为这些队伍排序,如果多只队伍的到达时间正好相等,则出发时间靠前的队伍排在前列,如果出发时间仍然相等,则编号较小的队伍排在前列。 输入格式 第一行:单个整数 n n,表示救援队数量。 第二行到第 n + 1 n+1 行:在第 i + 1 i+1 行,有两个时间,表示第 i i 只救援队的出发时间和路程,数据格式均为 hh:mm: hh 表示小时,在 00 到 23 之间; mm 表示分钟,在 00 到 59 之间。 输出格式 共 n n 行,每行一个整数,按救援队到达的先后顺序输出它们的编号。 数据范围 1 ≤ n ≤ 1000 1≤n≤1000。 样例数据 输入: 3 19:00 01:00 15:00 05:00 15:00 05:00 输出: 2 3 1 说明: 3只队伍同时到达,2号和3号出发较早,所(693点数解答 | 2025-08-07 10:56:54)107
- 救援争先 内存限制: 256 Mb时间限制: 1000 ms 题目描述 某地出现了灾害,各地派出了 n n 只救援队。这些救援队是在同一天出发的,但出发时间不一样,路程也有长有短,所以达到时间有先有后。 给定每个队伍的出发时间,以及每只队伍的路程,请按照到达时间为这些队伍排序,如果多只队伍的到达时间正好相等,则出发时间靠前的队伍排在前列,如果出发时间仍然相等,则编号较小的队伍排在前列。 输入格式 第一行:单个整数 n n,表示救援队数量。 第二行到第 n + 1 n+1 行:在第 i + 1 i+1 行,有两个时间,表示第 i i 只救援队的出发时间和路程,数据格式均为 hh:mm: hh 表示小时,在 00 到 23 之间; mm 表示分钟,在 00 到 59 之间。 输出格式 共 n n 行,每行一个整数,按救援队到达的先后顺序输出它们的编号。 数据范围 1 ≤ n ≤ 1000 1≤n≤1000。 样例数据 输入: 3 19:00 01:00 15:00 05:00 15:00 05:00 输出: 2 3 1 说明: 3只队伍同时到达,2号和3号出发较早,所(432点数解答 | 2025-08-07 10:58:12)69