When I backtest this algorithm, i'm getting returns of 38.62% but it says my net profit is $-100.44.

I may be missing something, but this may be a bug.

Author