Rank: Member
Groups: Registered, Registered Users, Subscribers Joined: 9/25/2005(UTC) Posts: 23 Location: Melbourne, Australia
|
Hello, I want to insert a variable into the Ref function, but MetaStock won't let me.
Is there a way around this?
Example:
I want to create an exploration to look for positive divergence between stochastic
and price.
I used the following formula to return the number of bars since the second most recent stochastic trough:
Tb:=TroughBars(2,Stoch(5,3),.1);
Now I want the closing price Tb bars ago, so I can see if it's higher than the current close.
Neg(Tb);
Ref(C,Tb) Returns the error "This variable or expression must contain only constant data".
|
|
|
|
Rank: Advanced Member
Groups: Registered, Registered Users, Subscribers Joined: 7/25/2005(UTC) Posts: 1,042
Was thanked: 57 time(s) in 54 post(s)
|
Charmeta
Use the Forum dll Ref function. This does allow a variable to be used. Go to the Downloads link to find the dll.
Roy
MetaStock Tips & Tools
|
|
|
|
Rank: Member
Groups: Registered, Registered Users, Subscribers Joined: 9/25/2005(UTC) Posts: 23 Location: Melbourne, Australia
|
Thanks mstt. I've installed the forum dll and it's working.
Also many thanks to patrick for the dll collection.
charmeta
|
|
|
|
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.