Thanks for posting. To better understand what is being taught, I have refactored your algorithm. The same performance is as expected. An obvious next step would be to be to address dividend payments and stock splits, which your algoithm fails to catch. If someone on the team would like to take this further, send me a message.
Hits leverage of 12 right away in shorting. Try starting with this or this to make that visible in the custom chart and then this to see ordering to help resolve that. You can limit it like this: 'symbols': ['LMT', 'WB', 'KMG']. Welp, ok, will attach.
Should help if you make the context object available in the code where ordering occurs for info on current positions etc.