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

Notification

Icon
Error

Options
Go to last post Go to first unread
henry1224  
#1 Posted : Saturday, April 16, 2005 3:13:03 PM(UTC)
henry1224

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers
Joined: 10/29/2004(UTC)
Posts: 1,394
Location: Glastonbury, CT

Was thanked: 2 time(s) in 2 post(s)
Indicator Per1:=30; RWH:=(H-Ref(L,-Per1))/(ATR(Per1)*Sqrt(Per1)); RWL:=(Ref(H,-Per1)-L)/(ATR(Per1)*Sqrt(Per1)); Pk:=Mov((RWH-RWL),3,W); Val1.5:=If(Pk>0,HHV(H-1.5*ATR(5),10),LLV(L+1.5*ATR(5),10)); Val1.5; Highlights Tab Long Per1:=30; RWH:=(H-Ref(L,-Per1))/(ATR(Per1)*Sqrt(Per1)); RWL:=(Ref(H,-Per1)-L)/(ATR(Per1)*Sqrt(Per1)); Pk:=Mov((RWH-RWL),3,W); Val1.5:=If(Pk>0,HHV(H-1.5*ATR(5),10),LLV(L+1.5*ATR(5),10)); Buy:=C>Val1.5; Sell:=C<Val1.5; i:=Cum(buy>-1 AND sell>-1)=1; x:=BarsSince(i OR buy)<=BarsSince(i OR sell)=0; X=0 Short Per1:=30; RWH:=(H-Ref(L,-Per1))/(ATR(Per1)*Sqrt(Per1)); RWL:=(Ref(H,-Per1)-L)/(ATR(Per1)*Sqrt(Per1)); Pk:=Mov((RWH-RWL),3,W); Val1.5:=If(Pk>0,HHV(H-1.5*ATR(5),10),LLV(L+1.5*ATR(5),10)); Buy:=C>Val1.5; Sell:=C<Val1.5; i:=Cum(buy>-1 AND sell>-1)=1; x:=BarsSince(i OR buy)>=BarsSince(i OR sell)=0; X=0 Symbol Tab Long Per1:=30; RWH:=(H-Ref(L,-Per1))/(ATR(Per1)*Sqrt(Per1)); RWL:=(Ref(H,-Per1)-L)/(ATR(Per1)*Sqrt(Per1)); Pk:=Mov((RWH-RWL),3,W); Val1.5:=If(Pk>0,HHV(H-1.5*ATR(5),10),LLV(L+1.5*ATR(5),10)); Buy:=C>Val1.5; Sell:=C<Val1.5; i:=Cum(buy>-1 AND sell>-1)=1; x:=BarsSince(i OR buy)<=BarsSince(i OR sell)=0; X=0 AND Ref(X,-1)>0 Short Per1:=30; RWH:=(H-Ref(L,-Per1))/(ATR(Per1)*Sqrt(Per1)); RWL:=(Ref(H,-Per1)-L)/(ATR(Per1)*Sqrt(Per1)); Pk:=Mov((RWH-RWL),3,W); Val1.5:=If(Pk>0,HHV(H-1.5*ATR(5),10),LLV(L+1.5*ATR(5),10)); Buy:=C>Val1.5; Sell:=C<Val1.5; i:=Cum(buy>-1 AND sell>-1)=1; x:=BarsSince(i OR buy)>=BarsSince(i OR sell)=0; X=0 AND Ref(X,-1)>0
TerryA  
#2 Posted : Sunday, May 8, 2005 4:10:28 AM(UTC)
TerryA

Rank: Newbie

Groups: Registered, Registered Users, Subscribers
Joined: 4/27/2005(UTC)
Posts: 8

Greetings, Would you mind giving an expanation of the code used for these formulae and the results that will be calculated. What I am looking for is an Indicator that will let me set an ATR Trailing stop in percentage and ATR multiplier terms. We do not have open "short" trading in this country (N.Z.) so the stops would only apply to stocks I hold. I am a relative newcomer to MetaStock and have a dislike of loading anything that I do not understand. Trust this makes sense to you. Regards and thanks,
henry1224  
#3 Posted : Monday, May 9, 2005 8:59:16 PM(UTC)
henry1224

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers
Joined: 10/29/2004(UTC)
Posts: 1,394
Location: Glastonbury, CT

Was thanked: 2 time(s) in 2 post(s)
Per1:=30; RWH:=(H-Ref(L,-Per1))/(ATR(Per1)*Sqrt(Per1)); RWL:=(Ref(H,-Per1)-L)/(ATR(Per1)*Sqrt(Per1)); Pk:=Mov((RWH-RWL),3,W); {OSC} Val1.5:=If(Pk>0,HHV(H-1.5*ATR(5),10),LLV(L+1.5*ATR(5),10)); {ATR Stop} Buy:=C>Val1.5; {Buy Condition} Sell:=C<Val1.5; {Sell Condition} i:=Cum(buy>-1 AND sell>-1)=1; x:=BarsSince(i OR buy)>=BarsSince(i OR sell)=0; X=0 AND Ref(X,-1)>0 we created an oscillator based on the high vs low of 30 days ago,the low vs the high of 30 days ago devided by the atr of 30 days time the square root of 30. If this osc is above 0 we use the highest value of the past ten periods of the high minus 1.5 times the ATR of 5 periods as a trailing stop for long positions. If this osc is Below 0 we use the lowest value of the past ten periods of the low plus 1.5 times the ATR of 5 periods as a trailing stop for short positions.
TerryA  
#4 Posted : Monday, May 9, 2005 10:15:17 PM(UTC)
TerryA

Rank: Newbie

Groups: Registered, Registered Users, Subscribers
Joined: 4/27/2005(UTC)
Posts: 8

Thanks, I'll give it a try and see if it suits my needs. Best wishes,
frank1301  
#5 Posted : Tuesday, July 26, 2005 2:12:00 AM(UTC)
frank1301

Rank: Member

Groups: Registered, Registered Users
Joined: 6/20/2005(UTC)
Posts: 10
Location: Perth, Australia

Sorry wrong forum!
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.