I copied your code and run the script just to give it a test, but my equity curve and results look nothing like yours.