@@ -1,5 +1,5 @@
/**
* @license Highcharts JS v6.0.6 (2018-02-05)
* @license Highcharts JS v6.0.7 (2018-02-16)
*
* Indicator series type for Highstock
*
@@ -16,7 +16,6 @@
}
}(function(Highcharts) {
(function(H) {
/* eslint max-len: 0 */


var each = H.each,
@@ -26,8 +25,9 @@

H.seriesType('priceenvelopes', 'sma',
/**
* Price envelopes indicator based on [SMA](#plotOptions.sma) calculations. This series requires `linkedTo`
* option to be set and should be loaded after `stock/indicators/indicators.js` file.
* Price envelopes indicator based on [SMA](#plotOptions.sma) calculations.
* This series requires the `linkedTo` option to be set and should be loaded
* after the `stock/indicators/indicators.js` file.
*
* @extends {plotOptions.sma}
* @product highstock
@@ -41,31 +41,7 @@
enabled: false
},
tooltip: {
/**
* The HTML of the point's line in the tooltip. Variables are enclosed
* by curly brackets. Available variables are point.x, point.y, series.
* name and series.color and other properties on the same form. Furthermore,
* point.y can be extended by the `tooltip.valuePrefix` and
* `tooltip.valueSuffix` variables. This can also be overridden for
* each series, which makes it a good hook for displaying units.
*
* In styled mode, the dot is colored by a class name rather
* than the point color.
*
* @type {String}
* @sample {highcharts} highcharts/tooltip/pointformat/ A different point format with value suffix
* @sample {highmaps} maps/tooltip/format/ Format demo
* @default
* <span style="color:{point.color}">\u25CF</span> <b> {series.name}</b><br/>
* Top: {point.top}<br/>
* Middle: {point.middle}<br/>
* Bottom: {point.bottom}<br/>
*/
pointFormat: '<span style="color:{point.color}">\u25CF</span>' +
'<b> {series.name}</b><br/>' +
'Top: {point.top}<br/>' +
'Middle: {point.middle}<br/>' +
'Bottom: {point.bottom}<br/>'
pointFormat: '<span style="color:{point.color}">\u25CF</span><b> {series.name}</b><br/>Top: {point.top}<br/>Middle: {point.middle}<br/>Bottom: {point.bottom}<br/>'
},
params: {
period: 20,
@@ -105,8 +81,9 @@
*/
lineWidth: 1,
/**
* Color of the line.
* If not set, it's inherited from [plotOptions.priceenvelopes.color](#plotOptions.priceenvelopes.color).
* Color of the line. If not set, it's inherited from
* [plotOptions.priceenvelopes.color](#plotOptions.
* priceenvelopes.color).
*
* @type {String}
* @since 6.0.0
@@ -163,11 +140,15 @@
SMA.prototype.translate.apply(indicator);

each(indicator.points, function(point) {
each([point.top, point.middle, point.bottom], function(value, i) {
if (value !== null) {
point[translatedEnvelopes[i]] = indicator.yAxis.toPixels(value, true);
each(
[point.top, point.middle, point.bottom],
function(value, i) {
if (value !== null) {
point[translatedEnvelopes[i]] =
indicator.yAxis.toPixels(value, true);
}
}
});
);
});
},
drawGraph: function() {
@@ -205,7 +186,10 @@
// Modify options and generate lines:
each(['topLine', 'bottomLine'], function(lineName, i) {
indicator.points = deviations[i];
indicator.options = merge(middleLineOptions[lineName].styles, gappedExtend);
indicator.options = merge(
middleLineOptions[lineName].styles,
gappedExtend
);
indicator.graph = indicator['graph' + lineName];
SMA.prototype.drawGraph.call(indicator);

@@ -237,7 +221,11 @@
i;

// Price envelopes requires close value
if (xVal.length < period || !isArray(yVal[0]) || yVal[0].length !== 4) {
if (
xVal.length < period ||
!isArray(yVal[0]) ||
yVal[0].length !== 4
) {
return false;
}

@@ -269,8 +257,8 @@
);

/**
* A price envelopes indicator. If the [type](#series.priceenvelopes.type) option is not
* specified, it is inherited from [chart.type](#chart.type).
* A price envelopes indicator. If the [type](#series.priceenvelopes.type)
* option is not specified, it is inherited from [chart.type](#chart.type).
*
* For options that apply to multiple series, it is recommended to add
* them to the [plotOptions.series](#plotOptions.series) options structure.
@@ -1,5 +1,5 @@
/**
* @license Highcharts JS v6.0.6 (2018-02-05)
* @license Highcharts JS v6.0.7 (2018-02-16)
*
* Parabolic SAR Indicator for Highstock
*
@@ -17,7 +17,6 @@
}(function(Highcharts) {
(function(H) {

/* eslint max-len: 0 */



@@ -193,11 +192,14 @@
getValues: function(series, params) {
var xVal = series.xData,
yVal = series.yData,
extremePoint = yVal[0][1], // Extreme point is the lowest low for falling and highest high for rising psar - and we are starting with falling
// Extreme point is the lowest low for falling and highest high
// for rising psar - and we are starting with falling
extremePoint = yVal[0][1],
accelerationFactor = params.initialAccelerationFactor,
maxAccelerationFactor = params.maxAccelerationFactor,
increment = params.increment,
initialAccelerationFactor = params.initialAccelerationFactor, // Set initial acc factor (for every new trend!)
// Set initial acc factor (for every new trend!)
initialAccelerationFactor = params.initialAccelerationFactor,
PSAR = yVal[0][2],
decimals = params.decimals,
index = params.index,
@@ -222,7 +224,10 @@
direction = (yVal[ind][1] > PSAR) ? 1 : -1;
EPMinusPSAR = getEPMinusPSAR(extremePoint, PSAR);
accelerationFactor = params.initialAccelerationFactor;
accelerationFactorMultiply = getAccelerationFactorMultiply(accelerationFactor, EPMinusPSAR);
accelerationFactorMultiply = getAccelerationFactorMultiply(
accelerationFactor,
EPMinusPSAR
);

PSARArr.push([xVal[index], PSAR]);
xData.push(xVal[index]);
@@ -1,5 +1,5 @@
/*
Highcharts JS v6.0.6 (2018-02-05)
Highcharts JS v6.0.7 (2018-02-16)
Indicator series type for Highstock
@@ -1,5 +1,5 @@
/**
* @license Highcharts JS v6.0.6 (2018-02-05)
* @license Highcharts JS v6.0.7 (2018-02-16)
*
* Indicator series type for Highstock
*
@@ -1,5 +1,5 @@
/*
Highcharts JS v6.0.6 (2018-02-05)
Highcharts JS v6.0.7 (2018-02-16)
Indicator series type for Highstock
@@ -1,5 +1,5 @@
/**
* @license Highcharts JS v6.0.6 (2018-02-05)
* @license Highcharts JS v6.0.7 (2018-02-16)
*
* Indicator series type for Highstock
*
@@ -16,7 +16,6 @@
}
}(function(Highcharts) {
(function(H) {
/* eslint max-len: 0 */


var isArray = H.isArray;
@@ -28,8 +27,9 @@

H.seriesType('rsi', 'sma',
/**
* Relative strength index (RSI) technical indicator. This series requires `linkedTo`
* option to be set and should be loaded after `stock/indicators/indicators.js` file.
* Relative strength index (RSI) technical indicator. This series
* requires the `linkedTo` option to be set and should be loaded after
* the `stock/indicators/indicators.js` file.
*
* @extends {plotOptions.sma}
* @product highstock
@@ -119,14 +119,19 @@
(avgLoss * (period - 1) + loss) / period,
decimals
);
// If average-loss is equal zero, then by definition RSI is set to 100:
// If average-loss is equal zero, then by definition RSI is set
// to 100:
if (avgLoss === 0) {
RSIPoint = 100;
// If average-gain is equal zero, then by definition RSI is set to 0:
// If average-gain is equal zero, then by definition RSI is set
// to 0:
} else if (avgGain === 0) {
RSIPoint = 0;
} else {
RSIPoint = toFixed(100 - (100 / (1 + (avgGain / avgLoss))), decimals);
RSIPoint = toFixed(
100 - (100 / (1 + (avgGain / avgLoss))),
decimals
);
}

RSI.push([xVal[i], RSIPoint]);
@@ -1,5 +1,5 @@
/**
* @license Highcharts JS v6.0.6 (2018-02-05)
* @license Highcharts JS v6.0.7 (2018-02-16)
*
* Indicator series type for Highstock
*
@@ -16,7 +16,6 @@
}
}(function(Highcharts) {
(function(H) {
/* eslint max-len: 0 */


var each = H.each,
@@ -40,8 +39,8 @@

H.seriesType('stochastic', 'sma',
/**
* Stochastic oscillator. This series requires `linkedTo`
* option to be set and should be loaded after `stock/indicators/indicators.js` file.
* Stochastic oscillator. This series requires the `linkedTo` option to be
* set and should be loaded after the `stock/indicators/indicators.js` file.
*
* @extends {plotOptions.sma}
* @product highstock
@@ -70,29 +69,7 @@
enabled: false
},
tooltip: {
/**
* The HTML of the point's line in the tooltip. Variables are enclosed
* by curly brackets. Available variables are point.x, point.y, series.
* name and series.color and other properties on the same form. Furthermore,
* point.y can be extended by the `tooltip.valuePrefix` and
* `tooltip.valueSuffix` variables. This can also be overridden for
* each series, which makes it a good hook for displaying units.
*
* In styled mode, the dot is colored by a class name rather
* than the point color.
*
* @type {String}
* @sample {highcharts} highcharts/tooltip/pointformat/ A different point format with value suffix
* @sample {highmaps} maps/tooltip/format/ Format demo
* @default
* <span style="color:{point.color}">\u25CF</span> <b> {series.name}</b><br/>
* %K: {point.y}<br/>
* %D: {point.smoothed}<br/>
*/
pointFormat: '<span style="color:{point.color}">\u25CF</span>' +
'<b> {series.name}</b><br/>' +
'%K: {point.y}<br/>' +
'%D: {point.smoothed}<br/>'
pointFormat: '<span style="color:{point.color}">\u25CF</span><b> {series.name}</b><br/>%K: {point.y}<br/>%D: {point.smoothed}<br/>'
},
/**
* Smoothed line options.
@@ -117,8 +94,9 @@
*/
lineWidth: 1,
/**
* Color of the line.
* If not set, it's inherited from [plotOptions.stochastic.color](#plotOptions.stochastic.color).
* Color of the line. If not set, it's inherited from
* [plotOptions.stochastic.color](#plotOptions.stochastic.
* color).
*
* @type {String}
* @since 6.0.0
@@ -158,7 +136,10 @@

each(indicator.points, function(point) {
if (point.smoothed !== null) {
point.plotSmoothed = indicator.yAxis.toPixels(point.smoothed, true);
point.plotSmoothed = indicator.yAxis.toPixels(
point.smoothed,
true
);
}
});
},
@@ -188,7 +169,10 @@

// Modify options and generate smoothing line:
indicator.points = smoothing;
indicator.options = merge(mainLineOptions.smoothedLine.styles, gappedExtend);
indicator.options = merge(
mainLineOptions.smoothedLine.styles,
gappedExtend
);
indicator.graph = indicator.graphSmoothed;
SMA.prototype.drawGraph.call(indicator);
indicator.graphSmoothed = indicator.graph;
@@ -219,12 +203,17 @@


// Stochastic requires close value
if (xVal.length < periodK || !isArray(yVal[0]) || yVal[0].length !== 4) {
if (
xVal.length < periodK ||
!isArray(yVal[0]) ||
yVal[0].length !== 4
) {
return false;
}

// For a N-period, we start from N-1 point, to calculate Nth point
// That is why we later need to comprehend slice() elements list with (+1)
// That is why we later need to comprehend slice() elements list
// with (+1)
for (i = periodK - 1; i < yValLen; i++) {
slicedY = yVal.slice(i - periodK + 1, i + 1);

Large diffs are not rendered by default.

Large diffs are not rendered by default.

@@ -1,5 +1,5 @@
/*
Highcharts JS v6.0.6 (2018-02-05)
Highcharts JS v6.0.7 (2018-02-16)
Indicator series type for Highstock
@@ -1,5 +1,5 @@
/**
* @license Highcharts JS v6.0.6 (2018-02-05)
* @license Highcharts JS v6.0.7 (2018-02-16)
*
* Indicator series type for Highstock
*
@@ -23,7 +23,6 @@
*
* License: www.highcharts.com/license
*/
/* eslint max-len: 0 */

var isArray = H.isArray,
seriesType = H.seriesType;
@@ -54,8 +53,9 @@
params: {
period: 30,
/**
* The id of volume series which is mandatory.
* For example using OHLC data, volumeSeriesID='volume' means the indicator will be calculated using OHLC and volume values.
* The id of volume series which is mandatory. For example using
* OHLC data, volumeSeriesID='volume' means the indicator will be
* calculated using OHLC and volume values.
*
* @type {String}
* @since 6.0.0
@@ -65,7 +65,8 @@
}
}, {
/**
* Returns the final values of the indicator ready to be presented on a chart
* Returns the final values of the indicator ready to be presented on a
* chart
* @returns {Object} Object containing computed VWAP
**/
getValues: function(series, params) {
@@ -92,18 +93,33 @@
isOHLC = false;
}

return indicator.calculateVWAPValues(isOHLC, xValues, yValues, volumeSeries, period);
return indicator.calculateVWAPValues(
isOHLC,
xValues,
yValues,
volumeSeries,
period
);
},
/**
* Main algorithm used to calculate Volume Weighted Average Price (VWAP) values
* Main algorithm used to calculate Volume Weighted Average Price (VWAP)
* values
* @param {Boolean} isOHLC says if data has OHLC format
* @param {Array} xValues array of timestamps
* @param {Array} yValues array of yValues, can be an array of a four arrays (OHLC) or array of values (line)
* @param {Array} yValues
* array of yValues, can be an array of a four arrays (OHLC) or
* array of values (line)
* @param {Array} volumeSeries volume series
* @param {Number} period number of points to be calculated
* @returns {Object} Object contains computed VWAP
**/
calculateVWAPValues: function(isOHLC, xValues, yValues, volumeSeries, period) {
calculateVWAPValues: function(
isOHLC,
xValues,
yValues,
volumeSeries,
period
) {
var volumeValues = volumeSeries.yData,
volumeLength = volumeSeries.xData.length,
pointsLength = xValues.length,
@@ -126,12 +142,19 @@
}

for (i = 0, j = 0; i < commonLength; i++) {
// Depending on whether series is OHLC or line type, price is average of the high, low and close or a simple value
typicalPrice = isOHLC ? ((yValues[i][1] + yValues[i][2] + yValues[i][3]) / 3) : yValues[i];
// Depending on whether series is OHLC or line type, price is
// average of the high, low and close or a simple value
typicalPrice = isOHLC ?
((yValues[i][1] + yValues[i][2] + yValues[i][3]) / 3) :
yValues[i];
typicalPrice *= volumeValues[i];

cPrice = j ? (cumulativePrice[i - 1] + typicalPrice) : typicalPrice;
cVolume = j ? (cumulativeVolume[i - 1] + volumeValues[i]) : volumeValues[i];
cPrice = j ?
(cumulativePrice[i - 1] + typicalPrice) :
typicalPrice;
cVolume = j ?
(cumulativeVolume[i - 1] + volumeValues[i]) :
volumeValues[i];

cumulativePrice.push(cPrice);
cumulativeVolume.push(cVolume);
@@ -156,8 +179,9 @@
});

/**
* A `Volume Weighted Average Price (VWAP)` series. If the [type](#series.vwap.type) option is not
* specified, it is inherited from [chart.type](#chart.type).
* A `Volume Weighted Average Price (VWAP)` series. If the
* [type](#series.vwap.type) option is not specified, it is inherited from
* [chart.type](#chart.type).
*
* For options that apply to multiple series, it is recommended to add
* them to the [plotOptions.series](#plotOptions.series) options structure.
@@ -1,5 +1,5 @@
/*
Highcharts JS v6.0.6 (2018-02-05)
Highcharts JS v6.0.7 (2018-02-16)
Indicator series type for Highstock
@@ -1,5 +1,5 @@
/**
* @license Highcharts JS v6.0.6 (2018-02-05)
* @license Highcharts JS v6.0.7 (2018-02-16)
*
* Indicator series type for Highstock
*
@@ -1,5 +1,5 @@
/*
Highcharts JS v6.0.6 (2018-02-05)
Highcharts JS v6.0.7 (2018-02-16)
Indicator series type for Highstock
@@ -1,5 +1,5 @@
/**
* @license Highcharts JS v6.0.6 (2018-02-05)
* @license Highcharts JS v6.0.7 (2018-02-16)
*
* Indicator series type for Highstock
*

Large diffs are not rendered by default.

@@ -1,5 +1,5 @@
/**
* @license Highcharts JS v6.0.6 (2018-02-05)
* @license Highcharts JS v6.0.7 (2018-02-16)
*
* 3D features for Highcharts JS
*
@@ -1401,6 +1401,10 @@
* @product highcharts
* @apioption chart.options3d.frame.bottom.visible
*/

/**
* The bottom of the frame around a 3D chart.
*/
bottom: {},

/**

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

@@ -1,5 +1,5 @@
/*
Highcharts JS v6.0.6 (2018-02-05)
Highcharts JS v6.0.7 (2018-02-16)
Indicator series type for Highstock
@@ -1,5 +1,5 @@
/**
* @license Highcharts JS v6.0.6 (2018-02-05)
* @license Highcharts JS v6.0.7 (2018-02-16)
*
* Indicator series type for Highstock
*
@@ -1,5 +1,5 @@
/*
Highcharts JS v6.0.6 (2018-02-05)
Highcharts JS v6.0.7 (2018-02-16)
Indicator series type for Highstock
@@ -1,5 +1,5 @@
/**
* @license Highcharts JS v6.0.6 (2018-02-05)
* @license Highcharts JS v6.0.7 (2018-02-16)
*
* Indicator series type for Highstock
*
@@ -1,5 +1,5 @@
/**
* @license Highcharts JS v6.0.6 (2018-02-05)
* @license Highcharts JS v6.0.7 (2018-02-16)
*
* Indicator series type for Highstock
*
@@ -16,7 +16,6 @@
}
}(function(Highcharts) {
(function(H) {
/* eslint max-len: 0 */


var each = H.each,
@@ -44,8 +43,8 @@

H.seriesType('bb', 'sma',
/**
* Bollinger bands (BB). This series requires `linkedTo`
* option to be set and should be loaded after `stock/indicators/indicators.js` file.
* Bollinger bands (BB). This series requires the `linkedTo` option to be
* set and should be loaded after the `stock/indicators/indicators.js` file.
*
* @extends {plotOptions.sma}
* @product highstock
@@ -91,8 +90,8 @@
*/
lineWidth: 1,
/**
* Color of the line.
* If not set, it's inherited from [plotOptions.bb.color](#plotOptions.bb.color).
* Color of the line. If not set, it's inherited from
* [plotOptions.bb.color](#plotOptions.bb.color).
*
* @type {String}
* @since 6.0.0
@@ -115,31 +114,7 @@
}
},
tooltip: {
/**
* The HTML of the point's line in the tooltip. Variables are enclosed
* by curly brackets. Available variables are point.x, point.y, series.
* name and series.color and other properties on the same form. Furthermore,
* point.y can be extended by the `tooltip.valuePrefix` and
* `tooltip.valueSuffix` variables. This can also be overridden for
* each series, which makes it a good hook for displaying units.
*
* In styled mode, the dot is colored by a class name rather
* than the point color.
*
* @type {String}
* @sample {highcharts} highcharts/tooltip/pointformat/ A different point format with value suffix
* @sample {highmaps} maps/tooltip/format/ Format demo
* @default
* <span style="color:{point.color}">\u25CF</span> <b> {series.name}</b><br/>
* Top: {point.top}<br/>
* Middle: {point.middle}<br/>
* Bottom: {point.bottom}<br/>
*/
pointFormat: '<span style="color:{point.color}">\u25CF</span>' +
'<b> {series.name}</b><br/>' +
'Top: {point.top}<br/>' +
'Middle: {point.middle}<br/>' +
'Bottom: {point.bottom}<br/>'
pointFormat: '<span style="color:{point.color}">\u25CF</span><b> {series.name}</b><br/>Top: {point.top}<br/>Middle: {point.middle}<br/>Bottom: {point.bottom}<br/>'
},
marker: {
enabled: false
@@ -178,11 +153,17 @@
SMA.prototype.translate.apply(indicator, arguments);

each(indicator.points, function(point) {
each([point.top, point.middle, point.bottom], function(value, i) {
if (value !== null) {
point[translatedBB[i]] = indicator.yAxis.toPixels(value, true);
each(
[point.top, point.middle, point.bottom],
function(value, i) {
if (value !== null) {
point[translatedBB[i]] = indicator.yAxis.toPixels(
value,
true
);
}
}
});
);
});
},
drawGraph: function() {
@@ -220,7 +201,10 @@
// Modify options and generate lines:
each(['topLine', 'bottomLine'], function(lineName, i) {
indicator.points = deviations[i];
indicator.options = merge(middleLineOptions[lineName].styles, gappedExtend);
indicator.options = merge(
middleLineOptions[lineName].styles,
gappedExtend
);
indicator.graph = indicator['graph' + lineName];
SMA.prototype.drawGraph.call(indicator);

@@ -1,5 +1,5 @@
/*
Highcharts JS v6.0.6 (2018-02-05)
Highcharts JS v6.0.7 (2018-02-16)
Indicator series type for Highstock
@@ -1,5 +1,5 @@
/**
* @license Highcharts JS v6.0.6 (2018-02-05)
* @license Highcharts JS v6.0.7 (2018-02-16)
*
* Indicator series type for Highstock
*
@@ -1,5 +1,5 @@
/*
Highcharts JS v6.0.6 (2018-02-05)
Highcharts JS v6.0.7 (2018-02-16)
(c) 2010-2017 Highsoft AS
Author: Sebastian Domas
@@ -1,5 +1,5 @@
/**
* @license Highcharts JS v6.0.6 (2018-02-05)
* @license Highcharts JS v6.0.7 (2018-02-16)
*
* (c) 2010-2017 Highsoft AS
* Author: Sebastian Domas
@@ -23,7 +23,6 @@
*
* License: www.highcharts.com/license
*/
/* eslint max-len: 0 */


H.seriesType('cmf', 'sma',
@@ -44,40 +43,64 @@
period: 14,

/**
* The id of another series to use its data as volume data for the indiator calculation.
* The id of another series to use its data as volume data for the
* indiator calculation.
*/
volumeSeriesID: 'volume'
}
}, {
nameBase: 'Chaikin Money Flow',
/**
* Checks if the series and volumeSeries are accessible, number of points.x is longer than period, is series has OHLC data
* @returns {Boolean} true if series is valid and can be computed, otherwise false
* Checks if the series and volumeSeries are accessible, number of
* points.x is longer than period, is series has OHLC data
* @returns {Boolean}
* true if series is valid and can be computed, otherwise false
**/
isValid: function() {
var chart = this.chart,
options = this.options,
series = this.linkedParent,
volumeSeries = this.volumeSeries || (this.volumeSeries = chart.get(options.params.volumeSeriesID)),
isSeriesOHLC = series && series.yData && series.yData[0].length === 4;
volumeSeries = (
this.volumeSeries ||
(
this.volumeSeries =
chart.get(options.params.volumeSeriesID)
)
),
isSeriesOHLC = (
series &&
series.yData &&
series.yData[0].length === 4
);

function isLengthValid(serie) {
return serie.xData && serie.xData.length >= options.params.period;
return serie.xData &&
serie.xData.length >= options.params.period;
}

return !!(series && volumeSeries && isLengthValid(series) && isLengthValid(volumeSeries) && isSeriesOHLC);
return !!(
series &&
volumeSeries &&
isLengthValid(series) &&
isLengthValid(volumeSeries) && isSeriesOHLC
);
},

/**
* @typedef {Object} Values
* @property {Number[][]} values combined xData and yData values into a tuple
* @property {Number[]} xData values represent x timestamp values
* @property {Number[]} yData values represent y values
* @property {Number[][]} values
* Combined xData and yData values into a tuple
* @property {Number[]} xData
* Values represent x timestamp values
* @property {Number[]} yData
* Values represent y values
**/

/**
* Returns indicator's data
* @returns {False | Values} Returns false if the indicator is not valid, otherwise returns Values object
* @returns {False | Values}
* Returns false if the indicator is not valid, otherwise
* returns Values object
**/
getValues: function(series, params) {
if (!this.isValid()) {
@@ -113,7 +136,8 @@
nullIndex = -1;

/**
* Calculates money flow volume, changes i, nullIndex vars from upper scope!
* Calculates money flow volume, changes i, nullIndex vars from upper
* scope!
* @private
* @param {Number[]} ohlc OHLC point
* @param {Number} volume Volume point's y value
@@ -143,31 +167,48 @@
return ((c - l) - (h - c)) / (h - l);
}

return isValid ? getMoneyFlowMultiplier(high, low, close) * volume : ((nullIndex = i), null);
return isValid ?
getMoneyFlowMultiplier(high, low, close) * volume :
((nullIndex = i), null);
}


if (period > 0 && period <= len) {
for (i = 0; i < period; i++) {
moneyFlowVolume[i] = getMoneyFlowVolume(seriesYData[i], volumeSeriesYData[i]);
moneyFlowVolume[i] = getMoneyFlowVolume(
seriesYData[i],
volumeSeriesYData[i]
);
sumVolume += volumeSeriesYData[i];
sumMoneyFlowVolume += moneyFlowVolume[i];
}

moneyFlowXData.push(xData[i - 1]);
moneyFlowYData.push(i - nullIndex >= period && sumVolume !== 0 ? sumMoneyFlowVolume / sumVolume : null);
moneyFlowYData.push(
i - nullIndex >= period && sumVolume !== 0 ?
sumMoneyFlowVolume / sumVolume :
null
);
values.push([moneyFlowXData[0], moneyFlowYData[0]]);

for (; i < len; i++) {
moneyFlowVolume[i] = getMoneyFlowVolume(seriesYData[i], volumeSeriesYData[i]);
moneyFlowVolume[i] = getMoneyFlowVolume(
seriesYData[i],
volumeSeriesYData[i]
);

sumVolume -= volumeSeriesYData[i - period];
sumVolume += volumeSeriesYData[i];

sumMoneyFlowVolume -= moneyFlowVolume[i - period];
sumMoneyFlowVolume += moneyFlowVolume[i];

point = [xData[i], i - nullIndex >= period ? sumMoneyFlowVolume / sumVolume : null];
point = [
xData[i],
i - nullIndex >= period ?
sumMoneyFlowVolume / sumVolume :
null
];

moneyFlowXData.push(point[0]);
moneyFlowYData.push(point[1]);
@@ -1,11 +1,11 @@
/*
Highcharts JS v6.0.6 (2018-02-05)
Highcharts JS v6.0.7 (2018-02-16)
Indicator series type for Highstock
(c) 2010-2017 Sebastian Bochan
License: www.highcharts.com/license
*/
(function(a){"object"===typeof module&&module.exports?module.exports=a:a(Highcharts)})(function(a){(function(a){var q=a.isArray;a=a.seriesType;a("ema","sma",{params:{index:0,period:14}},{getValues:function(a,g){var b=g.period,h=a.xData,c=a.yData,r=c?c.length:0;a=2/(b+1);var d=0,f=0,n=0,k=[],l=[],m=[],e=-1,p=[];if(h.length<b)return!1;for(q(c[0])&&(e=g.index?g.index:0);f<b;)p.push([h[f],0>e?c[f]:c[f][e]]),n+=0>e?c[f]:c[f][e],f++;g=n/b;for(b=f;b<r;b++)f=0>e?c[b-1]:c[b-1][e],d=[h[b-1],0===d?g:f*a+d*(1-
a)],k.push(d),l.push(d[0]),m.push(d[1]),d=d[1],p.push([h[b],0>e?c[b]:c[b][e]]);c=0>e?c[b-1]:c[b-1][e];d=[h[b-1],0===d?void 0:c*a+d*(1-a)];k.push(d);l.push(d[0]);m.push(d[1]);return{values:k,xData:l,yData:m}}})})(a)});
(function(a){"object"===typeof module&&module.exports?module.exports=a:a(Highcharts)})(function(a){(function(a){function r(b,a,c,f,k,h,e,l){b=0>e?c[f-1]:c[f-1][e];return[a[f-1],void 0===h?l:b*k+h*(1-k)]}var t=a.isArray;a=a.seriesType;a("ema","sma",{params:{index:0,period:14}},{getValues:function(b,a){var c=a.period,f=b.xData,k=(b=b.yData)?b.length:0,h=2/(c+1),e=0,l=0,n=[],p=[],q=[],g=-1,m=[],d;if(f.length<c)return!1;for(t(b[0])&&(g=a.index?a.index:0);e<c;)m.push([f[e],0>g?b[e]:b[e][g]]),l+=0>g?b[e]:
b[e][g],e++;a=l/c;for(c=e;c<k;c++)d=r(m,f,b,c,h,d,g,a),n.push(d),p.push(d[0]),q.push(d[1]),d=d[1],m.push([f[c],0>g?b[c]:b[c][g]]);d=r(m,f,b,c,h,d,g);n.push(d);p.push(d[0]);q.push(d[1]);return{values:n,xData:p,yData:q}}})})(a)});
@@ -1,5 +1,5 @@
/**
* @license Highcharts JS v6.0.6 (2018-02-05)
* @license Highcharts JS v6.0.7 (2018-02-16)
*
* Indicator series type for Highstock
*
@@ -16,7 +16,6 @@
}
}(function(Highcharts) {
(function(H) {
/* eslint max-len: 0 */

var isArray = H.isArray,
seriesType = H.seriesType;
@@ -29,12 +28,23 @@
points.push([xValue, yValue]);
}

function populateAverage(points, xVal, yVal, i, EMApercent, calEMA, index, SMA) {
function populateAverage(
points,
xVal,
yVal,
i,
EMApercent,
calEMA,
index,
SMA
) {
var x = xVal[i - 1],
yValue = index < 0 ? yVal[i - 1] : yVal[i - 1][index],
y;

y = calEMA === 0 ? SMA : ((yValue * EMApercent) + (calEMA * (1 - EMApercent)));
y = calEMA === undefined ?
SMA :
((yValue * EMApercent) + (calEMA * (1 - EMApercent)));

return [x, y];
}
@@ -46,7 +56,8 @@
*/
seriesType('ema', 'sma',
/**
* Exponential moving average indicator (EMA). This series requires `linkedTo` option to be set.
* Exponential moving average indicator (EMA). This series requires the
* `linkedTo` option to be set.
*
* @extends {plotOptions.sma}
* @product highstock
@@ -67,7 +78,6 @@
yVal = series.yData,
yValLen = yVal ? yVal.length : 0,
EMApercent = (2 / (period + 1)),
calEMA = 0,
range = 0,
sum = 0,
EMA = [],
@@ -76,8 +86,9 @@
index = -1,
points = [],
SMA = 0,
i,
EMAPoint;
calEMA,
EMAPoint,
i;

// Check period, if bigger than points length, skip
if (xVal.length < period) {
@@ -101,7 +112,16 @@

// Calculate value one-by-one for each period in visible data
for (i = range; i < yValLen; i++) {
EMAPoint = populateAverage(points, xVal, yVal, i, EMApercent, calEMA, index, SMA);
EMAPoint = populateAverage(
points,
xVal,
yVal,
i,
EMApercent,
calEMA,
index,
SMA
);
EMA.push(EMAPoint);
xData.push(EMAPoint[0]);
yData.push(EMAPoint[1]);
@@ -110,7 +130,15 @@
accumulateAverage(points, xVal, yVal, i, index);
}

EMAPoint = populateAverage(points, xVal, yVal, i, EMApercent, calEMA, index);
EMAPoint = populateAverage(
points,
xVal,
yVal,
i,
EMApercent,
calEMA,
index
);
EMA.push(EMAPoint);
xData.push(EMAPoint[0]);
yData.push(EMAPoint[1]);

Large diffs are not rendered by default.

@@ -1,5 +1,5 @@
/**
* @license Highcharts JS v6.0.6 (2018-02-05)
* @license Highcharts JS v6.0.7 (2018-02-16)
*
* Indicator series type for Highstock
*
@@ -16,7 +16,6 @@
}
}(function(Highcharts) {
(function(H) {
/* eslint max-len: 0 */

var UNDEFINED,
seriesType = H.seriesType,
@@ -62,7 +61,10 @@

for (i = loopLength; i > 0; i--) {
distance = xData[i] - xData[i - 1];
if (closestDataRange === UNDEFINED || distance < closestDataRange) {
if (
closestDataRange === UNDEFINED ||
distance < closestDataRange
) {
closestDataRange = distance;
}
}
@@ -80,7 +82,8 @@
*/
seriesType('ikh', 'sma',
/**
* Ichimoku Kinko Hyo (IKH). This series requires `linkedTo` option to be set.
* Ichimoku Kinko Hyo (IKH). This series requires `linkedTo` option to be
* set.
*
* @extends {plotOptions.sma}
* @product highstock
@@ -89,8 +92,8 @@
* @since 6.0.0
* @excluding
* allAreas,colorAxis,compare,compareBase,joinBy,keys,stacking,
* showInNavigator,navigatorOptions,pointInterval,pointIntervalUnit,
* pointPlacement,pointRange,pointStart
* showInNavigator,navigatorOptions,pointInterval,
* pointIntervalUnit,pointPlacement,pointRange,pointStart
* @optionparent plotOptions.ikh
*/
{
@@ -282,7 +285,13 @@
approximation: 'averages'
}
}, {
pointArrayMap: ['tenkanSen', 'kijunSen', 'chikouSpan', 'senkouSpanA', 'senkouSpanB'],
pointArrayMap: [
'tenkanSen',
'kijunSen',
'chikouSpan',
'senkouSpanA',
'senkouSpanB'
],
pointValKey: 'tenkanSen',
nameComponents: ['periodSenkouSpanB', 'period', 'periodTenkan'],
init: function() {
@@ -346,7 +355,8 @@
true
);

// add extra parameters for support tooltip in moved lines
// add extra parameters for support tooltip in moved
// lines
point.plotY = point['plot' + value];
point.tooltipPos = [point.plotX, point['plot' + value]];
point.isNull = false;
@@ -400,18 +410,32 @@
}

// Modify options and generate lines:
each(['tenkanLine', 'kijunLine', 'chikouLine', 'senkouSpanA', 'senkouSpanB', 'senkouSpan'], function(lineName, i) {
each([
'tenkanLine',
'kijunLine',
'chikouLine',
'senkouSpanA',
'senkouSpanB',
'senkouSpan'
], function(lineName, i) {
// First line is rendered by default option
indicator.points = allIchimokuPoints[i];
indicator.options = merge(mainLineOptions[lineName].styles, gappedExtend);
indicator.options = merge(
mainLineOptions[lineName].styles,
gappedExtend
);
indicator.graph = indicator['graph' + lineName];

// For span, we need an access to the next points, used in getGraphPath()
// For span, we need an access to the next points, used in
// getGraphPath()
indicator.nextPoints = allIchimokuPoints[i - 1];
if (i === 5) {

indicator.points = allIchimokuPoints[i - 1];
indicator.options = merge(mainLineOptions[lineName].styles, gappedExtend);
indicator.options = merge(
mainLineOptions[lineName].styles,
gappedExtend
);
indicator.graph = indicator['graph' + lineName];
indicator.nextPoints = allIchimokuPoints[i - 2];

@@ -507,7 +531,11 @@
SSB;

// ikh requires close value
if (xVal.length <= period || !isArray(yVal[0]) || yVal[0].length !== 4) {
if (
xVal.length <= period ||
!isArray(yVal[0]) ||
yVal[0].length !== 4
) {
return false;
}