Shorts not getting covered
Author: gymcoach
Creation Date: 6/22/2009 11:21 AM
profile picture

gymcoach

#1
I can't figure out why this strategy will not close out the shorts. Any ideas?
CODE:
Please log in to see this code.
profile picture

Eugene

#2
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.
This website uses cookies to improve your experience. We'll assume you're ok with that, but you can opt-out if you wish (Read more).