PDA

View Full Version : ATR Trailing Stops Intraday Exit Possible or Not????


dallaswm
2nd February 2004, 05:04 AM
Please Help..........

Is it actually possible to get tradesim to record trades properly for atr trailing Stop intraday exits. I have read the an-2 instructions several times and spent many hours trying to get it to work. The closest I have got is the following formula. The rejection is from the exit price being greater than the trailing stop band price. Trigger works ok and formula works ok if exiting on open tommorrow after trigger is fired.

LongEntryTrigger := XXX;
LongEntryPrice := OPEN;

LongExitTrigger:=ExtFml("TradeSim.TrailingStop",Trigger,Long,2.0*ATR(10),CLOSE,LOW);
LongExitPrice:= Min(OPEN,Ref( ExtFml( "TradeSim.TrailingStop",band,long,2.25*ATR(10),H,L),-1));

ARC:=1.5;
Period:=10;
LongInitialStop := Ref(C,-1)-ARC*ATR(Period);

ExtFml("TradeSim.Initialize");
ExtFml("TradeSim.SetStartRecordDate",1,1,2000);
ExtFml("TradeSim.SetStopRecordDate",1,1,2004);
ExtFml("TradeSim.SetStopGapPriceToOpen");
ExtFml("TradeSim.EnableProtectiveStop",0);
ExtFml("TradeSim.EnableDelayOfEntryByOneBar");
ExtFml("TradeSim.SetExitPriceToInitialStop");
ExtFml("TradeSim.RecordTrades",
"ST1",
Long,
longEntryTrigger,
longEntryPrice,
longInitialStop,
longExitTrigger ,
longExitPrice ,
START);

Appreciate any feedback. PS.(I left out the entry trigger to save space).