PDA

View Full Version : How to correct Trailing Stop?


JohnathanStein
2nd April 2010, 05:25 AM
How would you go about "correcting" the Trailing Stop, so that it "resets" to the Initial Stop?

The attached chart has an Initial and Trailing stop, both set to 10%, but the Trailing Stop is always too high -- on the day of Entry, it should be the same as the Initial Stop.

I think.

David Samborsky
2nd April 2010, 07:08 AM
Assuming that InitialStop:=EntryPrice-Volatility;

You could assign your EntryPrice to the reference point parameter.

ExitLong:=ExtFml( "TradeSim.TrailingStop",
TRIGGER,
LONG,
Volatility,
EntryPrice,
LOW);

JohnathanStein
2nd April 2010, 03:19 PM
The OPEN is used for Entry, but the Trailing Stop is 10% below the CLOSE.

oztrader
2nd April 2010, 11:36 PM
ExtFml("TradeSim.SetExitTriggerDelay",1);

JohnathanStein
3rd April 2010, 02:52 AM
Oz -- Wouldn't that apply only to the InitialStop, rather than correct the starting value for the Trailing Stop?

Also, it would leave the position exposed.


--Johnathan

oztrader
8th April 2010, 09:35 AM
Johnathan,

Using your code from the last post in the earlier thread "Too many WARNINGS on Price Filter" as listed below with additions and comments in red:-

ExtFml("TradeSim.Initialize");
ExtFml("TradeSim.SetStartRecordDate",1,1,1980);
ExtFml("TradeSim.SetStopRecordDate",28,02,2010);
ExtFml("TradeSim.EnableDelayOfAllExitsByOneBar");
ExtFml("TradeSim.EnableProtectiveStop",0); {Controls InitialStop}
ExtFml("TradeSim.UseClosingPriceAsStopThreshold");
ExtFml("TradeSim.SetExitTriggerDelay",1); {Controls ExitTrigger}
ExtFml("TradeSim.SetVariableVolatility",3*ATR(3));
ExtFml("TradeSim.EnableTradePyramiding",PercentPro fit,3,5);

BandLong:=ExtFml("TradeSim.TrailingStop",
BAND,
LONG,
CLOSE*.10,
CLOSE,
CLOSE);

EntryTrig:=C>Ref(HHV(C,50),-1);
ExitTrig:=C<=Ref(BandLong,-1);

ExtFml("TradeSim.RecordTrades",
"Price Channel LONG",
LONG,
Ref(EntryTrig,-1),
OPEN,
OPEN-(OPEN*.10),
ExitTrig,
OPEN,
START);

I would make the changes in red so that the ExitTrigger was inactive for the first bar of the trade only with the InitialStop active immediately.

oz