#property copyright ""
#property link ""
#property indicator_chart_window
int Orders;
//+------------------------------------------------------------------+
int start()
{
if (Orders>OrdersTotal()) AlertOrder();
Orders=OrdersTotal();
return(0);
}
//+------------------------------------------------------------------+
void AlertOrder()
{
string txt;
double ocp;
int i=OrdersHistoryTotal()-1;
if(OrderSelect(i,SELECT_BY_POS,MODE_HISTORY)==true)
{
ocp=OrderClosePrice();
if (ocp==OrderStopLoss()) txt=«SL»;
if (ocp==OrderTakeProfit()) txt=«TP»;
string lots=DoubleToStr(OrderLots(),2);
SendNotification(«Ордер „+“(»+lots+")"+" закрыт по "+txt+" "+
DoubleToStr(ocp,Digits)+" прибыль "+DoubleToStr(OrderProfit(),2));
} }
//+------------------------------------------------------------------+