Eugene, I have paid and downloaded the Pyramiding PosSizer but can't get it working. I also suspect that the same problem that i have outlined in my first post may still flow through via using this PosSizer. For example I would like to:
1. Buy a MA cross
2. Pyramid the position only if the position moves up by X% (nominally 1% in the code below).
3. Sell all positions in the cross
To do this I have quickly made an example code which I have pasted below. I might add that this code does not work and i am not sure why but nonetheless I note:
1. I used a standard cross as the initial entry.
2. I defined a "pyramid" entry rule and used this name in the posSizer.
3. I used a nominal risk of 1.5%
4. I nominated a staring account value of $100,000 so there is plenty on money at 1.5% risk.
5. I then added the following code to define my entry criteria for a pyramid enty of up 1% from open if (Close[bar] >= LastActivePosition.EntryPrice * 1.01)
I note that the code at point 5 above is the part of the code that I was having a problem with as WL6 does not appear to be able to distinguish between an Active Position or an Active Position for a specific stock and therefore this problem will follow through with this poSizer.
Just wondering if you have a work around to address this issue?
Example code that does not work (not sure why either) is below:
CODE:
Please log in to see this code.