I am trying to figure out how to calculate MAE/MFE for trade analysis and find some references in the LEAN documentation about TradeBuilder/StatisticsBuilder classes. Does anyone know if this can be doe in Python? It looks like it is included in the API docs as self.SetTradeBuilder, but I am sure how to use it and in what context. Any help is appreciated.

Thanks,

Aaron