月与灯依旧 发表于 2021-12-23 15:27:42

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

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):
已解决删除不了

外汇通否 发表于 2021-12-27 14:52:35

谢谢

周晓晓 发表于 2021-12-28 17:05:22

谢谢

梦想成 发表于 2021-12-30 17:41:05

{:1_181:}

盈胜外汇 发表于 2021-12-30 18:27:06

支持下

外汇通否 发表于 2022-1-1 22:47:57

顶下

任逍遥 发表于 2022-1-6 16:34:23

{:1_181:}

不羁的欣 发表于 2022-1-10 17:04:29

{:1_186:}

阿康 发表于 2022-1-10 19:52:46

谢谢

阿发达 发表于 2022-1-11 19:27:52

{:1_181:}
页: [1] 2 3 4 5 6 7 8 9
查看完整版本: 移动止损买单正常卖单不移止看看这段有什么问题吗