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. The percentage and ATR trailing stops allow sufficient price reaction that makes them most effective for medium term trend trading. Using lower percentages or a smaller multiplication factor for the ATR trailing stop will mostly result in too many losing trades. If we want a short term trailing stop it will have to move much closer to the price action. So, for the creation of TR&NDS we will look directly at the price movement. The most reliable reference is price support and resistance and the main item here is price turning points.
Additionally I am showing you the formula to use the TR&NDS trailing stop from a start date. TR&NDS is used only for an up move. During the down move we use the ATR trailing stop method.
This is the formula:
SVE_Trends_trail
{SVE_TRENDS_Trail trailing stop function}
atrfact:=Input("ATR multiplication :",1,10,2.8);
period:=Input("ATR Period :",1,100,10);
HiLo:=If(H-L<1.5*Mov(H-L,period,S),H-L, 1.5*Mov(H-L,period,S));
Href:=If(L<=Ref(H,-1),H-Ref(C,-1),(H-Ref(C,-1))-(L-Ref(H,-1))/2);
Lref:=If(H>=Ref(L,-1),Ref(C,-1)-L,(Ref(C,-1)-L)-(Ref(L,-1)-H)/2);
diff1:=Max(HiLo,Href);
diff2:=Max(diff1,Lref);
ATRmod:=Wilders(diff2,period);
loss:=atrfact*ATRmod;
resistance:= C + loss;
support:=If(L>=Ref(L,-2) AND Ref(L,-1)>=Ref(L,-2) AND Ref(L,-3)>=Ref(L,-2) AND Ref(L,-4)>= Ref(L,-2),Ref(L,-2),
If(L>Ref(H,-1)*1.0013,Ref(H,-1)*0.9945,
If(L>PREV*1.1,PREV*1.05,
PREV)));
trends:=
If(H>PREV AND Ref(H,-1)>PREV,
Max(PREV,support),
If(H<PREV AND Ref(H,-1)<PREV,
Min(PREV,resistance),
If(H>PREV,support,resistance)));
trends

Using your own trading method finding entry points you most probably would like to have this trailing stop available from your own entry date. IMPORTANT! The TR&NDS trailing stop is broken only when broken by the high price!
So, this is the MetaStock® formula for TR&NDS from a starting date in an uptrend. Make sure that the selected date exists in the data series. For the downtrend, use the ATR trailing stop method!
SVE_Trends_Trail_Date
InpMonth:=Input("Month",1,12,1);
InpDay:=Input("Day",1,31,2);
InpYear:=Input("Year",1800,2050,2009);
InitStop:=Input("Initial Stop Price",0.1,10000,10);
Support:=If(L>=Ref(L,-2) AND Ref(L,-1)>=Ref(L,-2) AND Ref(L,-3)>=Ref(L,-2) AND Ref(L,-4)>= Ref(L,-2),Ref(L,-2),
If(L>Ref(H,-1)*1.0013,Ref(H,-1)*0.9945,
If(L>PREV*1.1,PREV*1.05,
PREV)));
EntryLong:= InpYear=Year() AND InpMonth=Month() AND InpDay=DayOfMonth();
EntryLock:=If(Ref(EntryLong,-1)=0 AND EntryLong=1,1,PREV);
Trail:= If(EntryLock=0 OR EntryLong=1,InitStop,
If(support>Ref(Support,-1),Max(support,PREV),PREV));
TrailBreak:=If(EntryLock=1 AND H<Trail,0.95*Trail,Trail);
TrailBreak
HOME Back to MetaStock Formulas Overview