logo
Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Options
Go to last post Go to first unread
petouchbaby  
#1 Posted : Wednesday, March 13, 2013 2:28:34 AM(UTC)
petouchbaby

Rank: Newbie

Groups: Registered, Registered Users, Subscribers
Joined: 3/13/2013(UTC)
Posts: 4

atrper:=Input("ATR period :",1,100,5);
atrfact:=Input("ATR multiplication :",1,10,3.5);
loss:=atrfact*ATR(atrper);
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;
eddie.m  
#2 Posted : Wednesday, March 13, 2013 2:42:15 PM(UTC)
eddie.m

Rank: Advanced Member

Groups: Registered, Registered Users
Joined: 1/20/2012(UTC)
Posts: 152

Was thanked: 1 time(s) in 1 post(s)

Hello Baby, [:D]

I shall get back to you tonight, in about 5 hours, but until then, be warned:

Someone on this forum is about to tell you to study Metastock's Formula Primer. [6][:@] Don't bother with him! [:D]

wabbit  
#3 Posted : Wednesday, March 13, 2013 4:41:26 PM(UTC)
wabbit

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers, Unverified Users
Joined: 10/28/2004(UTC)
Posts: 3,111
Location: Perth, Western Australia

Was thanked: 16 time(s) in 16 post(s)
RTFM: You cannot use the Input() function anywhere except in indicators; you have to hard code the values you want for each variable. wabbit [:D]
petouchbaby  
#4 Posted : Wednesday, March 13, 2013 5:52:36 PM(UTC)
petouchbaby

Rank: Newbie

Groups: Registered, Registered Users, Subscribers
Joined: 3/13/2013(UTC)
Posts: 4

thanks, Do you have example for hard code the value. : )
eddie.m  
#5 Posted : Wednesday, March 13, 2013 9:12:54 PM(UTC)
eddie.m

Rank: Advanced Member

Groups: Registered, Registered Users
Joined: 1/20/2012(UTC)
Posts: 152

Was thanked: 1 time(s) in 1 post(s)

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.
UserPostedImage
(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.

petouchbaby  
#6 Posted : Wednesday, March 13, 2013 11:14:11 PM(UTC)
petouchbaby

Rank: Newbie

Groups: Registered, Registered Users, Subscribers
Joined: 3/13/2013(UTC)
Posts: 4

Oh , thanks for your kindness,,, : )
petouchbaby  
#7 Posted : Thursday, March 14, 2013 4:01:48 AM(UTC)
petouchbaby

Rank: Newbie

Groups: Registered, Registered Users, Subscribers
Joined: 3/13/2013(UTC)
Posts: 4

many thanks , i just find some idea , : ) and that BB it's interesting+
eddie.m  
#8 Posted : Friday, March 15, 2013 4:31:10 PM(UTC)
eddie.m

Rank: Advanced Member

Groups: Registered, Registered Users
Joined: 1/20/2012(UTC)
Posts: 152

Was thanked: 1 time(s) in 1 post(s)

petouchbaby wrote:
many thanks , i just find some idea , : ) and that BB it's interesting+

Hi Pet, [:)]

Here are Sylvain's Metastock formulas:

http://stocata.org/metastock/formulas.html

He is in high demand, published original articles and book http://stocata.org/aboutus.html and already lectured outside Holland where he resides.

Rather than chasing a wild goose, follow this master for 1-2 years until your wings grow enough for you to fly alone. [:D]

Users browsing this topic
Guest (Hidden)
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.