Alert at Order Closing [ ru ]

0
(0)
Name:
Alert at Order Closing [ ru ]
Author: cmillion (2010.04.26 12:41)
Downloaded: 2859
Download:
Alert at Order Closing [ ru ] 1
 AlertCloseOrderEN.mq4 (1.3 Kb) View

Description:

The indicator alerts at order closing, and reports about its profit.

//+------------------------------------------------------------------+
//|                                              AlertCloseOrder.mq4 |
//|                               Copyright © 2010, Vladimir Hlystov |
//|                                         http://cmillion.narod.ru |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2010, Vladimir Hlystov"
#property link      "http://cmillion.narod.ru"
#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";
      Alert("Order N ",OrderTicket()," close in ",txt," ",
      DoubleToStr(OCP,Digits)," profit ",DoubleToStr(OrderProfit(),2));
}  }
//+------------------------------------------------------------------+

How useful was this post?

Click on a star to rate it!

Average rating 0 / 5. Vote count: 0

No votes so far! Be the first to rate this post.

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?



Author: Forex Wiki Team
We are a team of highly experienced Forex Traders [2000-2023] who are dedicated to living life on our own terms. Our primary objective is to attain financial independence and freedom, and we have pursued self-education and gained extensive experience in the Forex market as our means to achieve a self-sustainable lifestyle.