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

Notification

Icon
Error

Options
Go to last post Go to first unread
rarobert  
#1 Posted : Monday, February 20, 2012 1:45:22 PM(UTC)
rarobert

Rank: Member

Groups: Registered, Registered Users, Subscribers
Joined: 8/11/2011(UTC)
Posts: 10

There are 5 formulas under TMV. I can create the Keltner Channel but not the others. Are each of the formulas to be entered as a seperate indicator or all entered together as one indicator? If I enter them as seperate indicators I get nothing that looks like the Figures in the magazine. If I try to enter all as one I get error messages. Pls help! Thanks Bob
jjstein  
#2 Posted : Monday, February 20, 2012 8:03:46 PM(UTC)
jjstein

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers
Joined: 5/13/2005(UTC)
Posts: 715
Location: Midwest, USA

Was thanked: 1 time(s) in 1 post(s)
An unfortunate case of sloppy writing, combined with [censored]-poor editting, judging by the code available at Traders.com. Try this:
Code:
{------------------}
{_Keltner Channel}
{------------------}
x:=Input("Number of Periods", 2,500,13);
Mov((H+L+C)/3,x,S);
Mov((H+L+C)/3,x,S) + Mov((H-L),x,S);
Mov((H+L+C)/3,x,S) - Mov((H-L),x,S);


{------------------}
EXPERT - Trends
{------------------}
{ RIBBON Button: Bullish=BLACK, Bearish & Neutral=WHITE, all no pattern }
OscV(1,20,S,%) > 50 {Volume Oscillator}


{------------------}
EXPERT Highlight #1
{------------------}
{ ADX Price Rising = GREEN }
ADX(10) > Ref(ADX(10),-1) AND When(C > Mov(C,8,S))


{------------------}
EXPERT Highlight #2
{------------------}
{ ADX Price Falling = RED }
ADX(10) > Ref(ADX(10),-1) AND When(C < Mov(C,8,S))

Which should give you this:
UserPostedImage


rarobert  
#3 Posted : Tuesday, February 21, 2012 4:04:28 PM(UTC)
rarobert

Rank: Member

Groups: Registered, Registered Users, Subscribers
Joined: 8/11/2011(UTC)
Posts: 10

Thank you very much for the help. One small problem. I have copied the formula you gave and I get an error by way of a flashing cursor in front of the EXPERT -Trends saying this is not a recognized name, constant or operator. Thanks again Bob
jjstein  
#4 Posted : Tuesday, February 21, 2012 4:44:26 PM(UTC)
jjstein

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers
Joined: 5/13/2005(UTC)
Posts: 715
Location: Midwest, USA

Was thanked: 1 time(s) in 1 post(s)
Try a "Copy & Paste"; it works for me.

rarobert  
#5 Posted : Tuesday, February 21, 2012 5:18:27 PM(UTC)
rarobert

Rank: Member

Groups: Registered, Registered Users, Subscribers
Joined: 8/11/2011(UTC)
Posts: 10

That is what I've been doing. I put {} around the "Expert trends etc but when I get down to the line starting with ADX price rising Green I get a different error message wanting 1 of a list of symbols and/or the word AND,OR. I've tried copy paste a dozen times, copying from the top and the bottom. I'm using MetaStock 11. Thanks again, Bob
rarobert  
#6 Posted : Tuesday, February 21, 2012 5:26:23 PM(UTC)
rarobert

Rank: Member

Groups: Registered, Registered Users, Subscribers
Joined: 8/11/2011(UTC)
Posts: 10

In front of the following line:ADX(10) > Ref(ADX(10),-1) AND When(C > Mov(C,8,S)) it is asking for +,-,*,/,<,<=,>=,,=,AND,OR. That is 1 of that list. Bob
wabbit  
#7 Posted : Tuesday, February 21, 2012 5:37: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)
The code as provided by JJ is not one indicator -- it is several items; the comments will tell you where to create each item. You should end up with one indicator, and one expert containing two highlights and one ribbon.

How did I know you were trying to dump all the code into one section? The error you are seeing is because when MS is running all the code together, it is having issues at the last line of each "section" which is not terminated with a semi-colon ';' Although semi-colons are not required on the last line of a section, good coding practices dictate that ALL lines should be correctly terminated.

Also, the use of When() is deprecated, so can be omitted.



wabbit [:D]

rarobert  
#8 Posted : Tuesday, February 21, 2012 7:07:09 PM(UTC)
rarobert

Rank: Member

Groups: Registered, Registered Users, Subscribers
Joined: 8/11/2011(UTC)
Posts: 10

Thank you very much. I'm so poor at this formula interpretation, but I will try again. Thanks again, Bob
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.