1) Please use the CODE tags when you post code.
2) FYI, here's an article to help code systems that reverse from long to short:
WealthScript Techniques | Creating a Stop-And-Reverse (SAR) systemCode above will not work because the very first trade should be processed individually by checking for
Positions.Count == 0. Here's the corrected code:
CODE:
Please log in to see this code.