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

Notification

Icon
Error

Options
Go to last post Go to first unread
ritobroto  
#1 Posted : Monday, February 9, 2009 11:33:42 PM(UTC)
ritobroto

Rank: Newbie

Groups: Registered, Registered Users, Subscribers
Joined: 2/10/2009(UTC)
Posts: 1

Hi all,

Facing the problem of using a vriable under HHVbars() function. The error i get is "This variable or expression must contain only constant data".

Specifically i was doing this

r:= PDI(13); m:= MDI(13);

x:= barssince(cross(m,r));

y:= hhvbars(m,x);

(trying to find the maximum mdi value since the last cross of mdi by pdi). But I recived the above error. Probably I can't use 'x' variable within hhvbars. Please help.

Also, is there a way to use loop in metastock (using version 8)? Need it badly.

Thanks

wabbit  
#2 Posted : Tuesday, February 10, 2009 12:15:28 AM(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)
ritobroto wrote:
Facing the problem of using a vriable under HHVbars() function. The error i get is "This variable or expression must contain only constant data".

Specifically i was doing this

r:= PDI(13); m:= MDI(13);

x:= barssince(cross(m,r));

y:= hhvbars(m,x);

(trying to find the maximum mdi value since the last cross of mdi by pdi). But I recived the above error. Probably I can't use 'x' variable within hhvbars. Please help.

Yes, the HHVBars() expression can only contain constant data; but there are many ways around what you are trying to achieve, I reckon the simplest solution is to download the free forum.dll from the files section. The HHVBars() in this library allows the use of dynamic periods

y:= ExtFml( "Forum.HHVBARS", m, x) ;


ritobroto wrote:
Also, is there a way to use loop in metastock (using version 8)? Need it badly.

No. Specifically, what are you trying to achieve. Sometimes there is another way to do some calculations, but if your computation truly requires a loop, you can only write and external function in a language which allows loops, or export the required dat to another application (like Excel) do the calculations there and then import the values back into MetaStock.


Hope this helps.


wabbit [: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.