Main Content

wclose

Weighted close

Using a弗林特object for thetsobjargument is not recommended. Use a matrix,timetable, ortableinstead for financial time series.

Usefts2timetableto convert a弗林特object to atimetableobject.

Description

example

WeightedClose= wclose(Data)calculates the weighted closing prices from the series of high, low, and closing prices. The weighted closing price is the average of twice the closing price plus the high and low prices.

Examples

collapse all

Load the fileSimulatedStock.mat, which provides a timetable (TMW) for financial data for TMW stock.

loadSimulatedStock.matWeightedClose = wclose(TMW); plot(WeightedClose.Time,WeightedClose.WeightedClose) title('Weighted Closing Prices for TMW')

Figure contains an axes object. The axes object with title Weighted Closing Prices for TMW contains an object of type line.

Input Arguments

collapse all

Data for high, low, and closing prices, specified as a matrix, table, or timetable. For matrix input,Datais anM-by-3matrix of high, low, and closing prices stored in the corresponding columns. Timetables and tables withMrows must contain variables named'High','Low', and'Close'(case insensitive).

Data Types:double|table|timetable

Output Arguments

collapse all

Weighted closing price series, returned with the same number of rows (M) and the same type (matrix, table, or timetable) as the inputData.

References

[1] Achelis, S. B.Technical Analysis from A to Z.Second Edition. McGraw-Hill, 1995, pp. 312–313.

版本嗨story

Introduced before R2006a