Documentation

renko

Syntax

renko(X)
renko(X, threshold)

Arguments

X

X can be aM-by-2 matrix or a table. If X is a M-by-2 matrix, the first column contains date numbers and the second column is the asset price. If X is aM-by-2 table, where each column has the same interpretation. However, in the table form, the first column may be serial date numbers, date character vectors, or datetime arrays.

threshold

(Optional) Specifies a threshold value for asset price. By default, threshold is set to 1.

Description

renko(X) plots asset price with respect to dates.

renko(X, threshold) plots the asset data, X, adding a new box only when the price has changed but at least the value specified by threshold.

Examples

collapse all

Plot Asset Price With Respect to Dates

This example shows how to plot asset price with respect to dates, given asset X as an M-by-2 matrix of date numbers and asset prices, generate a Renko chart.

X = [...

733299.00         41.99;...
733300.00         42.14;...
733303.00         41.93;...
733304.00         41.98;...
733305.00         41.75;...
733306.00         41.61;...
733307.00         42.29;...
733310.00         42.19;...
733311.00         41.82;...
733312.00         41.93;...
733313.00         41.81;...
733314.00         41.37;...
733317.00         41.17;...
733318.00         42.02];

renko(X,.1)

Plot Asset Price With Respect to Dates Using datetime Input

This example shows how to use datetime input to plot asset price with respect to dates, given asset X as an M-by-2 matrix of date numbers and asset prices, generate a Renko chart.

X = [...

733299.00         41.99;...
733300.00         42.14;...
733303.00         41.93;...
733304.00         41.98;...
733305.00         41.75;...
733306.00         41.61;...
733307.00         42.29;...
733310.00         42.19;...
733311.00         41.82;...
733312.00         41.93;...
733313.00         41.81;...
733314.00         41.37;...
733317.00         41.17;...
733318.00         42.02];

dates = datetime(X(:,1),'ConvertFrom','datenum','Locale','en_US');
data = X(:,2);
t = table(dates,data);
renko(t,0.1)

Related Examples

Introduced in R2008a

Was this topic helpful?