//+------------------------------------------------------------------+
void BU()
{
for(int i=0; i<OrdersTotal(); i++)
{
if(OrderSelect(i,SELECT_BY_POS,MODE_TRADES))
{
if(OrderType()==OP_BUY)
{
if(OrderOpenPrice()<=(Bid-(BULevel+20)*Point) && OrderOpenPrice()>OrderStopLoss())
{
bool m=OrderModify(OrderTicket(),OrderOpenPrice(),OrderOpenPrice()+20*Point,OrderTakeProfit(),0,Green);
}
}
if(OrderType()==OP_SELL)
{
if(OrderOpenPrice()>=(Ask+(BULevel+20)*Point) && OrderOpenPrice()<OrderStopLoss())
{
m=OrderModify(OrderTicket(),OrderOpenPrice(),OrderOpenPrice()-20*Point,OrderTakeProfit(),0,Green);
}
}
}
}
}
//+------------------------------------------------------------------+
//+------------------------------------------------------------------+
void BU()
{
for(int i=0; i<OrdersTotal(); i++)
{
if(OrderSelect(i,SELECT_BY_POS,MODE_TRADES))
{
if(OrderType()==OP_BUY)
{
if(OrderOpenPrice()<=(Bid-(BULevel+20)*Point) && OrderOpenPrice()>OrderStopLoss())
{
bool m=OrderModify(OrderTicket(),OrderOpenPrice(),OrderOpenPrice(),OrderTakeProfit(),0,Green);
}
}
if(OrderType()==OP_SELL)
{
if(OrderOpenPrice()>=(Ask+(BULevel+20)*Point) && OrderOpenPrice()<OrderStopLoss())
{
m=OrderModify(OrderTicket(),OrderOpenPrice(),OrderOpenPrice(),OrderTakeProfit(),0,Green);
}
}
}
}
}
//+------------------------------------------------------------------+
AM2