How do I close equal deals of buying and selling.
Example :
You bought a buy position, lost 40 pips, and then opened a sell position, gained 40 pips, and a new buy position was opened.
How can I close equal deals in case there is more than one SELL and BUY transaction?