Closing a deal

To add comments, please log in or register
DeltaElectronics
152
DeltaElectronics  

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.

Greg Pawlak
153
Greg Pawlak  
Hi, what do you want to do after detected profit or loss position? send emai? save info to file, journal? for what do you need this info. Regards Greg
DeltaElectronics
152
DeltaElectronics  
Greg Pawlak:
Hi, what do you want to do after detected profit or loss position? send emai? save info to file, journal? for what do you need this info. Regards Greg

My immediate goal is only to detect profit or loss position.

Greg Pawlak
153
Greg Pawlak  
Hi, your statement show you profit and loss position. Regards Greg
DeltaElectronics
152
DeltaElectronics  

@Greg Pawlak

Could you explain how exactly to do ?

Thanks

To add comments, please log in or register