説明:
The indicator alerts at order closing, and reports about its profit.
//+------------------------------------------------------------------+
//| AlertCloseOrder.mq4 |
//| 著作権© 2010, Vladimir Hlystov |
//| http://cmillion.narod.ru |
//+------------------------------------------------------------------+
#財産の著作権 "著作権© 2010, Vladimir Hlystov"
#プロパティリンク "http://cmillion.narod.ru"
#property indicator_chart_window
int Orders;
//+------------------------------------------------------------------+
整数の開始()
{
もしも (注文>注文合計()) AlertOrder();
Orders=OrdersTotal();
戻る(0);
}
//+------------------------------------------------------------------+
void AlertOrder()
{
string txt;
double OCP;
int i=OrdersHistoryTotal()-1;
もしも(オーダー選択(私,SELECT_BY_POS,MODE_HISTORY)==true)
{
OCP=OrderClosePrice();
もしも (OCP==OrderStopLoss() ) txt="SL";
もしも (OCP==OrderTakeProfit()) txt="TP";
アラート("Order N ",OrderTicket()," close in ",TXT," ",
DoubleToStr(OCP,数字)," 利益 ",DoubleToStr(OrderProfit(),2));
} }
//+------------------------------------------------------------------+
|