Hi,
read up on Analyzers (https://www.backtrader.com/docu/analyzers/analyzers.html), especially https://www.backtrader.com/docu/analyzers-reference.html#tradeanalyzer and https://www.backtrader.com/docu/analyzers-reference.html#transactions.
Basically you attach the analyzer(s) to the Cerebro instance, run the test and get the analyzers after the test is finished.