the best way to do is a print to file, and the output that is already generated in a MT5 backtest, has a unused column, and it easiest to replace that data with whatever calculation you require. Dang...I wish I had that project. Someone else did it and showed it to me, Ill see if I can find it.