Platforms to show: All Mac Windows Linux Cross-Platform
Back to CDArrayMBS class.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | ChartDirector | MBS ChartDirector Plugin | 8.2 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | ChartDirector | MBS ChartDirector Plugin | 8.2 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
CDArrayMBS.addArray(value as CDArrayMBS)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | ChartDirector | MBS ChartDirector Plugin | 16.3 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Parameter | Default | Description |
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:
CDArrayMBS.addArray(value() as Double)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | ChartDirector | MBS ChartDirector Plugin | 8.2 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Parameter | Default | Description |
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:
CDArrayMBS.addValue(value as Double)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | ChartDirector | MBS ChartDirector Plugin | 8.2 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Parameter | Default | Description |
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.
CDArrayMBS.aggregate(srcArray() as Double, aggregateMethod as Integer, param as Double = 50.0) as CDArrayMBS
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | ChartDirector | MBS ChartDirector Plugin | 13.1 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
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.
Parameter | Default | Description |
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. |
param | 50 | The aggregation parameter, if needed. Currently, only AggregatePercentile needs a parameter to specify the percentile used. |
CDArrayMBS.aggregateValues(srcArray() as Double, aggregateMethod as Integer, param as Double = 50.0) as Double()
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | ChartDirector | MBS ChartDirector Plugin | 13.1 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
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.
Parameter | Default | Description |
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. |
param | 50 | The aggregation parameter, if needed. Currently, only AggregatePercentile needs a parameter to specify the percentile used. |
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | ChartDirector | MBS ChartDirector Plugin | 8.2 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | ChartDirector | MBS ChartDirector Plugin | 8.2 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
See also:
CDArrayMBS.Constructor(a as CDArrayMBS)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | ChartDirector | MBS ChartDirector Plugin | 8.2 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
See also:
CDArrayMBS.Constructor(data() as Double)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | ChartDirector | MBS ChartDirector Plugin | 8.2 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
See also:
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | ChartDirector | MBS ChartDirector Plugin | 8.2 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
CDArrayMBS.delta(offset as Integer = 1)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | ChartDirector | MBS ChartDirector Plugin | 8.2 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Parameter | Default | Description |
offset | 1 | The difference in position between an element and the earlier element to be subtracted from it. |
CDArrayMBS.divArray(value as CDArrayMBS)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | ChartDirector | MBS ChartDirector Plugin | 16.3 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
The CDArrayMBS object will be divided by dividing each of its elements by the corresponding element in the given array.
Parameter | Default | Description |
Values | (Mandatory) | A CDArrayMBS with numbers used as divisors to divide the CDArrayMBS object. |
See also:
CDArrayMBS.divArray(value() as Double)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | ChartDirector | MBS ChartDirector Plugin | 8.2 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
The CDArrayMBS object will be divided by dividing each of its elements by the corresponding element in the given array.
Parameter | Default | Description |
b | (Mandatory) | An array of numbers used as divisors to divide the CDArrayMBS object. |
See also:
CDArrayMBS.divValue(value as Double)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | ChartDirector | MBS ChartDirector Plugin | 8.2 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Parameter | Default | Description |
b | (Mandatory) | A number to be used as divisor to divide every element of the CDArrayMBS object. |
CDArrayMBS.expAvg(smoothingFactor as Double)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | ChartDirector | MBS ChartDirector Plugin | 8.2 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
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.
Parameter | Default | Description |
smoothingFactor | (Mandatory) | The smoothing factor used for computing exponential average. It should be between 0 - 1. |
CDArrayMBS.financeDiv(values() as Double, zeroByZeroValue as Double)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | ChartDirector | MBS ChartDirector Plugin | 8.2 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
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.
Parameter | Default | Description |
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. |
CDArrayMBS.getvalue(index as Integer) as Double
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | ChartDirector | MBS ChartDirector Plugin | 8.2 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Returns zero if the value does not exist.
CDArrayMBS.insert(value as Double, len as Integer, insertPoint as Integer = -1)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | ChartDirector | MBS ChartDirector Plugin | 8.2 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Parameter | Default | Description |
c | (Mandatory) | The value of the constant element. |
len | (Mandatory) | The number of elements to insert. |
insertPoint | -1 | The 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:
CDArrayMBS.insert(value() as Double, insertPoint as Integer = -1)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | ChartDirector | MBS ChartDirector Plugin | 8.2 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Parameter | Default | Description |
a | (Mandatory) | An array to be inserted to the CDArrayMBS object. |
insertPoint | -1 | The 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:
CDArrayMBS.lowess(smoothness as Double = 0.25, iteration as Integer = 0)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | ChartDirector | MBS ChartDirector Plugin | 8.2 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
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.
Parameter | Default | Description |
smoothness | 0.25 | The 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.
iteration | 0 | The 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:
Some examples using this method:
CDArrayMBS.lowess(values() as Double, smoothness as Double = 0.25, iteration as Integer = 0)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | ChartDirector | MBS ChartDirector Plugin | 8.2 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
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.
Parameter | Default | Description |
b | (Mandatory) | An array of numbers providing the x coordinates of the data points in the CDArrayMBS object. |
smoothness | 0.25 | The 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.
iteration | 0 | The 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:
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | ChartDirector | MBS ChartDirector Plugin | 8.2 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
CDArrayMBS.maxIndex as Integer
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | ChartDirector | MBS ChartDirector Plugin | 8.2 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | ChartDirector | MBS ChartDirector Plugin | 8.2 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | ChartDirector | MBS ChartDirector Plugin | 8.2 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
CDArrayMBS.minIndex as Integer
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | ChartDirector | MBS ChartDirector Plugin | 8.2 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
CDArrayMBS.movAvg(interval as Integer)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | ChartDirector | MBS ChartDirector Plugin | 8.2 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
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.
Parameter | Default | Description |
interval | (Mandatory) | The window size. |
CDArrayMBS.movCorr(interval as Integer, value() as Double)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | ChartDirector | MBS ChartDirector Plugin | 8.2 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
The interval parameter specifies the window size for computing moving correlation. The moving correlation is computed as the correlation coefficient between the CDArrayMBS object and the other array, where only the current element and the previous (interval - 1) elements are considered in the computation.
If the other array is not provided, it is assumed to be the sequence of numbers 0, 1, 2, 3, 4.... This is equivalent to checking if the elements of the CDArrayMBS object is linear.
No moving correlation 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.
interval | (Mandatory) | The window size.b | [Empty_Array] | The array to be correlated with the CDArrayMBS object. If this argument is an empty array, the sequence of numbers 0, 1, 2, 3, 4 .... will be used instead. |
CDArrayMBS.movMax(interval as Integer)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | ChartDirector | MBS ChartDirector Plugin | 8.2 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
The interval parameter specifies the window size for computing moving average. The moving average is computed as the maximum of the current element with the previous (interval - 1) elements. No moving maximum 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.
Parameter | Default | Description |
interval | (Mandatory) | The window size. |
CDArrayMBS.movMed(interval as Integer)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | ChartDirector | MBS ChartDirector Plugin | 8.2 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
The interval parameter specifies the window size for computing moving average. The moving average is computed as the median of the current element with the previous (interval - 1) elements. No moving median 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.
Parameter | Default | Description |
interval | (Mandatory) | The window size. |
CDArrayMBS.movMin(interval as Integer)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | ChartDirector | MBS ChartDirector Plugin | 8.2 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
The interval parameter specifies the window size for computing moving average. The moving average is computed as the minimum of the current element with the previous (interval - 1) elements. No moving minimum 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.
Parameter | Default | Description |
interval | (Mandatory) | The window size. |
CDArrayMBS.movPercentile(interval as Integer, percentile as Double)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | ChartDirector | MBS ChartDirector Plugin | 8.2 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
The interval parameter specifies the window size for computing moving average. The moving average is computed as the percentile of the current element with the previous (interval - 1) elements. No moving percentile 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.
Parameter | Default | Description |
interval | (Mandatory) | The window size. |
percentile | (Mandatory) | The percentile to be computed. It should be between 0 - 100. |
CDArrayMBS.movStdDev(interval as Integer)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | ChartDirector | MBS ChartDirector Plugin | 8.2 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
The interval parameter specifies the window size for computing moving average. The moving average is computed as the standard deviation of the current element with the previous (interval - 1) elements. No moving standard deviation 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.
Parameter | Default | Description |
interval | (Mandatory) | The window size. |
The items on this page are in the following plugins: MBS ChartDirector Plugin.