PDA

View Full Version : No man's land exit


steve&sue
24th June 2006, 11:10 AM
Hi Jose!

I am trying to code up a long system which uses an initial stop of Entry Price - Ref(1.0*ATR(20),-1) and a trailing stop based on intraday price < Ref(LLV(L,5),-1).

The problem I have is that sometimes the trailing stop is higher than the initial stop on the day of entry and I get kicked out of the trade prematurely (or even before I enter the trade if the open is less than the trailing stop!)

Is there any way of activating the trailing stop if and only if it has exceeded the entry price of the trade (and making it invisible if it is above the open price on the entry day - assuming I want to enter on the next market open after the trigger day)?

Any guidance is greatly welcomed!

Steve

Jose
24th June 2006, 03:39 PM
Try using Richard Dale's excellent Advanced Trailing Stop (http://www.tradernexus.com/advancedstop/advancedstop.html).

jose '-)

steve&sue
24th June 2006, 10:07 PM
Thanks for tip Jose. I've seen RD's exit before but how do I implement his code so that I can test it in Tradesim? My code at the moment looks something like this:
Can you guide me in the right direction? Cheers, Steve

LongEntryTrigger := {Entry conditions}

LongEntryPrice := Open;

LongInitialStop := LongEntryPrice - Ref(1.0*ATR(80),-1);

LongExittrigger := LOW <= Ref(LLV(LOW,5),-1) AND
Ref(LOW>=Ref(LLV(LOW,5),-1),-1);

LongExitprice := Ref(LLV(L,5),-1);
LongExitPrice := Min(Ref(LLV(L,5),-1),OPEN);

ExtFml( "TradeSim.Initialize");
ExtFml( "TradeSim.SetStartRecordDate",DayStart,MthStart,YearStart);
ExtFml( "TradeSim.SetStopRecordDate",DayStop,MthStop,YearStop);
ExtFml( "TradeSim.EnableDelayOfEntryByOneBar");
ExtFml( "TradeSim.EnableProtectiveStop",1);
ExtFml("TradeSim.SetExitPriceToInitialStop");
ExtFml( "TradeSim.EnableTradePyramiding",Trigger, 0, 200);
ExtFml( "TradeSim.RecordTrades",
"trial system",LONG,LongEntryTrigger,LongEntryPrice,LongInitialS top,LongExitTrigger,LongExitPrice,START);

Jose
25th June 2006, 12:45 PM
It's always a good idea to first implement entry/exit/stop conditions in a binary signal (MetaStock) indicator, and then reference those signals within the TradeSim exploration.

For trailing stop code, take a look at the "ATR trailing stop" & "Std trailing stop" examples from MetaStockTools.com (http://www.metastocktools.com/#metastock).


jose '-)