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

Notification

Icon
Error

Options
Go to last post Go to first unread
triggerlips  
#1 Posted : Friday, September 28, 2012 1:00:59 AM(UTC)
triggerlips

Rank: Newbie

Groups: Registered, Registered Users, Subscribers
Joined: 4/13/2011(UTC)
Posts: 5

CLOSE>Mov(C,50,E)
AND ROC(C ,30 ,PERCENT ) >0
AND ROC(C,65,PERCENT)>0

Expert gives me multiple buy arrows , im a newbie with limited time to study code, what do i do to make only one buy arrow? Think it might be something to do with CROSS or latch , any of you wise owls help me out?

henry1224  
#2 Posted : Friday, September 28, 2012 6:00:49 AM(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)
If you don't have the time to read the manual or user guide, then I would suggest that you not trade with Metastock

as for your code, you gave a long condition, now create a short condition, then use use the if functions to create a system

Code:
 A:=If( C>Mov(C,50,E) 
AND ROC(C ,30 ,% ) >0
AND ROC(C,65,%)>0,1,
If(C<Mov(C,50,E) 
AND ROC(C ,30 ,% ) <0
AND ROC(C,65,%)<0,-1,0));
A;


when plotted on a chart you will see that the indicator PLOTS 1 when LONG and -! when SHORT

now in the Expert under the highlight tab click new , name it long
Code:

A:=If( C>Mov(C,50,E) 
AND ROC(C ,30 ,% ) >0
AND ROC(C,65,%)>0,1,
If(C<Mov(C,50,E) 
AND ROC(C ,30 ,% ) <0
AND ROC(C,65,%)<0,-1,0));
A=1


click new name it short
Code:
A:=If( C>Mov(C,50,E) 
AND ROC(C ,30 ,% ) >0
AND ROC(C,65,%)>0,1,
If(C<Mov(C,50,E) 
AND ROC(C ,30 ,% ) <0
AND ROC(C,65,%)<0,-1,0));
A=-1


Now under the symbol tab create a new symbol name it buy
Code:
A:=If( C>Mov(C,50,E) 
AND ROC(C ,30 ,% ) >0
AND ROC(C,65,%)>0,1,
If(C<Mov(C,50,E) 
AND ROC(C ,30 ,% ) <0
AND ROC(C,65,%)<0,-1,0));
A=1 and Ref(A,-1)<>1

create a new symbol name it sell
Code:
A:=If( C>Mov(C,50,E) 
AND ROC(C ,30 ,% ) >0
AND ROC(C,65,%)>0,1,
If(C<Mov(C,50,E) 
AND ROC(C ,30 ,% ) <0
AND ROC(C,65,%)<0,-1,0));
A=-1 and Ref(A,-1)<>-1


I will not test the system for you, that I will expect you to validate the risk reward ratios for your acceptable levels
triggerlips  
#3 Posted : Friday, September 28, 2012 11:23:25 AM(UTC)
triggerlips

Rank: Newbie

Groups: Registered, Registered Users, Subscribers
Joined: 4/13/2011(UTC)
Posts: 5

Thanks very much for your help, i have created the indicator and entered your code into the advisor , but i still have multiple arrows , what am i missing?

http://lippylions.files.wordpress.com/2012/09/aaaaaaa1.jpg

I am working my way through the manual , but i have never been any good with computer code, i just have no natural ability at it , am learning, but very slowly

henry1224  
#4 Posted : Friday, September 28, 2012 6:03: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)
post the exact code that you have in the expert symbols!
triggerlips  
#5 Posted : Friday, September 28, 2012 6:18:09 PM(UTC)
triggerlips

Rank: Newbie

Groups: Registered, Registered Users, Subscribers
Joined: 4/13/2011(UTC)
Posts: 5

buy

A:=If( C>Mov(C,50,E)
AND ROC(C ,30 ,% ) >0
AND ROC(C,65,%)>0,1,
If(C<Mov(C,50,E)
AND ROC(C ,30 ,% ) <0
AND ROC(C,65,%)<0,-1,0));
A-1 and Ref(A,-1)<>1

sell

A:=If( C>Mov(C,50,E)
AND ROC(C ,30 ,% ) >0
AND ROC(C,65,%)>0,1,
If(C<Mov(C,50,E)
AND ROC(C ,30 ,% ) <0
AND ROC(C,65,%)<0,-1,0));
A=-1 and Ref(A,-1)<>-1

henry1224  
#6 Posted : Saturday, September 29, 2012 6:45:46 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)
here is the correct code


Long entry
Code:

A:=If( C>Mov(C,50,E) 
AND ROC(C ,30 ,% ) >0
AND ROC(C,65,%)>0,1,
If(C<Mov(C,50,E) 
AND ROC(C ,30 ,% ) <0
AND ROC(C,65,%)<0,-1,0));
A=1 and Ref(A,-1)<>1


Short Entry

Code:

A:=If( C>Mov(C,50,E) 
AND ROC(C ,30 ,% ) >0
AND ROC(C,65,%)>0,1,
If(C<Mov(C,50,E) 
AND ROC(C ,30 ,% ) <0
AND ROC(C,65,%)<0,-1,0));
A=-1 and Ref(A,-1)<>-1


Long exit
Code:

A:=If( C>Mov(C,50,E) 
AND ROC(C ,30 ,% ) >0
AND ROC(C,65,%)>0,1,
If(C<Mov(C,50,E) 
AND ROC(C ,30 ,% ) <0
AND ROC(C,65,%)<0,-1,0));
A<>1 and Ref(A,-1)=1


Short Exit

Code:

A:=If( C>Mov(C,50,E) 
AND ROC(C ,30 ,% ) >0
AND ROC(C,65,%)>0,1,
If(C<Mov(C,50,E) 
AND ROC(C ,30 ,% ) <0
AND ROC(C,65,%)<0,-1,0));
A<>-1 and Ref(A,-1)=-1

triggerlips  
#7 Posted : Saturday, September 29, 2012 11:06:18 PM(UTC)
triggerlips

Rank: Newbie

Groups: Registered, Registered Users, Subscribers
Joined: 4/13/2011(UTC)
Posts: 5

Thankyou , that has done the trick
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.