Help with Summing Daily DrawDown Data in MQL5 Table

 

I have an indicator that displays account information along with details about trades made during the current day and previous days. The indicator shows information on both the right and left sides of the chart, reading from the trading history. With my limited programming knowledge, I've added functionality to the table to display the daily DrawDown during open positions. As the DrawDown increases, the value is updated in real-time on the left side of the table.

Each day's data is saved in a .csv file and displayed in the table based on the days selected for viewing. However, I haven’t been able to get the DrawDown data to sum up at the end of the table like the other values derived from the trading history (see attached image). Since the DrawDown data comes from an external file, I can't figure out how to display a cumulative total for the week, month, and year.

If anyone has suggestions on how to achieve this, I’d appreciate the help. I've attached the MQL5 file for reference.

Thank you in advance!

TradeInfo
Files: