Is Trade Outcome PosSizer Peeking?
Author: richard1000
Creation Date: 3/6/2012 12:24 PM
profile picture

richard1000

#1
Trade Outcome PosSizer seems to be peeking.

I'm using the it with "Cumulative" and "Stop and reset size after %" options checked.

How does it know to increase or decrease the position size before the previous trade is closed? For example, assume first trade is open and an alert for 2 more orders comes in, how does it know to increase or decrease the size. When I looked at the backtesting results, the size is increased or decreased assuming the first trade result is already known.
profile picture

Eugene

#2
QUOTE:
How does it know to increase or decrease the position size before the previous trade is closed?

Simply. It does not consider open positions, looping through all closed positions.
profile picture

richard1000

#3
Yes, but what if there is no closed position yet. That is, the initial first trade is still open and the next alerts come in with no closed positions to loop over. In that case, shouldn't the position size still be "Initial Size %" for new orders.
profile picture

Eugene

#4
Yes, that's right. The position size should be the greater of two numbers: Initial Size and Minimum Size. Is your experience different?
profile picture

richard1000

#5
My experience is different.

For example, take Neo Master strategy (default parameters) on Dow 30 stocks for past 300 Daily bars.

First trade Shares EntryDate EntryPrice ExitDate PositionSize
VZ 173 1/21/2011 34.81 3/31/2011 6022

Second trade Shares EntryDate EntryPrice ExitDate PositionSize
MRK 241 1/27/2011 33.35 4/6/2011 8037

The first trade VZ hasn't closed yet but MRK position size still increased. I used settings of Init Size 6%, Min Size 0.5%.
profile picture

Eugene

#6
Indeed, the size of the MRK trade should be 181 shares - not 241 (default parameters). You may call it 'peeking' as the PosSizer could look at the outcome of an active trade, and could change as a result (was 'unstable').

Thank you for turning my attention to this problem. I've fixed it and uploaded a hotfix, so you're advised to update using the Extension Manager.