Possibly but it would be quite a bit of work, try and use pink blocks to loop through trades, check the lot of each trade, and if higher than the rest close. At the same time, martingale trade means that the last place will be the highest, so just close the last.