SI
SI
discoversearch

We've detected that you're using an ad content blocking browser plug-in or feature. Ads provide a critical source of revenue to the continued operation of Silicon Investor.  We ask that you disable ad blocking while on Silicon Investor in the best interests of our community.  If you are not using an ad blocker but are still receiving this message, make sure your browser's tracking protection is set to the 'standard' level.
Strategies & Market Trends : Metastock 6.0 for Window -- Ignore unavailable to you. Want to Upgrade?


To: John Sacz who wrote (1561)2/5/1998 3:45:00 PM
From: Sean W. Smith  Read Replies (3) | Respond to of 4056
 
John,

from the metastock help file...

A 4-period Standard Deviation indicator can be written as follows. The first stateement assigns a 4-period simple moving average to the variable named "4PeriodMA". The second statement sums the squares of the differences between the moving average and the closing prices on each of the preceding four periods. It then calculates the square root of this total.
4PeriodMA:= mov( close, 4, S ); sqrt(( power(4PeriodMA) - C, 2) + power(fml(4PeriodMA)- ref(C,-1), 2) + power(fml(4PeriodMA)- ref(C,-2), 2) + power(fml(4PeriodMA)- ref(C,-3), 2) ) / 4 )

An easier method is to take the square root of the variance function as shown below:
sqrt( var( close, 4 ) )
Of course, the easiest way is to write the Standard Deviation formula using the predefined stdev() function (see Standard Deviation).

OR

SYNTAX stdev( DATA ARRAY, PERIODS )
FUNCTION Calculates the predefined Standard Deviation indicator.
EXAMPLE stdev( CLOSE, 21 )

Don't know how to create a data array out of your MA values so
you might have use technique #1....

Sean