I can't figure out why this strategy will not close out the shorts. Any ideas?
CODE:
Please log in to see this code.
Size:
Color:
Because actually you programmed the strategy as a multi-position one with 2 separate entries, and the exit logic is looking to close the LastPosition only. Since the last created position is a long, it is being closed and the cycle continues. Try to swap the entries and you'll see it now closes short positions and leaves the longs.
Size:
Color: