Xojo Conferences
XDCMay2019MiamiUSA

Platforms to show: All Mac Windows Linux Cross-Platform

Next items

CDArrayMBS.abs
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method ChartDirector MBS ChartDirector Plugin 8.2 Yes Yes Yes Yes No
Function: Replaces each element of the CDArrayMBS object by its absolute value.

Feedback, Comments & Corrections

CDArrayMBS.acc
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method ChartDirector MBS ChartDirector Plugin 8.2 Yes Yes Yes Yes No
Function: Replaces each element of the CDArrayMBS object by the accumulated total of its previous element (including itself).

Feedback, Comments & Corrections

CDArrayMBS.addArray(value as CDArrayMBS)
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method ChartDirector MBS ChartDirector Plugin 16.3 Yes Yes Yes Yes No
Function: The array will be added by adding the each array element to the corresponding element of the CDArrayMBS object.
Notes:
ParameterDefaultDescription
Values(Mandatory)A CDArrayMBS with numbers to be added to the CDArrayMBS object.

This method does not append a new value to the array.

See also:

Feedback, Comments & Corrections

CDArrayMBS.addArray(value() as Double)
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method ChartDirector MBS ChartDirector Plugin 8.2 Yes Yes Yes Yes No
Function: The array will be added by adding the each array element to the corresponding element of the CDArrayMBS object.
Example:
dim src(-1) as Double = Array( 63.1, 10.15, 6.15, 2.88 )
dim data As New CDArrayMBS(array(1.0, 1.0, 1.0, 1.0))

data.addArray( src )

dim lines(-1) as string

lines.Append str(data.count)+" values:"
lines.Append ""
lines.Append str(Data.getvalue(0))
lines.Append str(Data.getvalue(1))
lines.Append str(Data.getvalue(2))
lines.Append str(Data.getvalue(3))

MsgBox Join(lines,EndOfLine)
Notes:
ParameterDefaultDescription
b(Mandatory)An array of numbers to be added to the CDArrayMBS object.

This method does not append a new value to the array.

See also:

Feedback, Comments & Corrections

CDArrayMBS.addValue(value as Double)
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method ChartDirector MBS ChartDirector Plugin 8.2 Yes Yes Yes Yes No
Function: Adds a number to every element of the CDArrayMBS object.
Example:
dim data As New CDArrayMBS(array(1.0, 2.0, 3.0, 4.0))

data.addValue(5)

dim lines(-1) as string

lines.Append str(data.count)+" values:"
lines.Append ""
lines.Append str(Data.getvalue(0))
lines.Append str(Data.getvalue(1))
lines.Append str(Data.getvalue(2))
lines.Append str(Data.getvalue(3))

MsgBox Join(lines,EndOfLine)
Notes:
ParameterDefaultDescription
b(Mandatory)A number to be added to every element of the CDArrayMBS object.

This method does not append a new value to the array.

Feedback, Comments & Corrections

CDArrayMBS.aggregate(srcArray() as Double, aggregateMethod as Integer, param as Double = 50.0) as CDArrayMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method ChartDirector MBS ChartDirector Plugin 13.1 Yes Yes Yes Yes No
Function: Aggregates a data array by merging groups of elements, similar to the GROUP BY clause in SQL statements.
Notes:
This primary usage of this method is for changing data resolution, such as to convert a daily data into weekly data.

If the data is from a database, aggregation can often be more efficiently and conveniently performed by using the GROUP BY clause of SQL. This method should only be used when the data are not coming from a database, or the aggregation method are not supported by the database used.

In this method, the CDArrayMBS object represents the delimiters used to group elements in the srcArray. The positions of all non-kNoValue elements in the CDArrayMBS object will be used as delimiters positions.

For example, if the CDArrayMBS object consists of an array of 50 elements, and only the elements at 0, 10, 20, 30, 40 are not NoValue, then the groups will be defined as positions 0 - 9, 10 - 19, 20 - 29, 30 - 39 and 40 - 49.

Note that a group includes the starting delimiter position but excludes the ending delimiter position.

The CDArrayMBS object is typically created by applying CDArrayMBS.selectStartOfHour, CDArrayMBS.selectStartOfDay, CDArrayMBS.selectStartOfWeek, CDArrayMBS.selectStartOfMonth, CDArrayMBS.selectStartOfYear or CDArrayMBS.selectRegularSpacing to a data array.

For example, to group daily data into weekly data, one may create an CDArrayMBS object with the dates of the daily data, then CDArrayMBS.selectStartOfWeek to select only the elements representing the start of a week. The resulting CDArrayMBS object can then be used to aggregate daily data into weekly data.

Due to aggregation, the length of the output array will usually be shorter than, and never be longer than, the length of the input array.

ParameterDefaultDescription
srcArray(Mandatory)The array to be aggregated.
aggregateMethod(Mandatory)The method to aggregate the data, which must be one of AggregateSum, AggregateAvg, AggregateStdDev, AggregateMin, AggregateMed, AggregateMax, AggregatePercentile, AggregateFirst, AggregateLast, AggregateCount.
param50The aggregation parameter, if needed. Currently, only AggregatePercentile needs a parameter to specify the percentile used.

Feedback, Comments & Corrections

CDArrayMBS.aggregateValues(srcArray() as Double, aggregateMethod as Integer, param as Double = 50.0) as Double()
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method ChartDirector MBS ChartDirector Plugin 13.1 Yes Yes Yes Yes No
Function: Aggregates a data array by merging groups of elements, similar to the GROUP BY clause in SQL statements.
Notes:
This primary usage of this method is for changing data resolution, such as to convert a daily data into weekly data.

If the data is from a database, aggregation can often be more efficiently and conveniently performed by using the GROUP BY clause of SQL. This method should only be used when the data are not coming from a database, or the aggregation method are not supported by the database used.

In this method, the CDArrayMBS object represents the delimiters used to group elements in the srcArray. The positions of all non-kNoValue elements in the CDArrayMBS object will be used as delimiters positions.

For example, if the CDArrayMBS object consists of an array of 50 elements, and only the elements at 0, 10, 20, 30, 40 are not NoValue, then the groups will be defined as positions 0 - 9, 10 - 19, 20 - 29, 30 - 39 and 40 - 49.

Note that a group includes the starting delimiter position but excludes the ending delimiter position.

The CDArrayMBS object is typically created by applying CDArrayMBS.selectStartOfHour, CDArrayMBS.selectStartOfDay, CDArrayMBS.selectStartOfWeek, CDArrayMBS.selectStartOfMonth, CDArrayMBS.selectStartOfYear or CDArrayMBS.selectRegularSpacing to a data array.

For example, to group daily data into weekly data, one may create an CDArrayMBS object with the dates of the daily data, then CDArrayMBS.selectStartOfWeek to select only the elements representing the start of a week. The resulting CDArrayMBS object can then be used to aggregate daily data into weekly data.

Due to aggregation, the length of the output array will usually be shorter than, and never be longer than, the length of the input array.

ParameterDefaultDescription
srcArray(Mandatory)The array to be aggregated.
aggregateMethod(Mandatory)The method to aggregate the data, which must be one of AggregateSum, AggregateAvg, AggregateStdDev, AggregateMin, AggregateMed, AggregateMax, AggregatePercentile, AggregateFirst, AggregateLast, AggregateCount.
param50The aggregation parameter, if needed. Currently, only AggregatePercentile needs a parameter to specify the percentile used.

Feedback, Comments & Corrections

CDArrayMBS.avg as Double
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method ChartDirector MBS ChartDirector Plugin 8.2 Yes Yes Yes Yes No
Function: Gets the avg value of the elements of the CDArrayMBS object.
Example:
dim data As New CDArrayMBS(array(1.0, 2.0, 3.0, 4.0))
MsgBox str(data.avg) // shows 2.5

Feedback, Comments & Corrections

CDArrayMBS.Constructor
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method ChartDirector MBS ChartDirector Plugin 8.2 Yes Yes Yes Yes No
Function: The dummy constructor doing nothing.

See also:

Feedback, Comments & Corrections

CDArrayMBS.Constructor(a as CDArrayMBS)
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method ChartDirector MBS ChartDirector Plugin 8.2 Yes Yes Yes Yes No
Function: Creates an CDArrayMBS object and initialize it with the given array.

See also:

Feedback, Comments & Corrections

CDArrayMBS.Constructor(data() as Double)
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method ChartDirector MBS ChartDirector Plugin 8.2 Yes Yes Yes Yes No
Function: Creates an CDArrayMBS object and initialize it with the given array.

See also:

Feedback, Comments & Corrections

CDArrayMBS.count as Integer
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method ChartDirector MBS ChartDirector Plugin 8.2 Yes Yes Yes Yes No
Function: Returns the number of elements in this array object.
Example:
dim data As New CDArrayMBS(array(1.0, 2.0, 3.0, 4.0))
MsgBox str(data.count) // shows 4

Feedback, Comments & Corrections

CDArrayMBS.delta(offset as Integer = 1)
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method ChartDirector MBS ChartDirector Plugin 8.2 Yes Yes Yes Yes No
Function: Subtracts each element of the CDArrayMBS object by an earlier element in the same CDArrayMBS object.
Notes:
ParameterDefaultDescription
offset1The difference in position between an element and the earlier element to be subtracted from it.

Feedback, Comments & Corrections

CDArrayMBS.divArray(value as CDArrayMBS)
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method ChartDirector MBS ChartDirector Plugin 16.3 Yes Yes Yes Yes No
Function: Divides the CDArrayMBS object by the given array.
Notes:
The CDArrayMBS object will be divided by dividing each of its elements by the corresponding element in the given array.

ParameterDefaultDescription
Values(Mandatory)A CDArrayMBS with numbers used as divisors to divide the CDArrayMBS object.

See also:

Feedback, Comments & Corrections

CDArrayMBS.divArray(value() as Double)
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method ChartDirector MBS ChartDirector Plugin 8.2 Yes Yes Yes Yes No
Function: Divides the CDArrayMBS object by the given array.
Example:
dim src(-1) as Double = Array( 63.1, 10.15, 6.15, 2.88 )
dim data As New CDArrayMBS(array(2.0, 2.0, 2.0, 2.0))

data.divArray( src )

dim lines(-1) as string

lines.Append str(data.count)+" values:"
lines.Append ""
lines.Append str(Data.getvalue(0))
lines.Append str(Data.getvalue(1))
lines.Append str(Data.getvalue(2))
lines.Append str(Data.getvalue(3))

MsgBox Join(lines,EndOfLine)
Notes:
The CDArrayMBS object will be divided by dividing each of its elements by the corresponding element in the given array.

ParameterDefaultDescription
b(Mandatory)An array of numbers used as divisors to divide the CDArrayMBS object.

See also:

Feedback, Comments & Corrections

CDArrayMBS.divValue(value as Double)
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method ChartDirector MBS ChartDirector Plugin 8.2 Yes Yes Yes Yes No
Function: Divides every element of the CDArrayMBS object by the given number.
Example:
dim data As New CDArrayMBS(array(1.0, 2.0, 3.0, 4.0))

data.divValue(5)

dim lines(-1) as string

lines.Append str(data.count)+" values:"
lines.Append ""
lines.Append str(Data.getvalue(0))
lines.Append str(Data.getvalue(1))
lines.Append str(Data.getvalue(2))
lines.Append str(Data.getvalue(3))

MsgBox Join(lines,EndOfLine)
Notes:
ParameterDefaultDescription
b(Mandatory)A number to be used as divisor to divide every element of the CDArrayMBS object.

Feedback, Comments & Corrections

CDArrayMBS.expAvg(smoothingFactor as Double)
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method ChartDirector MBS ChartDirector Plugin 8.2 Yes Yes Yes Yes No
Function: Replaces each element of the CDArrayMBS object by its exponential average.
Notes:
The exponential average is computed by :

avg(n) = value(n) * smoothingFactor + avg(n - 1) * (1 - smoothingFactor)

where avg(n) is the exponential average of the nth element, and value(n) is the value of the nth element.

For the first element (n = 0), its exponential average is assumed to be equal to its original value.

ParameterDefaultDescription
smoothingFactor(Mandatory)The smoothing factor used for computing exponential average. It should be between 0 - 1.

Feedback, Comments & Corrections

CDArrayMBS.financeDiv(values() as Double, zeroByZeroValue as Double)
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method ChartDirector MBS ChartDirector Plugin 8.2 Yes Yes Yes Yes No
Function: Divides the CDArrayMBS object by the given array, with special handling of the case of zero divided by zero.
Notes:
In many financial formulas, it is possible to have cases of zero divided by zero. For example, the Relative Strength Index is defined as the ratio between positive price changes and absolute value of all price changes over a period of time. In case the price does not change at all during that period, and the RSI will become zero divided by zero.

Traditionally, under the above case, the RSI will be consider as 50%.

To handle these special cases, the financeDiv method has an argument specifying what value to assume in case the division is zero divided by zero.

ParameterDefaultDescription
b(Mandatory)An array of numbers used as divisors to divide the CDArrayMBS object.
zeroByZeroValue(Mandatory)The value to use if the division is zero divided by zero.

Feedback, Comments & Corrections

CDArrayMBS.getvalue(index as Integer) as Double
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method ChartDirector MBS ChartDirector Plugin 8.2 Yes Yes Yes Yes No
Function: Returns the vaue with the given index.
Notes: Returns zero if the value does not exist.

Feedback, Comments & Corrections

CDArrayMBS.insert(value as Double, len as Integer, insertPoint as Integer = -1)
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method ChartDirector MBS ChartDirector Plugin 8.2 Yes Yes Yes Yes No
Function: Inserts some constant elements to the CDArrayMBS object.
Notes:
ParameterDefaultDescription
c(Mandatory)The value of the constant element.
len(Mandatory)The number of elements to insert.
insertPoint-1The position of the insertion point. The new elements will be inserted just before the insertion point. -1 means inserting elements at the end of the array.

See also:

Feedback, Comments & Corrections

CDArrayMBS.insert(value() as Double, insertPoint as Integer = -1)
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method ChartDirector MBS ChartDirector Plugin 8.2 Yes Yes Yes Yes No
Function: Inserts the elements of an array to the CDArrayMBS object.
Notes:
ParameterDefaultDescription
a(Mandatory)An array to be inserted to the CDArrayMBS object.
insertPoint-1The position of the insertion point. The new elements will be inserted just before the insertion point. -1 means inserting elements at the end of the array.

See also:

Feedback, Comments & Corrections

CDArrayMBS.lowess(smoothness as Double = 0.25, iteration as Integer = 0)
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method ChartDirector MBS ChartDirector Plugin 8.2 Yes Yes Yes Yes No
Function: Fits a curve through the data points in the CDArrayMBS object using the LOWESS algorithm.
Example:
// generate some values
dim values() as Double
dim x as Double

for i as Integer = 1 to 10
x = x + rnd - 0.5
values.Append x
next

// make array
dim c as new CDArrayMBS(values)
dim oldValues() as Double = c.Values

// now run Algorithm
c.lowess(1.0) // 1.0 so we see it

// now get new values
dim newValues() as Double = c.Values

// the rest is for displaying in MsgBox:
dim oldValueStrings() as string
dim newValueStrings() as string

for each v as Double in oldValues
oldValueStrings.Append str(v)
next

for each v as Double in newValues
newValueStrings.Append str(v)
next

MsgBox join(oldValueStrings, " ")+EndOfLine+EndOfLine+join(newValueStrings, " ")
Notes:
The full name of LOWESS is "Robust locally weighted regression and smoothing scatterplots". It is a commonly used algorithm for drawing a smooth curve through a number of points.

LOWESS works by assuming a small segment of any curve can be approximated by a straight line. For each data point, LOWESS finds the n nearest points to that data point (n is configurable), and performs weighted linear regression using a tricube weighting function. It then adjust the coordinates of the data point based on the result of the weighted linear regression.

LOWESS can run in multiple iterations, in which case it should converge to a stable curve - thus it is called "robust".

In most cases, LOWESS behaves better than many other smoothing algorithms, such as moving average, moving median, exponential average. Curves draw using LOWESS look smoother, yet they track the data points better. Also, LOWESS behaves well at the end points. On the other hand, methods based on moving windows (e.g. moving averages) do not work on the first few data points, because they need sufficient data points to fill the moving window first.

In this method, each element of the CDArrayMBS object will be replaced by the corresponding value computed using the LOWESS algorithm.

ParameterDefaultDescription
smoothness0.25The smoothness factor. It must be between 0 - 1. It is the portion of points used in finding the n nearest points. In other words, n = smoothness * no_of_points. A larger value will result in a smoother the curve. A smaller value will result in the curve tracking the data points better.

For LOWESS to have any smoothing effect at all, n must be at least 3. You may need to use a large smoothness factor if you only have a few data points.
iteration0The number of additional iteration used in the LOWESS algorithm. Unless your data is extremely noisy, in most case no additional iteration is necessary.

See also:

Feedback, Comments & Corrections

CDArrayMBS.lowess(values() as Double, smoothness as Double = 0.25, iteration as Integer = 0)
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method ChartDirector MBS ChartDirector Plugin 8.2 Yes Yes Yes Yes No
Function: Fits a curve through the data points in the CDArrayMBS object using the LOWESS algorithm, where the spacing of the data points is supplied by the given array.
Notes:
Please refer to CDArrayMBS.lowess for a brief description of the LOWESS algorithm.

In this method, each element of the CDArrayMBS object will be replaced by the corresponding value computed using the LOWESS algorithm.

ParameterDefaultDescription
b(Mandatory)An array of numbers providing the x coordinates of the data points in the CDArrayMBS object.
smoothness0.25The smoothness factor. It must be between 0 - 1. It is the portion of points used in finding the n nearest points. In other words, n = smoothness * no_of_points. A larger value will result in a smoother the curve. A smaller value will result in the curve tracking the data points better.

For LOWESS to have any smoothing effect at all, n must be at least 3. You may need to use a large smoothness factor if you only have a few data points.
iteration0The number of additional iteration used in the LOWESS algorithm. Unless your data is extremely noisy, in most case no additional iteration is necessary.

See also:

Feedback, Comments & Corrections

CDArrayMBS.max as Double
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method ChartDirector MBS ChartDirector Plugin 8.2 Yes Yes Yes Yes No
Function: Gets the maximum value of the elements of the CDArrayMBS object.
Example:
dim data As New CDArrayMBS(array(1.0, 2.0, 3.0, 4.0))
MsgBox str(data.max) // shows 4.0

Feedback, Comments & Corrections

CDArrayMBS.maxIndex as Integer
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method ChartDirector MBS ChartDirector Plugin 8.2 Yes Yes Yes Yes No
Function: Gets the index of the maximum value element of the CDArrayMBS object.

Feedback, Comments & Corrections

CDArrayMBS.med as Double
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method ChartDirector MBS ChartDirector Plugin 8.2 Yes Yes Yes Yes No
Function: Gets the med value of the elements of the CDArrayMBS object.
Example:
dim data As New CDArrayMBS(array(1.0, 2.0, 3.0, 4.0, 1.0))
MsgBox str(data.med) // shows 2.0
MsgBox str(data.avg) // shows 2.2

Feedback, Comments & Corrections

CDArrayMBS.min as Double
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method ChartDirector MBS ChartDirector Plugin 8.2 Yes Yes Yes Yes No
Function: Gets the minimum value of the elements of the CDArrayMBS object.
Example:
dim data As New CDArrayMBS(array(1.0, 2.0, 3.0, 4.0))
MsgBox str(data.min) // shows 1.0

Feedback, Comments & Corrections

CDArrayMBS.minIndex as Integer
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method ChartDirector MBS ChartDirector Plugin 8.2 Yes Yes Yes Yes No
Function: Gets the index of the minimum value element of the CDArrayMBS object.

Feedback, Comments & Corrections

CDArrayMBS.movAvg(interval as Integer)
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method ChartDirector MBS ChartDirector Plugin 8.2 Yes Yes Yes Yes No
Function: Replaces each element of the CDArrayMBS object by its moving average.
Notes:
The interval parameter specifies the window size for computing moving average. The moving average is computed as the average of the current element with the previous (interval - 1) elements. No moving average can be computed for the first (interval - 1) elements, because there are insufficient previous elements. So the first (interval - 1) elements will be replaced with kNoValue.

ParameterDefaultDescription
interval(Mandatory)The window size.

Feedback, Comments & Corrections

Next items

The items on this page are in the following plugins: MBS ChartDirector Plugin.




Links
MBS Xojo Plugins