I am trying to display the total profit / return per symbol when working with strategies with multiple symbols in order to realise for which symbol the strategy works better.  I use the below code, to display the total profit per symbol, but it prints the total profit every once per day for every symbol, resulting to huge logs. I only want to display the total profit per symbol once in the end of the backtest.

 

 def OnEndOfDay(self, symbol):

    if self.IsWarmingUp:
       return

    for sec in self.cryptos:

       if self.Portfolio[sec].Invested:

        returns = (self.Securities[sec].Price - self.Portfolio[sec].AveragePrice) / self.Portfolio[sec].AveragePrice
        self.Debug(f"Symbol: {sec}, Total Profit: {returns:.4%}")