SplitPosition and Portfolio Simulation mode: dropped trades?
Author: redliontrader
Creation Date: 11/24/2010 7:05 AM
profile picture

redliontrader

#1
I am using a SplitPosition method to break my entry into two in order to take a profit target exit on 1/2 and a trailing stop exit on the other, or if I hit a profit-loss stop exit both.

That all works OK on a single symbol, but if I test using a portfolio simulation (10% Equity) it appears to me that the logic that sizes or selects the trades to take sometimes drops one or the other of the splitpositions.

If I am correct about what I am seeing, is there anyway around that..

Thanks
profile picture

Eugene

#2
The logic that selects the trades would rather skip the initial entry signal due to insufficient funds. (When testing under portfolio simulation, having not enough capital to execute all signals is frequently the case.) However, the system will still be entering pyramided trades (or SplitPositions as you said) like nothing happened.

To work around this behavior, a PosSizer was developed that would skip all additional entry signals if the initial trade has not been taken:

Pyramiding PosSizer from MS123 PosSizer Library
profile picture

redliontrader

#3
Thank you I will look at that..

is there a tutorial or information on writing your own position sizer or simuscript. I have looked and search the documentation and have not found it.

Thanks
profile picture

Eugene

#4
Simuscripts are gone for good but sure there's a tutorial on PosSizer development:

Wealth-Lab Version 6 (.NET) Development Guide > Create a PosSizer

Moreover, the Wiki hosts a demo PosSizer project which source code would help you get started in the right direction. It's pretty straightforward and illustrates the two ways of building a PosSizer:

1. Starting from scratch by inheriting from the PosSizer class,
2. Inheriting from the BasicPosSizer with all its added options.

To download the code, follow the Wiki instructions on obtaining access to Attachments if your Wiki user name isn't entitled yet.
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).