avatar
Profit Alert

MarketBuler 18 3rd Sep, 2020

CPP 1.34 KB
                                           
                         double Profit = OrderProfit ()
              + OrderCommission ()
              + OrderSwap (); 

//+------------------------------------------------------------------+
//| Expert initialization function                                   |
//+------------------------------------------------------------------+
int OnInit()
  {
//---
   
//---
   return(INIT_SUCCEEDED);
  }
//+------------------------------------------------------------------+
//| Expert deinitialization function                                 |
//+------------------------------------------------------------------+
void OnDeinit(const int reason)
  {
//---
   
  }
//+------------------------------------------------------------------+
//| Expert tick function                                             |
//+------------------------------------------------------------------+
void OnTick()
  {
    Profit ();
   
  }
//+------------------------------------------------------------------+
void Profit ()
{

   for(int pf=OrdersTotal()-1;pf>=0;pf--)
     {
      if(OrderSelect(pf,SELECT_BY_POS,MODE_TRADES))
      if(OrderSymbol()==Symbol())
      if(OrderType()==OP_BUY)
      if(Profit>1)
      {
         Comment("Hey you got $1"); PlaySound("\\Files\\you-got-it-2.wav");
      }
     }
}
                      
                                       
To share this paste please copy this url and send to your friends
RAW Paste Data

Comments

Authentication required

You must log in to post a comment.

Log in
    There are no comments yet.