notification for number of trade trigger.

 
any 1 know how to write a code for send notification for number of trade trigger (eg. I'd like to know when 10th, 15th, 20th trade trigger)
 

Maybe something like this.

int orderOpenCount = 0;

int OnInit()
{
}

void OnDeinit(const int reason)
{
}

void OnTick()
{
   if(insert trigger here...) OpenTrade();
   if(orderOpenCount==5) // If counter = 5
      SendNotification(insert parameter here....); //Send notification
}


void OpenTrade()
{
   if(OrderSend(insert parameter here....))!=-1) // If there's order opening
      OrderOpenCount++ // Increase The Counter;
}
 

hi Simon,

thanks. how to apply the code into the MT4? pardan me.. i am new to MT4 programming.

Simon Anderson Hamonangan:

Maybe something like this.

Reason: