I see that you use 'Capital' or '(Capital + Profit)' for your position sizing. This means that your position size is always based on your initial capital + your profit, but not a loss(!).
Do you have a particular reason for this?

I always use 'Balance' for position sizing, which is 'Capital + Wintotal - LossTotal' (see https://zorro-project.com/manual/en/balance.htm)

Always log variables for verification when in doubt about certain calculations, esp before switching to live trading. I believe that's the best way to keep bugs away.