评论

收藏

发一段追迹止损的代码,求金币

avatar 鸿运当归 | 854 人阅读 | 0 人评论 | 2019-11-26

if(SellTicket>0)
{      
        Selected = OrderSelect(SellTicket,SELECT_BY_TICKET);
             double CurrentPrice = Ask;
             double SellStopPO = OrderOpenPrice();
             double SellStopSL = OrderStopLoss();
             double SellStopPips = SellStopSL-SellStopPO;
            
             if(CurrentPrice < SellStopPO-SellStopPips*1 && CurrentPrice > SellStopPO-SellStopPips*2 && OrderType() == OP_SELL)
             {
                   Selected = OrderSelect(SellTicket,SELECT_BY_TICKET);
                   double NewStopLoss = SellStopPO-SellStopPips*0.1;
                   bool TicketMod = OrderModify(SellTicket,OrderOpenPrice(),NewStopLoss,OrderTakeProfit(),OrderExpiration(),White);
             }
             if(CurrentPrice < SellStopPO-SellStopPips*2 && CurrentPrice > SellStopPO-SellStopPips*3 && OrderType() == OP_SELL)
             {
                   Selected = OrderSelect(SellTicket,SELECT_BY_TICKET);
                   double NewStopLoss = SellStopPO-SellStopPips*1;
                   bool TicketMod = OrderModify(SellTicket,OrderOpenPrice(),NewStopLoss,OrderTakeProfit(),OrderExpiration(),White);
             }
}

""
还没有人打赏,支持一下
您需要登录后才可以回帖 登录 | 注册 微信登录

EA之家评论守则