PDA

View Full Version : Trailing Stop Exit


Marek
30th August 2004, 12:37 PM
Dear David,

I was manually checking trade database for the following system:

LongEntryTrigger:=

Mov(C,200,S)>Ref(Mov(C,200,S),-50)+5*ATR(10) AND
fml("CAPP") = 1 AND
BarsSince(Mov(C,20,S)- Ref(Mov(C,20,S),-1)<0) <=21 AND

ATR(30)/C >0.010 AND
ATR(30)/C <0.080 AND
Mov(C,21,S)*Mov(V,21,S)> 250000 AND
C > 0.5;
LongEntryPrice:= O;
LongExitTrigger:= ExtFml("TradeSim.TrailingStop",trigger,Long,
(3.6*ATR(30)),HIGH,CLOSE);
LongInitialStop := LongEntryPrice - 2.5*ATR(30);
ExtFml( "TradeSim.Initialize");
ExtFml("TradeSim.GetSymbolLength")<=3;
ExtFml("TradeSim.SetStartRecordDate",01,01,1995);
ExtFml("TradeSim.SetStopRecordDate", 01,08,2003);
ExtFml("TradeSim.EnableDelayOfEntryByOneBar");
ExtFml("TradeSim.EnableDelayOfAllExitsByOneBar");
ExtFml("TradeSim.EnableProtectiveStop",0);
ExtFml("TradeSim.SetExitPriceToInitialStop");
ExtFml("TradeSim.SetStopGapPriceToOpen");
ExtFml("TradeSim.RecordTrades","Downlad_CAPP_16_36",LONG,
LongEntryTrigger,LongEntryPrice,LongInitialStop,
LongExitTrigger,LongExitPrice,START);

An entry signal was generated on 19.04.2002 to buy FWD at $2.20. Then exit signal was generated to sell FWD on 07.05.2002 on the open at $2.37.
As I understand, trailing stop exit should be generated to sell on open the next day if price closes at or below higher high during the trade – 3.6*ATR(30).
In this example higher high during the trade was $2.54 on 02.05.2002 (or 01.05.2002). On 06.05.2002 ATR(30) = 0.051801 and close was $2.36.
As I understand the trailing stop should be calculated as follow:

HHV(h) – 3.6*ATR(30) = 2.54 – 3.6*0.051801 = 2.54 – 0.18648= 2.35352.

So the close price $2.36 is not equal or less than trailing stop.
Why in this case sell signal was generated?