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

Notification

Icon
Error

Options
Go to last post Go to first unread
Klim1  
#1 Posted : Wednesday, December 5, 2012 4:09:47 PM(UTC)
Klim1

Rank: Newbie

Groups: Registered, Registered Users
Joined: 12/5/2012(UTC)
Posts: 7

Need a formula to display inertia Metastotsk 7.0Dear Traders, please tell me the formula inertia indicator in MetaStock, on which it is based.
wabbit  
#2 Posted : Wednesday, December 5, 2012 4:31:30 PM(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)
RTFM.


wabbit [:D]

Klim1  
#3 Posted : Wednesday, December 5, 2012 4:35:51 PM(UTC)
Klim1

Rank: Newbie

Groups: Registered, Registered Users
Joined: 12/5/2012(UTC)
Posts: 7

Looking for .. there is not ..
wabbit  
#4 Posted : Wednesday, December 5, 2012 4:39:24 PM(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)
Klim1  
#5 Posted : Wednesday, December 5, 2012 4:57:14 PM(UTC)
Klim1

Rank: Newbie

Groups: Registered, Registered Users
Joined: 12/5/2012(UTC)
Posts: 7

it's not in the manual
wabbit  
#6 Posted : Wednesday, December 5, 2012 5:07:47 PM(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)
Every legitimate copy of MS comes with the MS User Manual; the inertia indicator and its interpretation is documented there.

I notice you've only joined the forum today, you've got a copy of MS which is five versions old, so I'm going to guess you didn't purchase the software through legitimate channels, and now you're coming onto the official provider's site asking for help?


wabbit [:D]

jjstein  
#7 Posted : Wednesday, December 5, 2012 5:15:22 PM(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)
Klim1 wrote:
Need a formula to display inertia Metastotsk 7.0Dear Traders, please tell me the formula inertia indicator in MetaStock, on which it is based.


In addition to the manual, try the F1-HELP and search for INERTIA. Also, here is an online reference: http://www.xeatrade.com/metastock/metastock-indicators/inertia-donald-dorsey

Klim1  
#8 Posted : Wednesday, December 5, 2012 5:19:58 PM(UTC)
Klim1

Rank: Newbie

Groups: Registered, Registered Users
Joined: 12/5/2012(UTC)
Posts: 7

I have an official guide. This formula is not there!
Klim1  
#9 Posted : Wednesday, December 5, 2012 5:24:23 PM(UTC)
Klim1

Rank: Newbie

Groups: Registered, Registered Users
Joined: 12/5/2012(UTC)
Posts: 7

Thank you,jjstein. Line indicator, based on this formula is slightly different from the line indicator inertia in MetaStock. It's not.
jjstein  
#10 Posted : Wednesday, December 5, 2012 7:00:07 PM(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)
OK. First off, Inertia is supposed to be a smoothed version of RVI. There were TWO versions of RVI (1993 & 1995); I don't know which one your version of MS has. I found both here: http://forum.equis.com/forums/thread/28471.aspx. It plots fine for me, matching the build-in RVI.

Next was how to smooth -- according to the manual & help, it is SUPPOSED to be smoothed with "LinRegSlope", but I found that a Simple Moving Average matched the built-in indicator!

Here is the code, if you want to play:
Code:

{_Inertia}
Periods2:=Input("INERTIA Periods :",2,200,20); 
Periods:=Input("RVI Periods :",2,200,14); 
SdevPer:=Input("STD Deviation Periods :",2,200,10);

RVIDownH := ((PREV*(Periods-1))+If(ROC(H,1,%)<0,Stdev(H,SdevPer),0))/Periods;
RVIUpH := ((PREV*(Periods-1))+If(ROC(H,1,%)>0,Stdev(H,SdevPer),0))/Periods;
RVIH := ( 100 * RVIUpH ) / ( RVIUpH + RVIDownH);

RVIDownL := ((PREV*(Periods-1))+If(ROC(L,1,%)<0,Stdev(L,SdevPer),0))/Periods;
RVIUpL := ((PREV*(Periods-1))+If(ROC(L,1,%)>0,Stdev(L,SdevPer),0))/Periods;
RVIL := ( 100 * RVIUpL ) / ( RVIUpL + RVIDownL);

RVIall := (RVIL + RVIH) /2;

mov(RVIall,Periods2,Simple);

wabbit  
#11 Posted : Wednesday, December 5, 2012 8:12:37 PM(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)
The manual also says of the RVI:

MS Bible wrote:
The calculation is identical to the Relative Strength Index (RSI) (see Relative Strength Index) except that the RVI measures the standard deviation of daily price changes rather than absolute price changes.


and it's quite easy to prove this incorrect too, simply by noting that the implementation in MS uses recursive smoothing compared to Wilders smoothing in the RSI, and that the StdDev of the data itself is taken NOT the StdDev of the change in that data!

Oddly enough too, the SD length is always 10 periods in the in-built indicator regardless of the length of the RVI? But if you ever needed to change that, here's something I wrote for myself sometime in 2007 if my archive records accurate (not likely!! [:D])

Code:

{RVI method from FM Labs, is same as MS implementation}
{Uses recursive smoothing}
{Performs the same computation twice with different inputs}

{User inputs}
rvPrd:=Input("RVI Periods :",1,200,14);
inPrd:=Input("Inertia Periods :",1,200,20);
sdPrd:=Input("SD Periods (MS Default: 10) :",1,200,10);

{1st pass}
data:=HIGH;

rc:=ROC(data,1,%);
sd:=Stdev(data,sdPrd);
up:=((PREV*(rvPrd-1))+(rc>0)*sd)/rvPrd;
dn:=((PREV*(rvPrd-1))+(rc<0)*sd)/rvPrd;

Hrv:=(100*up)/(up+dn);

{2nd pass}
data:=LOW;

rc:=ROC(data,1,%);
sd:=Stdev(data,sdPrd);
up:=((PREV*(rvPrd-1))+(rc>0)*sd)/rvPrd;
dn:=((PREV*(rvPrd-1))+(rc<0)*sd)/rvPrd;

Lrv:=(100*up)/(up+dn);

{RVI is average}
rv:=(Hrv+Lrv)/2;

{inertia is MA of RVI}
in:=Mov(rv,inPrd,S);

{plot}
rv;
in;



wabbit [:D]

wabbit  
#12 Posted : Wednesday, December 5, 2012 8:21:11 PM(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)
D'OH

Two numpty alerts in one day!

The PREVs are WILDERS smoothing functions! so can be replaced!! Heaps faster and avoids recursion!


Code:

{RVI method from FM Labs}
{Using Wilders avoids recursive smoothing}
{performs the same computation twice with different inputs}

rvPrd:=Input("RVI Periods :",1,200,14);
inPrd:=Input("Inertia Periods :",1,200,20);
sdPrd:=Input("SD Periods (MS Default: 10) :",1,200,10);

{1st pass}
data:=HIGH;

rc:=ROC(data,1,%);
sd:=Stdev(data,sdPrd);
up:=Wilders((rc>0)*sd,rvPrd);
dn:=Wilders((rc<0)*sd,rvPrd);

Hrv:=(100*up)/(up+dn);

{2nd pass}
data:=LOW;

rc:=ROC(data,1,%);
sd:=Stdev(data,sdPrd);
up:=Wilders((rc>0)*sd,rvPrd);
dn:=Wilders((rc<0)*sd,rvPrd);

Lrv:=(100*up)/(up+dn);

{RVI is average}
rv:=(Hrv+Lrv)/2;

{inertia is MA of RVI}
in:=Mov(rv,inPrd,S);

{plot}
rv;
in;


Don't know why I didn't see that at the time? Too much wine perhaps?



wabbit [:D]

jjstein  
#13 Posted : Wednesday, December 5, 2012 8:39:52 PM(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)
They all seem to match... Hmmm. Well, without the original article, which is it supposed to be -- the data, or the change in the data? Also, how would you smooth using LinRegSlope? Never thought-of or played-with that idea...
wabbit  
#14 Posted : Wednesday, December 5, 2012 9:09:29 PM(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)
jjstein wrote:
without the original article, which is it supposed to be -- the data, or the change in the data?

Dunno. This is why I always get people to write down what is supposed to happen when they post their code.

jjstein wrote:
how would you smooth using LinRegSlope? Never thought-of or played-with that idea...

MS Bible wrote:
Inertia is simply a smoothed RVI. The smoothing mechanism is a Linear Regression indicator (see Linear Regression Indicator).

It's not LinRegSlope, it's LinearReg(data, periods,smoothing type, smoothing periods)

If you ever wanted to create a AMA based on LRS, I'd be looking to reduce the length as the slope increased, maybe something like:

Code:

data:=CLOSE;
prd:=14;

{define slope in % instead of $}
sl:=100*linregslope(data,prd)/data;
sl:=min(abs(sl),1);

n:=(2/(sl))-1;
ma:=extfml("forum.mov",data,n,e);

{plot}
ma


???????

Have a play... let us know.


wabbit[:D]

Klim1  
#15 Posted : Thursday, December 6, 2012 2:16:37 AM(UTC)
Klim1

Rank: Newbie

Groups: Registered, Registered Users
Joined: 12/5/2012(UTC)
Posts: 7

Friends, thank you very much. You saved me.)) I am very pleased.) More profits for you!
Klim1  
#16 Posted : Thursday, December 6, 2012 2:53:29 AM(UTC)
Klim1

Rank: Newbie

Groups: Registered, Registered Users
Joined: 12/5/2012(UTC)
Posts: 7

Thank you very much, jjstein)) .. you are super people!
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.