" I created a strategy that gives big losses, and reverting it naturally gives nice profit ". That isn't always true. It doesn't 'naturally' follow in all cases. However, if it does, it's generally a confirmation there is some sort of correlation between your logic and your results.
A lot of strategies aren't easy to 'invert'. However if you can invert a factor, or a whole strategy, and the results invert accordingly, that's usually a good sign. Actually, it's often good practice to do exactly that in the course of testing an algorithm. If one DOESN'T see a corresponding change by inverting some factor, then maybe it's not really that factor that's generating results but something else.
One other thing to try when testing is to set commissions to zero (just remember to set it it back).
set_commission(commission.PerShare(cost=0.0, min_trade_cost=0.0))
Often poorly performing algorithms (from a return perspective) are due to high transaction costs even though the underlying logic may be sound. If one sees a big change when turning commissions off then maybe focus on reducing transactions.
Just some thoughts. Good luck!