Hello to everybody,
My goal is to write an EA which react in a particular way once I close a specified deal; i.e. suppose I have just closed a specified deal by the following code
ticket = PositionGetTicket(i);
print("Opened order ticket no.: "+IntegerToString(ticket)+" closed"); m_trade.PositionClose(ticket);
where the index ‘i’ refers to the selected openend position
Then I want in my OnTradeTransaction(const MqlTradeTransaction& trans, const MqlTradeRequest& request, const MqlTradeResult& result) detect the deal just closed in order, for example, to detect the gain or the loss.
Advanced thank to everybody will help me.