Foreign exchange mt4 prepares EA, the specific requirements are: write code to judge whether the last order (liquidation order) is profit or loss.
if(order SELECT(ordershistortotal()- 1,SELECT_BY_POS,MODE_HISTORY))
{
if(order profit()>; 0)
{
Print ("last single profit");
} Otherwise,
{
Print ("last single profit");
}
}