July 24: The S&P500 and FOREX EUR/USD Update.
Latest YouTube video fast average crossings part2.
chart template updated
My book "Capturing Profit with Technical Analysis"
best offer!
(DUTCH) Nederlandstalige versie hier.
Over 300 items on sale,
and FREE Shipping in July!
WINNER "Favorite Article" in the Readers' Choice Award 2010. Thank You!
AXIOM business books awards, bronze medal for my book! Thank You!
Part 2 of "Smoothing The Bollinger %b Indicator" in the June issue of S&C.
Visit the TradersLibray blog.
Sylvain Vervoort
WINNER favorite article
Readers' Choice Award.
AXIOM Business Books Awards, bronze medal.
HOME Back to MetaStock Formulas Overview
The basic trailing stop trading method formula will switch from support to resistance and visa-versa when breaking support or resistance. For the fixed percentage trailing stop method we calculate the maximum allowed loss based on a fixed percentage of the closing price.
Additionally I am showing you the formula to use a fixed percentage trailing stop from a start date for either a long or a short trade.
Because with this trailing stop method we are using a fixed percentage, there is not much we can try for getting a better result.
The only thing you could do is look at the past and see for each individual stock what was the best fitting percentage in a previous period and apply an individual value for each stock. This may get you a better total result. However I would advise not to deviate more than 3% of the common value to avoid too much optimization.
This is the formula:
SVE_Stop_Trail%
perc:=Input("Trailing Loss % :",0,100,14);
loss:=C*perc/100;
trail:=
If(C>PREV AND Ref(C,-1)>PREV,
Max(PREV,C-loss),
If(C<PREV AND Ref(C,-1)<PREV,
Min(PREV,C+loss),
If(C>PREV,C-loss,C+loss)));
Trail

Using your own trading method finding entry points you most probably would like to have this trailing stop available from your own entry date.
So, this is the MetaStock® formula for a fixed percentage trailing stop from a starting date.
SVE_Stop_Trail%_Date
InpMonth:=Input("Month",1,12,1);
InpDay:=Input("Day",1,31,1);
InpYear:=Input("Year",1800,2050,2009);
LongShort:=Input("1=Long or 2=Short? ",1,2,1);
InitStop:=Input("Initial Stop Price",0.1,10000,10);
Perc:=Input("Trailing Stop Percentage",1,30,12);
Loss:=C*Perc/100;
Entry:= InpYear=Year() AND InpMonth=Month() AND InpDay=DayOfMonth();
EntryLock:=If(Ref(Entry,-1)=0 AND Entry=1,1,PREV);
support:=If(LongShort=1,C-loss,C+loss);
StopLong:= If(EntryLock=0 OR Entry=1,InitStop,
If(support>Ref(Support,-1),Max(support,PREV),PREV));
StopShort:= If(EntryLock=0 OR Entry=1,InitStop,
If(support>Ref(Support,-1),Min(support,PREV),PREV));
Trail:=If(LongShort=1,Stoplong,Stopshort);
Trail
HOME Back to MetaStock Formulas Overview