文章 "基于通用 MLP 逼近器的EA" - 页 2 12 新评论 Andrey Dik 2025.08.06 19:47 #11 Eric Ruvalcaba #:非常感谢你分享这篇文章和你的见解。好主意。我实施了一些独立的头寸处理,并在对冲账户(我的经纪商)上运行起来了你是最棒的。 超级棒 John_Freeman 2026.01.03 07:08 #12 亲爱的作者,我重读了 TargetFunction() 代码好几遍,你似乎犯了一些错误。1.在计算仓位利润时,您对利润进行了双重求和。 if (!truTradeTime [h]) { if (posType != 0) { // 如果有空位 posClPrice = rates [h].open; // 以栏位开盘价收盘 profit = (posClPrice - posOpPrice) * signal - 0.00003; // 委员会 if (profit > 0.0) allProfit += profit; else allLoss += -profit; if (posType == 1) buys++; else sells++; allProfit += profit; posType = 0; // 重置位置 } continue; // 跳过非交易时间 } if ((posType == 1 && signal == -1) || (posType == -1 && signal == 1)) { posClPrice = rates [h].open; // 以当前条形图的开盘价收盘 profit = (posClPrice - posOpPrice) * signal - 0.00003; // 利润计算 // 损益核算 if (profit > 0.0) allProfit += profit; else allLoss += -profit; // 交易统计 if (posType == 1) buys++; else sells++; allProfit += profit; posType = 0; // 关闭位置 } 2.计算适应性指数时不使用 Ko 系数。 double ko = 1.0; if (sells == 0 || buys == 0) return -DBL_MAX; if (sells / buys > 1.5 || buys / sells > 1.5) ko = 0.001; return (allProfit / (allLoss + DBL_EPSILON)) * dealsNumb; Andrey Dik 2026.01.03 19:25 #13 John_Freeman #:亲爱的作者,我重读了 TargetFunction() 代码好几遍,你似乎犯了一些错误。1.在计算仓位利润时,您对利润进行了双重求和。 2.计算适应性指数时不使用 Ko 系数。 1.是的,您说得对,删除两个代码块末尾的行allProfit += profit;使其看起来像这样:f (!truTradeTime [h]) { if (posType != 0) { // 如果有空位 posClPrice = rates [h].open; // 以栏位开盘价收盘 profit = (posClPrice - posOpPrice) * signal - 0.00003; // 委员会 if (profit > 0.0) allProfit += profit; else allLoss += -profit; if (posType == 1) buys++; else sells++; //allProfit += profit; posType = 0; // 重置位置 } continue; // 跳过非交易时间 } if ((posType == 1 && signal == -1) || (posType == -1 && signal == 1)) { posClPrice = rates [h].open; // 以当前条形图的开盘价收盘 profit = (posClPrice - posOpPrice) * signal - 0.00003; // 利润计算 // 损益核算 if (profit > 0.0) allProfit += profit; else allLoss += -profit; // 交易统计 if (posType == 1) buys++; else sells++; //allProfit += profit; posType = 0; // 关闭位置 }2.是的,没有使用 ko。 12 新评论 您错过了交易机会: 免费交易应用程序 8,000+信号可供复制 探索金融市场的经济新闻 注册 登录 拉丁字符(不带空格) 密码将被发送至该邮箱 发生错误 使用 Google 登录 您同意网站政策和使用条款 如果您没有帐号,请注册 可以使用cookies登录MQL5.com网站。 请在您的浏览器中启用必要的设置,否则您将无法登录。 忘记您的登录名/密码? 使用 Google 登录
非常感谢你分享这篇文章和你的见解。好主意。我实施了一些独立的头寸处理,并在对冲账户(我的经纪商)上运行起来了
你是最棒的。
超级棒
亲爱的作者,我重读了 TargetFunction() 代码好几遍,你似乎犯了一些错误。
1.在计算仓位利润时,您对利润进行了双重求和。
2.计算适应性指数时不使用 Ko 系数。亲爱的作者,我重读了 TargetFunction() 代码好几遍,你似乎犯了一些错误。
1.在计算仓位利润时,您对利润进行了双重求和。
2.计算适应性指数时不使用 Ko 系数。