LDL2 strategy questions
Author: jsinjur
Creation Date: 9/13/2011 9:06 AM

#### jsinjur

#1
I have a question on exiting the LDL2 strategy at a profit. I have found little discussion on the strategy. Using the trade history for JAZZ. As an example the default profit target is 3% but looking at the history, many profits were higher and some lower. What was used to establish targets? Thanks

#### Eugene

#2
A look at the code reveals the following simple logic: if the Close price is higher than the profit target, the position is sold with an AtMarket order next day (i.e. at open).

#### jsinjur

#3
Thanks. I blank out when I read code but as soon as I saw your explanation and went back to the code I saw the answer. Thanks again.

#### jsinjur

#4
I know the basic formula for the entry price (low+close)/2*.94. I cannot arrive at the correct entry using that formula.

After reading on the subject, I have come across a disclaimer that the formula is based on whole numbers only. That still does not give me the correct entry.

If I use WealthLab toi calculate the entry, I can only duplicate that price to the penny if I use the multiplier .96 not .94.

If we use VRUS for today the low was 71.93, the close 74.08. That would compute to 68.63, yet Wealth Lab is showing 70.04. If I use .96 I can arrive at 70.08 (within pennies).

What am I doing wrong?

Thanks

#### Eugene

#5
You're not doing anything wrong but the saved parameter makes it confusing. The LDL2 strategy has a saved Parameter value for the Limit Multiplier of 0.96. This is what you can see at the bottom of the screen.

If a parameter value has been altered by Save Parameters once (and in fact it was - the Limit Multiplier was overridden to be 0.96), then Reset will honor that change and ignore the default value in Strategy code. (You're not alone, I was also confused by the design here.)

To fix, make "Limit Multiplier" a 0.94, click "Save Parameters". Then the strategy will be executing with its true default multiplier (0.94) when re-opened.

P.S. I think we need to upload a new revision of LDL2 to the website and/or fix that annoyance in the bundled strategy code itself.

#### nnecula

#6
I would like to understand why it is necessary to perform this "if" before buying:

CODE:

Thanks

#### Eugene

#7
To exclude penny stocks below \$5.

#### Cone

#8
I always cringe when I see price tested this way in a script because it's peeking! It's too bad that LDL2 had that rule, but whenever you test historical price values like this you need to reverse the "future" splits. Here's the Execute method for LDL2 with a couple edits, showing how to come up with the reverse split Close series.

Run it on NKE, for example, and notice the "ds" prices before the 12/26/2012 split. This is the actual price level that NKE traded. If you go back before 1995, split-adjusted NKE was trading below 5 and therefore would be incorrectly excluded from the backtest. In reality, NKE never closed below \$10 since at least 1987!

CODE: