Discussions
»
Product and Service Development
»
Formula Assistance
»
Can metastock "remind" variable values at previous bar?
Rank: Advanced Member
Groups: Registered, Registered Users, Subscribers, Unverified Users Joined: 1/25/2010(UTC) Posts: 44 Location: Rome, IT
|
Hi guy! I'm writing an indicator and I want to know how getting a variable value at the previous bar. Example: if I want a dummy indicator the plot 1,0,1,0,1,0,1,0,1,0 for all the bar, I need to know if at previous bar the indicator plotted 1 or 0
|
|
|
|
Rank: Advanced Member
Groups: Registered, Registered Users, Subscribers Joined: 10/26/2009(UTC) Posts: 76 Location: Toronto, Canada
|
Have you tried using PREV?
|
|
|
|
Rank: Advanced Member
Groups: Registered, Registered Users, Subscribers, Unverified Users Joined: 1/25/2010(UTC) Posts: 44 Location: Rome, IT
|
I didn't use it. Can you explain me an easy example on how to use it?
Tnx
|
|
|
|
Rank: Advanced Member
Groups: Registered, Registered Users, Subscribers Joined: 10/26/2009(UTC) Posts: 76 Location: Toronto, Canada
|
http://forum.equis.com/forums/thread/31267.aspx
I'm not sure that PREV should be use though. I will try writing the code for your dummy indicator, but now I have to go to work so if I am able to code it I will post it later on today.
VT
|
|
|
|
Rank: Advanced Member
Groups: Registered, Registered Users, Subscribers Joined: 10/26/2009(UTC) Posts: 76 Location: Toronto, Canada
|
The code for the dummy is (type into your indicator builder):
x=1;
y:= x - PREV;
y;
You can see how prev uses the last result. You can build some useful indicators with prev.
|
|
|
|
Rank: Advanced Member
Groups: Registered, Registered Users, Subscribers, Unverified Users Joined: 1/25/2010(UTC) Posts: 44 Location: Rome, IT
|
Tnx v.trader, now I will try it
|
|
|
|
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)
|
Instead of using the slow PREV (recursive) function, think a little more logically; try this: wabbit [:D]
|
|
|
|
Users browsing this topic |
Guest (Hidden)
|
Discussions
»
Product and Service Development
»
Formula Assistance
»
Can metastock "remind" variable values at previous bar?
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.