Split Positions - retaining position remains open
Author: 07nioe
Creation Date: 10/14/2018 2:01 PM
profile picture

07nioe

#1
Hi WL-Team,

I would like to exit half of the position if a certain condition is triggered. The second half of the position should be closed with the help of a TimeBasedExit. Unfortunately, the TimeBasedExit does not trigger.

I don't know where the error is. Can you help? Thanks. Here is the code:

CODE:
Please log in to see this code.
profile picture

Eugene

#2
Hi Niels,

Splitting positions requires changing your strategy from single- to multi-position template. It doesn't look like your code is adjusted. On how to approach it please review your existing topic where you already asked a very similar question (i.e. adding a time-based exit in a SplitPosition scenario):

SplitPosition endless loop

My reply was to avoid SplitPosition but i you wish to prefer the SplitPosition route this time, check it out from the horse's mouth:

1. WealthScript Techniques | Splitting a Position, or
2. WealthScript Programming Guide > Techniques > Splitting Positions
profile picture

07nioe

#3
Hi Eugene, thank you very much. Problem resolved.

Best
Niels
profile picture

Eugene

#4
Good to hear this. Glad to help you Niels.
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).