PDA

View Full Version : exit trailing stop problems


garth
5th January 2004, 10:35 AM
:? I am having problems I have metastock 7.0 and tradesim 2.2.1 and I am trying to get a trail stop to work I get ")" expected after L in this line "TradeSim.TrailingStop",trigger,short,1.00*ATR(10),L,H); the rest of my code is

LongEntryPrice := Ref(H+0.05*ATR(10),-1);
LongEntryPrice := If(OPEN>=LongEntryPrice,OPEN,LongEntryPrice);


LongExitTrigger := ExtFml( "TradeSim.TrailingStop",trigger,long,1.00*ATR(10),H,L);
LongExitPrice := Ref( ExtFml( "TradeSim.TrailingStop",band,long,1.00*ATR(10),H,L),-1);
LongExitPrice := If(OPEN<=LongExitPrice,OPEN,LongExitPrice);
LongExitPrice := If(LongExitPrice<=L,L,LongExitPrice);
LongInitialStop := Ref((H+0.05*ATR(10))-1*ATR(10),-1);

ExtFml( "TradeSim.Initialize");
ExtFml( "TradeSim.EnableProtectiveStop",0 );
ExtFml( "TradeSim.SetExitPriceToInitialStop");
ExtFml( "TradeSim.SetStopGapPriceToOpen");
ExtFml( "TradeSim.SetStartRecordDate",02,01,1997);
ExtFml( "TradeSim.SetStopRecordDate",30,8,2003);
ExtFml( "TradeSim.RecordTrades",
"PD02 System RLE",
LONG,LongEntryTrigger,LongEntryPrice,LongInitialSt op,LongExitTrigger,LongExitPrice,START);

David Samborsky
8th January 2004, 05:18 AM
Try updating to Version 3.0.0

Also read document AN-2 available from our download page at

http://www.compuvision.com.au/DownloadTradeSim.htm