Обновил «KAE Grid Ver. 1.4»
www.opentraders.ru/downloads/edit/3955/
if(OrderType()==OP_BUY)
{
if(b>0 && TakeProfit!=0 && Bid>=op + TakeProfit * Point)
{
if (OrderClose(OrderTicket(),OrderLots(),NormalizeDouble(Bid,Digits),Slippage,clrNONE))
Print("Virt TP Buy");
}
if(b>=2)
{
if(tk==BuyPriceMaxTic || tk==BuyPriceMinTic)
if(Bid<AwerageBuyPrice && tp!=AwerageBuyPrice)
if(!OrderModify(tk,op,OrderStopLoss(),AwerageBuyPrice,0,clrNONE))
Print("OrderModify error #",GetLastError());
if(tk!=BuyPriceMaxTic && tk!=BuyPriceMinTic && tp!=0)
if(!OrderModify(tk,op,0,0,0,clrNONE))
Print("OrderModify error #",GetLastError());
}
}
if(OrderType()==OP_SELL)
{
if(s>0 && TakeProfit!=0 && Ask<=op - TakeProfit * Point)
{
if (OrderClose(OrderTicket(),OrderLots(),NormalizeDouble(Bid,Digits),Slippage,clrNONE))
Print("Virt TP Sell");
}
if(s>=2)
{
if(tk==SelPriceMaxTic || tk==SelPriceMinTic)
if(Ask>AwerageSelPrice && tp!=AwerageSelPrice)
if(!OrderModify(tk,op,OrderStopLoss(),AwerageSelPrice,0,clrNONE))
Print("OrderModify error #",GetLastError());
if(tk!=SelPriceMaxTic && tk!=SelPriceMinTic && tp!=0)
if(!OrderModify(tk,op,0,0,0,clrNONE))
Print("OrderModify error #",GetLastError());
}
}
OSS5