I can not program Martingale in this EA

 
Hello everyone,

I made an EA based on Heiken Ashi, and I need to apply the martingale strategy, I made a class for Martingale and I put the martingale factor as an input for the user, but at the time of backteste the calculation of the martingale is incorrect, example initial lot  of 0.1 and martingale factor of 1.5 the next trade should be 0.15 but in the backtest it is giving 0.22
I believe that my code has something wrong, could anyone help findind here is my mistake in the programming?

Thank you
Files:
DS_THL_EA.mq4  16 kb
Reason: