need programming help

 
How would I code this :


IF ACCOUNT BALANCE HAS INCREASED THEN ....



thanks
 
Do it

if (AccountBalance()>PrevBalance)
{
// some operaions
PrevBalance=AccountBalance();
}
 

what about

IF AN OPEN POSITION HAS JUST CLOSED THEN ....


that is I have just completed a trade (any trade)

 
Well, such example

if (OrderProfit()>0)
{
//  some operations
}

See https://docs.mql4.com/trading/OrderProfit You must find last closed order, use for it https://docs.mql4.com/trading/OrderSelect and https://docs.mql4.com/trading/OrderCloseTime