First calculate what is the unrealized PNL as of start date by using:
(Market Price of start date - Ave Price as of start date) x Quantity
The result is the amount of unrealized PNL in the start networth that needs to be negated from the starting networth.
After negation, all PNL of the closed position will then be captured under Realized PNL.
The net amount of the values under realized PNL and unrealized PNL is fees from the trade.