0

else if (ClosePosition == false)当条件返回真时(换句话说,当我的 EA 未能关闭 EA 开仓头寸时),我如何让我的 EA 只向我的 iPhone 发送一次通知。目前,它在每一个滴答声上都响起。

当满足指定条件时 EA 成功平仓时,函数的ClosePosition布尔值OrderClose()返回。trueClosePosition == false在 EA 未能平仓时返回。

到目前为止,这是我的代码

                   else if(ClosePosition == false)
                   {
                   int failedClosePosition = OrdersTotal()-1;
                   bool fail = OrderSelect(failedClosePosition,SELECT_BY_POS,MODE_TRADES);       
                   if(fail == true)
                      {
                      SendNotification("Order Number #"+IntegerToString(OrderTicket(),10)+" has failed to close. Please refer to error code "+IntegerToString(GetLastError()));
                      }
                   }
4

1 回答 1

0

在没有任何实际解决方案的上下文的情况下(请参阅另一篇文章的更广泛观点)
重复检测到的发送通知的原因应该在第一次发送此类通知时被锁定(想象一组积极发送到的通知:

int ArrayOfNotificationsAlreadySENT[][3];  //[ <OrderTicketNUMBER>,
                                           //  <Notification_E.164_TargetNUMBER>,
                                           //  <TimeStampSECONDS>
                                           //  ],

OrderTicket()数字存储为此类“麻烦制造者”的 UUID)

对于发生重复检测的问题,可能需要扩展定义并添加第四列,您可以在其中更新每个相应 UUID 的故障检测数量,并且(通常)可能使用一些后备策略来减少流量根据一些合理的重新通知“距离”从on-first-detectedon-2nd-detect()on-5th-detect()on-10th-detect()到的消息on-100th-detect()取决于您可行的故障上下文和业务可接受的重新通知密度

于 2016-09-26T11:56:02.467 回答