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,039 highstock.js

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;
}

@@ -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 pick = H.pick,
each = H.each,
@@ -34,16 +33,17 @@
*/
seriesType('sma', 'line',
/**
* Simple moving average indicator (SMA). This series requires `linkedTo` option to be set.
* Simple moving average indicator (SMA). This series requires `linkedTo`
* option to be set.
*
* @extends {plotOptions.line}
* @product highstock
* @sample {highstock} stock/indicators/sma Simple moving average indicator
* @since 6.0.0
* @excluding
* allAreas,colorAxis,compare,compareBase,joinBy,keys,stacking,
* showInNavigator,navigatorOptions,pointInterval,pointIntervalUnit,
* pointPlacement,pointRange,pointStart,joinBy
* showInNavigator,navigatorOptions,pointInterval,
* pointIntervalUnit,pointPlacement,pointRange,pointStart,joinBy
* @optionparent plotOptions.sma
*/
{
@@ -68,7 +68,8 @@
valueDecimals: 4
},
/**
* The main series ID that indicator will be based on. Required for this indicator.
* The main series ID that indicator will be based on. Required for this
* indicator.
*
* @type {String}
* @since 6.0.0
@@ -77,8 +78,9 @@
linkedTo: undefined,
params: {
/**
* The point index which indicator calculations will base.
* For example using OHLC data, index=2 means the indicator will be calculated using Low values.
* The point index which indicator calculations will base. For
* example using OHLC data, index=2 means the indicator will be
* calculated using Low values.
*
* @type {Number}
* @since 6.0.0
@@ -130,7 +132,8 @@
indicator.yData = processedData.yData;
indicator.options.data = processedData.values;

// Removal of processedXData property is required because on first translate processedXData array is empty
// Removal of processedXData property is required because on
// first translate processedXData array is empty
if (indicator.bindTo.series === false) {
delete indicator.processedXData;

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 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]);
@@ -387,12 +415,12 @@
},
getValues: function(series, params) {
var j = 0,
shortEMA,
longEMA,
MACD = [],
xMACD = [],
yMACD = [],
signalLine = [],
shortEMA,
longEMA,
i;

// Calculating the short and long EMA used when calculating the MACD
@@ -411,7 +439,7 @@
// Subtract each Y value from the EMA's and create the new dataset
// (MACD)
for (i = 1; i <= shortEMA.length; i++) {
if (longEMA[i - 1] && longEMA[i - 1][1]) {
if (defined(longEMA[i - 1]) && defined(longEMA[i - 1][1])) {
MACD.push([
shortEMA[i + params.shortPeriod + 1][0],
0,
@@ -1,5 +1,5 @@
/*
Highcharts JS v6.0.6 (2018-02-05)
Highcharts JS v6.0.7 (2018-02-16)
Money Flow Index indicator for Highstock
@@ -1,5 +1,5 @@
/**
* @license Highcharts JS v6.0.6 (2018-02-05)
* @license Highcharts JS v6.0.7 (2018-02-16)
*
* Money Flow Index indicator 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,
@@ -43,8 +42,8 @@

H.seriesType('pivotpoints', 'sma',
/**
* Pivot points indicator. This series requires `linkedTo`
* option to be set and should be loaded after `stock/indicators/indicators.js` file.
* Pivot points indicator. This series requires the `linkedTo` option to be
* set and should be loaded after `stock/indicators/indicators.js` file.
*
* @extends {plotOptions.sma}
* @product highstock
@@ -60,8 +59,9 @@
params: {
period: 28,
/**
* Algorithm used to calculate ressistance and support lines based on pivot points.
* Implemented algorithms: `'standard'`, `'fibonacci'` and `'camarilla'`
* Algorithm used to calculate ressistance and support lines based
* on pivot points. Implemented algorithms: `'standard'`,
* `'fibonacci'` and `'camarilla'`
*
* @type {String}
* @since 6.0.0
@@ -178,16 +178,18 @@
if (indicator.options.dataLabels.enabled) {
pointsLength = indicator.points.length;

// For every Ressitance/Support group we need to render labels
// Add one more item, which will just store dataLabels from previous iteration
// For every Ressitance/Support group we need to render labels.
// Add one more item, which will just store dataLabels from
// previous iteration
each(pointMapping.concat([false]), function(position, k) {
i = pointsLength;
while (i--) {
point = indicator.points[i];

if (!position) {
// Store S4 dataLabel too:
point['dataLabel' + pointMapping[k - 1]] = point.dataLabel;
point['dataLabel' + pointMapping[k - 1]] =
point.dataLabel;
} else {
point.y = point[position];
point.pivotLine = position;
@@ -196,10 +198,14 @@

// Store previous label
if (k) {
point['dataLabel' + pointMapping[k - 1]] = point.dataLabel;
point['dataLabel' + pointMapping[k - 1]] =
point.dataLabel;
}

point.dataLabel = currentLabel = currentLabel && currentLabel.element ? currentLabel : null;
point.dataLabel = currentLabel =
currentLabel && currentLabel.element ?
currentLabel :
null;
}
}
SMA.prototype.drawDataLabels.apply(indicator, arguments);
@@ -212,7 +218,7 @@
yVal = series.yData,
yValLen = yVal ? yVal.length : 0,
placement = this[params.algorithm + 'Placement'],
PP = [], // 0- from, 1- to, 2- R1, 3- R2, 4- pivot, 5- S1, 6- S2 etc.
PP = [], // 0- from, 1- to, 2- R1, 3- R2, 4- pivot, 5- S1 etc.
endTimestamp,
xData = [],
yData = [],
@@ -255,7 +261,8 @@

// We don't know exact position in ordinal axis
// So we use simple logic:
// Get first point in last range, calculate visible average range and multiply by period
// Get first point in last range, calculate visible average range
// and multiply by period
this.endPoint = slicedX[0] +
((endTimestamp - slicedX[0]) / slicedXLen) * period;

@@ -340,8 +347,8 @@
);

/**
* A pivot points indicator. If the [type](#series.pivotpoints.type) option is not
* specified, it is inherited from [chart.type](#chart.type).
* A pivot points indicator. If the [type](#series.pivotpoints.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.