{
Indicator:      _StdDevMeanArray

Description:    Test function StdDevMeanArray to calculate standard deviation and mean.

Author:         MarkSanDiego

Updated:        09/13/09     original version
                09/17/09    Function changed to Simple Function.  DoCalc variable eliminated.
}

inputs: 
    Price(close),
    Length(100),            { length used to measure average and standard deviation }
    DataType(1);            { = 1 for Variance and standard deviation of entire population; }
                            { = 2 for Variance and standard deviation of sample of population }

vars:                                   
    oMean(0),               { average price; oAvg = Average(Price, Length) }
    oStdDev(0),             { standard deviation of price; oSD = StandardDev(Price, Length) }
    index(0);
arrays:
    PriceArray[1000](0);                        


    { create circular index for price array }
    index = index + 1;                  
    if index > Length then index = 1;
    PriceArray[index] = Price;

    value1 = _StdDevMeanArray(PriceArray, Length, DataType, oMean, oStdDev);        
    
    plot1(oStdDev, "StdDev Array");
    plot2(oMean, "Mean Array");





