SIROC Formula
| |
|
Last Poster |
Posts |
Pages |
Last Post |
| |
|
|
|
|
|
|
| Author |
Message |
   trader123
Member
Username: trader123 Post Number: 1 Registered: 06-2008Rating: N/A Votes: 0
|
| | Thursday, June 19, 2008 - 03:19 pm: | 
|
I've found the below Metastock formula for the SIROC indicator but I can't work out how PREV is calculated even though I've checked the manual? I'm trying to replicate the indicator in Excel and am stuck on a9 because of the use of PREV. Can anyone help me out? pr:= CLOSE; a2:= Mov(pr,30,E); a3:= Ref(a2,-30); a4:= 34; a5:= 13; a6:= Mov((pr-a2)/a3,a4,E); a7:= Ref(a6,-1); a8:= If(a6>a7,a6-a7,0); a9:= (a8+PREV*(a5-1))/a5; a10:=If(a6<a7,a7-a6,0); a11:= (a10+PREV*(a5-1))/a5; Siroc:= 100*a9/(a9+a11); Trigger:= Mov(Siroc,8,E); Siroc;Trigger;10;90;
|
   muzza
Member
Username: muzza Post Number: 308 Registered: 06-2003
Rating: N/A Votes: 0
|
| | Saturday, June 28, 2008 - 12:18 pm: | 
|
PREV in Metastock is a constant that allows the creation of a "self-referencing" formula In the Metastock help they illustrate a simple example namely ((H+L+C)/3) + PREV The means add the High, Low and close together and divide the result by 3. Then add yesterdays value of (H+L+C)/3 to the result. Note "yesterday" means the values at the PREVIOUS bar - yesterday for daily, last week for weekly and so on. So in your SIROC indicator where the statement assigns a value to a9 a9:= (a8+PREV*(a5-1))/a5; I would read that to be make a9 = a8 plus the previous value of a8 times (a5-1) etc I'd muck about with simple indicators in MS before coding SIROC in excel - and given the genius that I am please check what I am saying by testing as I could be wrong. Fo e.g. you could make a simple test by making a8:=1 and then code a9 as is and see what displays on your indicator to test PREV cheers
|
|
Threads by Last Post Time: First
Previous
6
7
8
9
10
11
12
13
14
15
Next
Last
|