Can this strategy be constructed in Wealth Lab Pro
Author: BlackBart41
Creation Date: 11/30/2009 2:29 PM
profile picture

BlackBart41

#1
I'm new to Wealth Lab Pro and to programming. Any guidance would be appreciated.


1. price above 200 day ma
2. 2-period RSI is below 25 for 2 days in row. Buy i.e 10% of position on close 2nd day
3. If prices are lower on the close than your previous entry price, any day you're in the position, buy 20% more of
position.
4. If prices are lower on the close than previous entry price, any day you're in position, buy 30% more of position.
5. If prices are lower on the close than previous entry price, any day you're in position, buy 40% more of position.
6. Exit on close when 2-period RSI closes above 70.
profile picture

Cone

#2
For all practical purposes, and changing the trigger values, this is the "RSI Agita" Strategy that is included in the installation.

Notes about the Martingale sizing strategy:

1. You need to test using data with stocks that have failed. They shouldn´t be hard to find after last year, but make sure that you backtest with them (and I'll think you'll find you need to start barking up a different tree).

2. Wealth-Lab is Position-based. That means every Position is a new Position and you have to treat and manage them all separately, not as 1 big Position. For the actual sizing, you'll need to use the more complex PosSizer feature coming in 5.6 to size positions in this manner, or, use the Override feature now.

Anyway, just experiment with RSI Agita on some failed stocks and think about how you'd feel when you were actually trading one of them, day-by-day.
profile picture

Eugene

#3
While all what Robert said above is true and practical, let me add a bit. The "RSI Agita" entry condition somewhat differs from what BlackBar41 proposes. Here's an example of coding it. The position size is defined as 1, 2, 3, and 4 shares (be sure to select the WealthScript Override radio button in the position sizing dialog).
CODE:
Please log in to see this code.
profile picture

ss161

#4
another way to do the pyramiding, which does not require a share override and thus allows $Amount or Pct of Equity Position Sizing would be as follows:

1. Set int entries = 10; // the sum of 1 - 4, so each trade unit is set to a multiple of the first trade. the commissions won't be correct but can be approximated using a per share commission amount

2. Replace your if( canPyramid and reEntry) block with this:
CODE:
Please log in to see this code.


i didn't test this, but i think it would work.

sounds like an interesting strategy for indices
profile picture

Eugene

#5
That was creative, thank you for sharing.

Nonetheless, pyramiding in portfolio backtest mode can still skip the 'initial' signal when there's lack of capital. A workaround like a PosSizer (v5.6) is required if you'd like to avoid pyramiding w/ no base position has been created.
profile picture

ss161

#6
of course, without testing there was a subtle but fatal bug in my logic.

i corrected it here.
CODE:
Please log in to see this code.
profile picture

BlackBart41

#7
Thanks to all for your comments and programming suggestions. As SS161 suggested I'm looking at it mainly for use with indices and ETFs.
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).