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

Notification

Icon
Error

Options
Go to last post Go to first unread
Patrick  
#1 Posted : Friday, April 1, 2005 6:35:38 PM(UTC)
Patrick

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers
Joined: 9/8/2004(UTC)
Posts: 2,266

Was thanked: 1 time(s) in 1 post(s)
Let's say you wanted to use a variable as the number of periods. For example you wanted : Variable:={your formula here}; Mov(Close,Variable,S) You would need to write the following Variable:={your formula here}; Mov(Close,LastValue(Variable-Prev+Prev),S)
kwadrat  
#2 Posted : Tuesday, June 14, 2005 10:19:46 AM(UTC)
kwadrat

Rank: Newbie

Groups: Registered, Registered Users, Subscribers
Joined: 6/13/2005(UTC)
Posts: 4

hi could anyone help me please. i have the following problem: in the ref() formula one must use only constant data i.e. ref([censored],-1) or ref([censored], lastvalue(aaa) ) what should i do when i want to use different values for every bar i.e. a:=calculated value for each bar; ref([censored],-a) i cannot use ref([censored],lastvalue(a) ) beacause then only the last value is inserted into the ref() formula, but i need different values for every bar . i.e i want to calculate : (present value of the indicator) - (value of the indicator "a" periods ago) and "a" is different for every bar (it is calculated exclusively for each bar) thank you for your help
wabbit  
#3 Posted : Tuesday, June 14, 2005 11:16:38 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)
How are you determing the 'a' periods ago? Will something along the lines of this help? x:=some_event; indicator:=indicator - valuewhen(1,x=1,indicator) Just tossing around some ideas... wabbit :D
kwadrat  
#4 Posted : Tuesday, June 14, 2005 5:28:13 PM(UTC)
kwadrat

Rank: Newbie

Groups: Registered, Registered Users, Subscribers
Joined: 6/13/2005(UTC)
Posts: 4

eHour:=Input("enter the hour",0,24,8); eDate:=Input("Enter the Date-DD",1,31,15); eMonth:=Input("Enter the Month-MM",1,12,4); eYear:=Input("Enter the Year-YYYY",0,2100,2005); numdays:=BarsSince(DayOfMonth()=eDate AND Month() =eMonth AND Year()=eYear AND Hour()=eHour ); vold:=Input("enter volume",0,99999999999,20000); cumpv:=Cum(MP()*V); cumvol:=Cum(V); basecumvol:=ValueWhen(1, numdays=0, cumvol); sr1:=cumvol-basecumvol; a:=valuewhen(1,numdays>0,Round(numdays*(sr1/vold)) ); this is how i determin "a" periods then i want to know what is the value of "cumpv" "a" periods ago when i use lastvalue(a) metastock uses only the last value of "a" in data array. when i use the patrick's formula , the one you can finde above, it returns only one value ( for the last bar) not the curve (values for the specified range of bars).
kwadrat  
#5 Posted : Tuesday, June 14, 2005 5:32:05 PM(UTC)
kwadrat

Rank: Newbie

Groups: Registered, Registered Users, Subscribers
Joined: 6/13/2005(UTC)
Posts: 4

sorry ther is : a:=valuewhen(1,numdays>0,Round(numdays*(sr1/vold)) ); this is how i determin "a" periods but should be: a:=valuewhen(1,numdays>0,Round(numdays*(1-(sr1/vold)) ); this is how i determin "a" periods
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.