82评论

0收藏

移动止损买单正常卖单不移止看看这段有什么问题吗

avatar 月与灯依旧 | 14099 人阅读 | 82 人评论 | 2021-12-23

悬赏任务 10金币
void CheckForModifyPositions()
{
   for(int i = 0; i < OrdersTotal(); i++)
   {
      if(OrderSelect(i, SELECT_BY_POS, MODE_TRADES) == false)
         break;
      if(OrderMagicNumber() != MAGICMA || OrderSymbol() != SYMBOL)
         continue;

      if(OrderType() == OP_BUY)
      {
         if(TRAILINGSTOP > 0)
            if(Bid - OrderOpenPrice() > Point * TRAILINGSTOP)
              if(OrderStopLoss() < Bid-Point * TRAILINGSTOP)
                 OrderModify(OrderTicket(), OrderOpenPrice(), Bid - Point*TRAILINGSTOP, OrderTakeProfit(), 0, Blue);
      }
      else if(OrderType() == OP_SELL)
      {
         if(TRAILINGSTOP > 0)
            if(Ask + OrderOpenPrice() < Point * TRAILINGSTOP)
              if(OrderStopLoss()>Ask + Point * TRAILINGSTOP)
                 OrderModify(OrderTicket(), OrderOpenPrice(), Ask + Point * TRAILINGSTOP, OrderTakeProfit(), 0, Red);
      }
   }
}



补充内容 (2021-12-26 09:15):
已解决删除不了

""
还没有人打赏,支持一下

评论|共 82 个

外汇通否

发表于 2021-12-27 14:52:35 | 显示全部楼层

谢谢

周晓晓

发表于 2021-12-28 17:05:22 | 显示全部楼层

谢谢

梦想成

发表于 2021-12-30 17:41:05 | 显示全部楼层

盈胜外汇

发表于 2021-12-30 18:27:06 | 显示全部楼层

支持下

外汇通否

发表于 2022-1-1 22:47:57 | 显示全部楼层

顶下

任逍遥

发表于 2022-1-6 16:34:23 | 显示全部楼层

不羁的欣

发表于 2022-1-10 17:04:29 | 显示全部楼层

阿康

发表于 2022-1-10 19:52:46 | 显示全部楼层

谢谢

阿发达

发表于 2022-1-11 19:27:52 | 显示全部楼层

您需要登录后才可以回帖 登录 | 注册 微信登录

EA之家评论守则