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

Notification

Icon
Error

Options
Go to last post Go to first unread
zaldy  
#1 Posted : Wednesday, July 4, 2012 4:01:28 AM(UTC)
zaldy

Rank: Newbie

Groups: Registered, Registered Users
Joined: 7/4/2012(UTC)
Posts: 3

Hello everybody!

I am a newbie to metastock so I need help on its programming language.
The formula is as follows,

LC:= llvbars(C,21); {Lowest period of the close since 21 days}
Low1:= ref(MACD(),(-1*LC));

The above formula doesnt seem to work.
Error message is "This variable or expression must contain only constant data."
I think it refers to variable LC, which returns only one number...

What I want to do is get the value of the MACD during the lowest close of the last 21 days.

Can anybody explain this or tell me whats wrong in this formula?
Can anybody show me a better way?

Thank you in advance.

Zaldy
ClaudeBrunet  
#2 Posted : Wednesday, July 4, 2012 4:17:13 AM(UTC)
ClaudeBrunet

Rank: Member

Groups: Registered, Registered Users
Joined: 5/22/2012(UTC)
Posts: 19

HI Zaldy; you can use the function ExtFml( "Forum20.LLVBARS", Data Array, Variable Period). but after that you do to download forum20.dll from the site and to make it in C:\Program Files (x86)\Equis\MetaStock\External Function DLLs and it will work.
zaldy  
#3 Posted : Wednesday, July 4, 2012 4:35:30 AM(UTC)
zaldy

Rank: Newbie

Groups: Registered, Registered Users
Joined: 7/4/2012(UTC)
Posts: 3

Hello ClaudeBrunet,

Thank you for your reply. It was very fruitful.
Now I understand why my formula doesnt work,
metastock does not allow variables to be declared as constants..

I have already downloaded the dll file, together with its documentation.
And currenty reading it...
Since Im a newbie, my head is spinning right now... hahaha

Again, thank you very much.

Best regards,
Zaldy
zaldy  
#4 Posted : Wednesday, July 4, 2012 5:16:57 AM(UTC)
zaldy

Rank: Newbie

Groups: Registered, Registered Users
Joined: 7/4/2012(UTC)
Posts: 3

Hello there again,

Can the ExtFml("blah blah blah".... can be used in the expert advisor?

Best regards,
Zaldy
ClaudeBrunet  
#5 Posted : Wednesday, July 4, 2012 6:03:09 AM(UTC)
ClaudeBrunet

Rank: Member

Groups: Registered, Registered Users
Joined: 5/22/2012(UTC)
Posts: 19

Hi Zaldy, typically you can. but i didn't try it.
jjstein  
#6 Posted : Wednesday, July 4, 2012 9:19:50 AM(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)
zaldy wrote:
What I want to do is get the value of the MACD during the lowest close of the last 21 days.


Code:
ValueWhen(1,C=LLV(C,21),MACD());


zaldy wrote:
Can the ExtFml("blah blah blah".... can be used in the expert advisor?


Yes.

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.