有您的持续关注
我们会做得更好

EA一个移动止损的函数模块



一个移动止损的函数模块
void TrailingStairs(int ticket,int trldistance)
{
int Spred=Ask – Bid;
if (OrderType()==OP_BUY)
{
if((Bid-OrderOpenPrice())>(Point*trldistance))
{
if(OrderStopLoss()<Bid-Point*trldistance || (OrderStopLoss()==0))
{
OrderModify(ticket,OrderOpenPrice(),Bid-Point*trldistance,OrderTakeProfit(),0,Green);
if (PolLots)
if
(NormalizeDouble(OrderLots()/2,2)>MarketInfo(Symbol(),
MODE_MINLOT))
{
OrderClose(ticket,NormalizeDouble(OrderLots()/2,2),Ask,3,Green);
}
else
{
OrderClose(ticket,OrderLots(),Ask,3,Green);
}
}
}
}
else
{
if((OrderOpenPrice()-Ask)>(Point*trldistance))
{
if((OrderStopLoss()>(Ask+Point*trldistance)) || (OrderStopLoss()==0))
{
OrderModify(OrderTicket(),OrderOpenPrice(),Ask+Point*trldistance,OrderTakeProfit(),0,Red);
if (PolLots)
if
(NormalizeDouble(OrderLots()/2,2)>MarketInfo(Symbol(),
MODE_MINLOT))
{
OrderClose(ticket,NormalizeDouble(OrderLots()/2,2),Bid,3,Green);
}
else
{
OrderClose(ticket,OrderLots(),Bid,3,Green);
}
}
}
}
}

如您喜欢此文章请点下面分享按钮↴峰汇在线 » EA一个移动止损的函数模块
上一篇:
下一篇:
分享到:更多 ()