petouchbaby wrote:thanks, Do you have example for hard code the value. : )
Hi Pet, [:)]
In Expert Editor go to Trends,. In Bullish field, paste this code:
loss:=3.5*ATR(5);
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;
C>trail
In Bearish field, paste this code:
loss:=3.5*ATR(5);
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;
C<trail
As you see above, ATRPER has been replaced with 5, and ATRFACT has been replaced with 3.5.
You can change these values.
Click the image to see a chart with the Expert Advisor and ATR Trailing Stop with numbers above on it.
(Picture is available only for the next 6 months from today).
For EST, Buy Order:
loss:=3.5*ATR(5);
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;
cross(c,trail)
and for Sell short Order:
loss:=3.5*ATR(5);
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;
cross(trail,c)
Judging from your questions, I don't think you will be able to interpret the results from testing properly, but if you play with testing the existing systems that come with Metastock long enough, you will get some idea. (Those systems come with ready made Indicators, Explorations and Expert Advisors).
The ATR Trailing Stop is eye-pleasing and I wonder if you are going to turn a profit from using it. Many things that look catchy and test catchy do not translate into $$$ to traders.
Bon chance! [:)]
PS: see TASC MAY 2010 magazine
Sylvain Vervoort’s article Smoothing The Bollinger %b.
http://stocata.org/metastock/bollinger_perc_b.html
Sylvain has a suite of Indicators like the one you asked about,
not only the Bollinger %b.