Another bug con combo bot

We had a calculation problem this summer, because of which profit accumulated not only in base, but also in quote.
Almost all deals of the bot were closed in Aug, when we have noticed the problem. Last one, that closed in Sep already fixed.
I checked turnover of the bot, and it has almost 50/50 split of profit.