Has anybody already coded Van Tharps suggested Exits as follows:

1. Initial stop - entry price minus three-times-volatility (3* 10 Day ATR)

2. Second, - whenever the market moves twice the daily volatility from
yesterday's close against you in a single Day (2 * Avg 10 Day ATR)

3. Lastly, a 4-R profit will after a 4-R profit is triggered, your
trailing volatility stop moves up to 1.6 times the average True range
(i.e., instead of 3 times).

I have the following for the AFL code for 1 and 2:

//1. Initial stop
ApplyStop( stopTypeLoss, stopModePoint, 3 * ATR( 10 ), True );

//2. Second stop
Sell = (Ref(C,-1) - C > 2 * ATR(10));

I'm not sure how to calculate the last exit (3. 4-R profit)?
If I give buyprice = ... same as buy formula, how do I keep the value
of (3 * ATR(10)) at the time the buy occurs to calculate initial risk?

Thanks

Reply via email to