StdError

Modified on 2008/05/03 15:37 by Administrator — Categorized as: Standard Indicators

Syntax

public static StdError Series(WealthLab.DataSeries source, int period) public StdError(DataSeries source, int period, string description) public static double Value(int bar, DataSeries source, int period)

Parameter Description

source The source DataSeries
period Indicator calculation period

Description

Returns the Standard Error of the estimate for a Linear Regression line of the specified Period. Standard Error measures the difference between actual price and the estimated price of the Linear Regression line at every point along the line. The lower the standard error, the closer actual prices have met the estimate. If all the closing prices matched the Linear Regression values for the specified period, then the Standard Error would be zero.

StdError is a statistical indicator. Other indicators in the same class are LinearReg, LinearRegSlope, RSquared, and StdDev.

Interpretation


Calculation

Standard Error is a fairly complex statistical calculation. It uses the least square fit method to fit a trendline to the data by minimizing the distance between the price and the Linear Regression trendline. This is used to find an estimated of the next periods price. The Standard Error indicator returns the statistical difference between the estimate and the actual price.

Example

using System; using System.Collections.Generic; using System.Text; using System.Drawing; using WealthLab; using WealthLab.Indicators;

namespace WealthLab.Strategies { public class MyStrategy : WealthScript { protected override void Execute() { // Display the most recent Linear Regression value, and the Standard Error int bar = Bars.Count-1; DrawLabel( PricePane, "Linear Reg = " + LinearReg.Value( bar, Close, 30 ) ); DrawLabel( PricePane, "Std Error = " + StdError.Value( bar, Close, 30 ) ); } } }