OnTrade() operates in mql4?
how i solution it
int totalOrders = OrdersTotal();
void OnTick(){
//void OnTradeGambiarra(){
if(totalOrders != OrdersTotal()){
//+-----------
//Ur CODE HERE
totalOrders = OrdersTotal();
}
//}
}
Not really. Triggers if an order opens or closes on any chart. Does not trigger if a pending order opens.
Thank you for the correction, I got it. Because the number of orders did not change when it was still pending vs when it was open position.
If we have to calculate the total number of pending orders using looping will slow down the system.
Means to deal with sub -programs related to pending orders will be more efficient using OnTimer.
OnTrade() operates in mql4?
Accustomed to mql5, I see that does not work in mql4... It's like that?