After splitting a trade with SplitPosition, the remaining trade is gone
Author: ewessely
Creation Date: 9/20/2011 2:57 PM
profile picture

ewessely

#1
Hi Eugene,
I'm having troubles with splitting positions in my strategy. When I run on a single symbol, everything works ok. But when I test against DOW30 there is an odd behave. Some trades are handled ok, some trades will not get splitted and some trades will be splitted and the remaining trade is gone (but ActivePositions.Count is >0 like I can see on the color of the chart!!).
To reproduce I attached a simplified script. It tries to go long on every 17th bar and short on every 23rd bar. The chart will be colored if there are ActivePositions depending on long (green) and short (pink). On the 3rd day the position shoud get splitted, and on the 6th day the position should be closed. I've also search the wiki and kb and found a similar example (http://www2.wealth-lab.com/WL5WIKI/kbSplitPosition.ashx?HL=splitposition) but I can't get it work correctly. What I'm doning wrong?

I'm running with position size 19.5% equity


CODE:
Please log in to see this code.


profile picture

Eugene

#2
Hi Erich,

I remember this was discussed before. Please see this thread for insights:

RSI scale out system Rev.C in simulation mode
profile picture

ewessely

#3
Hi Eugene!
I just try to follow the conversation in that thread, but it's a little bit confusing and not discussed to end (in my oppinion). Do I need the pyramiding possizer? If yes, which settings? And how do I split?
profile picture

Eugene

#4
Erich,
I'm sorry but at the moment I couldn't offer more ideas.
profile picture

ewessely

#5
Am I right to call it a bug in WL?
profile picture

Eugene

#6
What is "it" exactly?

The "remaining trade is gone" phenomenon, if I understood you correctly, is expected. In portfolio simulation, any part of the combination can be left out due to capital constraints. Cone explained what's happening in his post dated 12/28/2010 5:00 PM.
profile picture

ewessely

#7
Eugene
QUOTE:
What is "it" exactly?

"it" means in my oppinion that something does not work as expected.
When you split a position in real trading life, you will sell half of the position - you may not run into a problem of equity.
I agree with you to the equity problem in scale in, but not in splitting.
"it" means for me: The internal algorithm of calculating and handling the split - it's not working as described and there is also no hint in the documentation not to use in portfoliotest. So therefor for me it's simply a bug.

Do you have any plans to fix this behave in the future?
profile picture

Eugene

#8
Please create a support ticket for tracking the issue. Include the link to this thread or even better, this one.
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).