Strategy that pyramids up to 5 positions
Author: mcfalwell
Creation Date: 4/11/2013 4:27 PM
profile picture

mcfalwell

#1
So i'm new to wealth lab and have been trying to use rules to backtest a model, but to no avail. I am trying to stick with using rules if possible, but if I can't be done, I'd love for feedback on how to code it.
I would enter long when the 20 bar and 100 bar high is crossed and I would pyramid up to 5 positions the same amount of shares I originally purchased (1% of portfolio risk). All positions are sold when the price drops by 1%.

Thoughts?
profile picture

Cone

#2
The rules are unclear. What do you mean by the 20 bar and 100 bar high is crossed? If the 100 bar high is crossed, then the 20 bar high is crossed by definition. So there must be something significant about the 20 bar high that I'm missing.

After the first position, what triggers the pyramid adds?
profile picture

Eugene

#3
And since topic starter expressed interest in the coding side of things, I thought I'll just leave it here:

WealthScript Techniques | Pyramiding (Adding to position)
profile picture

mcfalwell

#4
Thanks for the quick response, I'll try to be a little clearer.

I'm trying to stay away from coding if possible, and my main question is can you use the PositionSizer for Pyramiding with the rules based strategy?

My entry, let's say just for discussion purposes, would be to buy at the close when the price is both higher both the 20 and 100 day close. My exit would be if the stock drops by 1% on any given day. Until that point, I would like to add the same number of shares, a max of 5 times, each time the stock goes up 1%... so, if I buy 100 shares on day 1 and the stock goes up 1% for the next 4 days, I would add 100 shares each day, and would have 500 shares total. Then, I would let it run, until the stock drops by 1% and I would cut everything.

Does that help?

Thanks Again!

profile picture

Eugene

#5
QUOTE:
I'm trying to stay away from coding if possible, and my main question is can you use the PositionSizer for Pyramiding with the rules based strategy?


No. It would have to be opened in a new code window (or saved) and edited appropriately. However, it appears that for your strategy's tasks (always entering a constant size), the "Position Options" PosSizer could be sufficicent: Max Open Positions and/or Max Open in Symbol options would do.
profile picture

mcfalwell

#6
Great, thanks, I will try that. Appreciate the help!
profile picture

Eugene

#7
Anoher reason why you don't need the Pyramiding PosSizer is that your primary and pyramid entries are similar. Without this PosSizer, there's a chance of skipping the initial entry signal due to insufficient funds but taking pyramided trades like nothing happened. Your rules are in fact do not pyramid - they're just multiple entries of the same kind. The pyramided entries do not depend on the initial entry.