Exit from both Long and Short on the Same Day
Author: Carova
Creation Date: 2/12/2015 8:34 AM
profile picture

Carova

#1
I ran across an very interesting situation with a script that I am writing. I had an an instance where I tripped both my long and short limits on the same day (CLGX on 10/25/2012). The problem was that my current code
CODE:
Please log in to see this code.
only exits one of the two positions. I have tried developing a simple modification that handles this highly unusual situation but have had no luck. Any suggestions? Thanks!

Vince
profile picture

Eugene

#2
"if (IsLastPositionActive)" is meant for single-position systems only. You can not properly manage two or more positions using it. For a design pattern applicable to multiple positions, check out the WealthScript Programming Guide > Programming Trading Strategies > Multi-Position Strategies > MP Strategy Template.
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).