Large diffs are not rendered by default.

@@ -1,5 +1,5 @@
/**
* @license Highcharts JS v6.0.4 (2017-12-15)
* @license Highcharts JS v6.0.5 (2018-01-31)
*
* Indicator series type for Highstock
*
@@ -16,6 +16,7 @@
}
}(function(Highcharts) {
(function(H) {
/* eslint max-len: 0 */

var isArray = H.isArray,
seriesType = H.seriesType;
@@ -55,7 +56,6 @@
* @optionparent plotOptions.ema
*/
{
name: 'EMA (14)',
params: {
index: 0,
period: 14
@@ -167,7 +167,8 @@
*/
seriesType('macd', 'sma',
/**
* Moving Average Convergence Divergence (MACD). This series requires `linkedTo` option to be set.
* Moving Average Convergence Divergence (MACD). This series requires
* `linkedTo` option to be set.
*
* @extends {plotOptions.sma}
* @product highstock
@@ -176,7 +177,6 @@
* @optionparent plotOptions.macd
*/
{
name: 'MACD (26, 12, 9)',
params: {
/**
* The short period for indicator calculations.
@@ -277,6 +277,7 @@
dataGrouping: 'averages',
minPointLength: 0
}, {
nameComponents: ['longPeriod', 'shortPeriod', 'signalPeriod'],
// "y" value is treated as Histogram data
pointArrayMap: ['y', 'signal', 'MACD'],
parallelArrays: ['x', 'y', 'signal', 'MACD'],
@@ -315,7 +316,10 @@
each(indicator.points, function(point) {
each([point.signal, point.MACD], function(value, i) {
if (value !== null) {
point[plotNames[i]] = indicator.yAxis.toPixels(value, true);
point[plotNames[i]] = indicator.yAxis.toPixels(
value,
true
);
}
});
});
@@ -367,7 +371,10 @@
// Modify options and generate smoothing line:
each(['macd', 'signal'], function(lineName, i) {
indicator.points = otherSignals[i];
indicator.options = merge(mainLineOptions[lineName + 'Line'].styles, gappedExtend);
indicator.options = merge(
mainLineOptions[lineName + 'Line'].styles,
gappedExtend
);
indicator.graph = indicator['graph' + lineName];
SMA.prototype.drawGraph.call(indicator);
indicator['graph' + lineName] = indicator.graph;
@@ -401,19 +408,22 @@
longEMA = longEMA.values;


// Subtract each Y value from the EMA's and create the new dataset (MACD)
// 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]) {
MACD.push([
shortEMA[i + params.shortPeriod + 1][0],
0,
null,
shortEMA[i + params.shortPeriod + 1][1] - longEMA[i - 1][1]
shortEMA[i + params.shortPeriod + 1][1] -
longEMA[i - 1][1]
]);
}
}

// Set the Y and X data of the MACD. This is used in calculating the signal line.
// Set the Y and X data of the MACD. This is used in calculating the
// signal line.
for (i = 0; i < MACD.length; i++) {
xMACD.push(MACD[i][0]);
yMACD.push([0, null, MACD[i][3]]);
@@ -430,7 +440,8 @@

signalLine = signalLine.values;

// Setting the MACD Histogram. In comparison to the loop with pure MACD this loop uses MACD x value not xData.
// Setting the MACD Histogram. In comparison to the loop with pure
// MACD this loop uses MACD x value not xData.
for (i = 0; i < MACD.length; i++) {
if (MACD[i][0] >= signalLine[0][0]) { // detect the first point

@@ -1,11 +1,11 @@
/*
Highcharts JS v6.0.4 (2017-12-15)
Highcharts JS v6.0.5 (2018-01-31)
Money Flow Index indicator for Highstock
(c) 2010-2017 Grzegorz Blachliski
License: www.highcharts.com/license
*/
(function(e){"object"===typeof module&&module.exports?module.exports=e:e(Highcharts)})(function(e){(function(e){function p(b){return b.reduce(function(c,b){return c+b})}function m(b){return(b[1]+b[2]+b[3])/3}var u=e.isArray;e.seriesType("mfi","sma",{name:"Money Flow Index (14)",params:{period:14,volumeSeriesID:"volume",decimals:4}},{getValues:function(b,c){var d=c.period,n=b.xData,g=b.yData,v=g?g.length:0,w=c.decimals,h=1,a=b.chart.get(c.volumeSeriesID);b=a&&a.yData;var q=[],r=[],t=[],k=[],l=[],f;
(function(e){"object"===typeof module&&module.exports?module.exports=e:e(Highcharts)})(function(e){(function(e){function p(b){return b.reduce(function(c,b){return c+b})}function m(b){return(b[1]+b[2]+b[3])/3}var u=e.isArray;e.seriesType("mfi","sma",{params:{period:14,volumeSeriesID:"volume",decimals:4}},{nameBase:"Money Flow Index",getValues:function(b,c){var d=c.period,n=b.xData,g=b.yData,v=g?g.length:0,w=c.decimals,h=1,a=b.chart.get(c.volumeSeriesID);b=a&&a.yData;var q=[],r=[],t=[],k=[],l=[],f;
if(!a)return e.error("Series "+c.volumeSeriesID+" not found! Check `volumeSeriesID`.",!0);if(n.length<=d||!u(g[0])||4!==g[0].length||!b)return!1;for(c=m(g[h]);h<d+1;)a=c,c=m(g[h]),a=c>=a?!0:!1,f=c*b[h],k.push(a?f:0),l.push(a?0:f),h++;for(d=h-1;d<v;d++)d>h-1&&(k.shift(),l.shift(),a=c,c=m(g[d]),a=c>a?!0:!1,f=c*b[d],k.push(a?f:0),l.push(a?0:f)),a=p(l),f=p(k),a=f/a,a=parseFloat((100-100/(1+a)).toFixed(w)),q.push([n[d],a]),r.push(n[d]),t.push(a);return{values:q,xData:r,yData:t}}})})(e)});
@@ -1,5 +1,5 @@
/**
* @license Highcharts JS v6.0.4 (2017-12-15)
* @license Highcharts JS v6.0.5 (2018-01-31)
*
* Money Flow Index indicator for Highstock
*
@@ -50,8 +50,8 @@
H.seriesType('mfi', 'sma',

/**
* Money Flow Index. This series requires `linkedTo`
* option to be set and should be loaded after `stock/indicators/indicators.js` file.
* Money Flow Index. This series requires `linkedTo` option to be set and
* should be loaded after the `stock/indicators/indicators.js` file.
*
* @extends {plotOptions.sma}
* @product highstock
@@ -62,8 +62,6 @@
*/

{

name: 'Money Flow Index (14)',
/**
* @excluding index
*/
@@ -90,6 +88,7 @@

}
}, {
nameBase: 'Money Flow Index',
getValues: function(series, params) {
var period = params.period,
xVal = series.xData,
@@ -125,7 +124,11 @@
}

// MFI requires high low and close values
if ((xVal.length <= period) || !isArray(yVal[0]) || yVal[0].length !== 4 || !yValVolume) {
if (
(xVal.length <= period) || !isArray(yVal[0]) ||
yVal[0].length !== 4 ||
!yValVolume
) {
return false;
}
// Calculate first typical price
@@ -137,7 +140,10 @@
newTypicalPrice = calculateTypicalPrice(yVal[range]);
isUp = newTypicalPrice >= oldTypicalPrice ? true : false;
// Calculate raw money flow
rawMoneyFlow = calculateRawMoneyFlow(newTypicalPrice, yValVolume[range]);
rawMoneyFlow = calculateRawMoneyFlow(
newTypicalPrice,
yValVolume[range]
);
// Add to array
positiveMoneyFlow.push(isUp ? rawMoneyFlow : 0);
negativeMoneyFlow.push(isUp ? 0 : rawMoneyFlow);
@@ -153,7 +159,10 @@
newTypicalPrice = calculateTypicalPrice(yVal[i]);
isUp = newTypicalPrice > oldTypicalPrice ? true : false;
// Calculate raw money flow
rawMoneyFlow = calculateRawMoneyFlow(newTypicalPrice, yValVolume[i]);
rawMoneyFlow = calculateRawMoneyFlow(
newTypicalPrice,
yValVolume[i]
);
// Add to array
positiveMoneyFlow.push(isUp ? rawMoneyFlow : 0);
negativeMoneyFlow.push(isUp ? 0 : rawMoneyFlow);
@@ -164,7 +173,10 @@
positiveMoneyFlowSum = sumArray(positiveMoneyFlow);

moneyFlowRatio = positiveMoneyFlowSum / negativeMoneyFlowSum;
MFIPoint = toFixed(100 - (100 / (1 + moneyFlowRatio)), decimals);
MFIPoint = toFixed(
100 - (100 / (1 + moneyFlowRatio)),
decimals
);
MFI.push([xVal[i], MFIPoint]);
xData.push(xVal[i]);
yData.push(MFIPoint);
@@ -1,11 +1,11 @@
/*
Highcharts JS v6.0.4 (2017-12-15)
Highcharts JS v6.0.5 (2018-01-31)
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){function m(n,b,a,e,c){a=a[e-1][3]-a[e-c-1][3];b=b[e-1];n.shift();return[b,a]}var p=a.isArray;a=a.seriesType;a("momentum","sma",{name:"Momentum (14)",params:{period:14}},{getValues:function(a,b){b=b.period;var f=a.xData,e=(a=a.yData)?a.length:0,c=f[0],g=[],h=[],k=[],l,d;if(f.length<=b||!p(a[0]))return!1;l=[[c,a[0][3]]];for(c=b+1;c<e;c++)d=m(l,f,a,c,b,void 0),g.push(d),h.push(d[0]),k.push(d[1]);
(function(a){"object"===typeof module&&module.exports?module.exports=a:a(Highcharts)})(function(a){(function(a){function m(n,b,a,e,c){a=a[e-1][3]-a[e-c-1][3];b=b[e-1];n.shift();return[b,a]}var p=a.isArray;a=a.seriesType;a("momentum","sma",{params:{period:14}},{nameBase:"Momentum",getValues:function(a,b){b=b.period;var f=a.xData,e=(a=a.yData)?a.length:0,c=f[0],g=[],h=[],k=[],l,d;if(f.length<=b||!p(a[0]))return!1;l=[[c,a[0][3]]];for(c=b+1;c<e;c++)d=m(l,f,a,c,b,void 0),g.push(d),h.push(d[0]),k.push(d[1]);
d=m(l,f,a,c,b,void 0);g.push(d);h.push(d[0]);k.push(d[1]);return{values:g,xData:h,yData:k}}})})(a)});
@@ -1,5 +1,5 @@
/**
* @license Highcharts JS v6.0.4 (2017-12-15)
* @license Highcharts JS v6.0.5 (2018-01-31)
*
* Indicator series type for Highstock
*
@@ -46,11 +46,11 @@
* @optionparent plotOptions.momentum
*/
{
name: 'Momentum (14)',
params: {
period: 14
}
}, {
nameBase: 'Momentum',
getValues: function(series, params) {
var period = params.period,
xVal = series.xData,

Large diffs are not rendered by default.

@@ -1,5 +1,5 @@
/**
* @license Highcharts JS v6.0.4 (2017-12-15)
* @license Highcharts JS v6.0.5 (2018-01-31)
*
* Indicator series type for Highstock
*
@@ -16,6 +16,7 @@
}
}(function(Highcharts) {
(function(H) {
/* eslint max-len: 0 */


var each = H.each,
@@ -53,7 +54,6 @@
* @optionparent plotOptions.pivotpoints
*/
{
name: 'Pivot Points (28)',
/**
* @excluding index
*/
@@ -81,6 +81,7 @@
approximation: 'averages'
}
}, {
nameBase: 'Pivot Points',
pointArrayMap: ['R4', 'R3', 'R2', 'R1', 'P', 'S1', 'S2', 'S3', 'S4'],
pointValKey: 'P',
toYData: function(point) {
@@ -1,5 +1,5 @@
/**
* @license Highcharts JS v6.0.4 (2017-12-15)
* @license Highcharts JS v6.0.5 (2018-01-31)
*
* Indicator series type for Highstock
*
@@ -16,6 +16,7 @@
}
}(function(Highcharts) {
(function(H) {
/* eslint max-len: 0 */


var each = H.each,
@@ -36,7 +37,6 @@
* @optionparent plotOptions.priceenvelopes
*/
{
name: 'Price envelopes (20, 0.1, 0.1)',
marker: {
enabled: false
},
@@ -131,6 +131,8 @@
approximation: 'averages'
}
}, /** @lends Highcharts.Series.prototype */ {
nameComponents: ['period', 'topBand', 'bottomBand'],
nameBase: 'Price envelopes',
pointArrayMap: ['top', 'middle', 'bottom'],
parallelArrays: ['x', 'y', 'top', 'bottom'],
pointValKey: 'middle',
@@ -1,5 +1,5 @@
/**
* @license Highcharts JS v6.0.4 (2017-12-15)
* @license Highcharts JS v6.0.5 (2018-01-31)
*
* Parabolic SAR Indicator for Highstock
*
@@ -17,6 +17,7 @@
}(function(Highcharts) {
(function(H) {

/* eslint max-len: 0 */



@@ -123,7 +124,6 @@
*/

{
name: 'PSAR',
lineWidth: 0,
marker: {
enabled: true
@@ -189,6 +189,7 @@
decimals: 4
}
}, {
nameComponents: false,
getValues: function(series, params) {
var xVal = series.xData,
yVal = series.yData,
@@ -236,53 +237,64 @@
high = yVal[ind][1];
low = yVal[ind][2];

PSAR = getPSAR(
direction,
previousDirection,
PSAR,
accelerationFactorMultiply,
prevPrevLow,
prevLow,
prevHigh,
prevPrevHigh,
extremePoint
);
newExtremePoint = getExtremePoint(
high,
low,
direction,
extremePoint
);
newDirection = calculateDirection(
previousDirection,
low,
high,
PSAR
);
accelerationFactor = getAccelerationFactor(
newDirection,
direction,
newExtremePoint,
extremePoint,
accelerationFactor,
increment,
maxAccelerationFactor,
initialAccelerationFactor
);
// Null points break PSAR
if (
prevPrevLow !== null &&
prevPrevHigh !== null &&
prevLow !== null &&
prevHigh !== null &&
high !== null &&
low !== null
) {
PSAR = getPSAR(
direction,
previousDirection,
PSAR,
accelerationFactorMultiply,
prevPrevLow,
prevLow,
prevHigh,
prevPrevHigh,
extremePoint
);

EPMinusPSAR = getEPMinusPSAR(newExtremePoint, PSAR);
accelerationFactorMultiply = getAccelerationFactorMultiply(
accelerationFactor,
EPMinusPSAR
);

PSARArr.push([xVal[ind], toFixed(PSAR, decimals)]);
xData.push(xVal[ind]);
yData.push(toFixed(PSAR, decimals));
newExtremePoint = getExtremePoint(
high,
low,
direction,
extremePoint
);
newDirection = calculateDirection(
previousDirection,
low,
high,
PSAR
);
accelerationFactor = getAccelerationFactor(
newDirection,
direction,
newExtremePoint,
extremePoint,
accelerationFactor,
increment,
maxAccelerationFactor,
initialAccelerationFactor
);

previousDirection = direction;
direction = newDirection;
extremePoint = newExtremePoint;
EPMinusPSAR = getEPMinusPSAR(newExtremePoint, PSAR);
accelerationFactorMultiply = getAccelerationFactorMultiply(
accelerationFactor,
EPMinusPSAR
);
PSARArr.push([xVal[ind], toFixed(PSAR, decimals)]);
xData.push(xVal[ind]);
yData.push(toFixed(PSAR, decimals));

previousDirection = direction;
direction = newDirection;
extremePoint = newExtremePoint;
}
}
return {
values: PSARArr,
@@ -1,11 +1,11 @@
/*
Highcharts JS v6.0.4 (2017-12-15)
Highcharts JS v6.0.5 (2018-01-31)
Indicator series type for Highstock
(c) 2010-2017 Kacper Madej
License: www.highcharts.com/license
*/
(function(b){"object"===typeof module&&module.exports?module.exports=b:b(Highcharts)})(function(b){(function(b){var f=b.seriesType,m=b.isArray;f("roc","sma",{name:"Rate of Change (9)",params:{index:3,period:9}},{getValues:function(d,c){var b=c.period,g=d.xData,f=(d=d.yData)?d.length:0,h=[],k=[],l=[],e=-1,a;if(g.length<=b)return!1;m(d[0])&&(e=c.index);for(c=b;c<f;c++)a=0>e?(a=d[c-b])?(d[c]-a)/a*100:null:(a=d[c-b][e])?(d[c][e]-a)/a*100:null,a=[g[c],a],h.push(a),k.push(a[0]),l.push(a[1]);return{values:h,
xData:k,yData:l}}})})(b)});
(function(b){"object"===typeof module&&module.exports?module.exports=b:b(Highcharts)})(function(b){(function(b){var f=b.seriesType,m=b.isArray;f("roc","sma",{name:"Rate of Change (9)",params:{index:3,period:9}},{nameBase:"Rate of Change",getValues:function(d,c){var b=c.period,g=d.xData,f=(d=d.yData)?d.length:0,h=[],k=[],l=[],e=-1,a;if(g.length<=b)return!1;m(d[0])&&(e=c.index);for(c=b;c<f;c++)a=0>e?(a=d[c-b])?(d[c]-a)/a*100:null:(a=d[c-b][e])?(d[c][e]-a)/a*100:null,a=[g[c],a],h.push(a),k.push(a[0]),
l.push(a[1]);return{values:h,xData:k,yData:l}}})})(b)});
@@ -1,5 +1,5 @@
/**
* @license Highcharts JS v6.0.4 (2017-12-15)
* @license Highcharts JS v6.0.5 (2018-01-31)
*
* Indicator series type for Highstock
*
@@ -88,6 +88,7 @@
period: 9
}
}, {
nameBase: 'Rate of Change',
getValues: function(series, params) {
var period = params.period,
xVal = series.xData,
@@ -1,11 +1,11 @@
/*
Highcharts JS v6.0.4 (2017-12-15)
Highcharts JS v6.0.5 (2018-01-31)
Indicator series type for Highstock
(c) 2010-2017 Pawe Fus
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.seriesType("rsi","sma",{name:"RSI (14)",params:{period:14,decimals:4}},{getValues:function(b,c){var e=c.period,a=b.xData,r=(b=b.yData)?b.length:0;c=c.decimals;var d=1,m=[],n=[],p=[],f=0,h=0,g,k,l;if(a.length<e||!q(b[0])||4!==b[0].length)return!1;for(;d<e;)g=parseFloat((b[d][3]-b[d-1][3]).toFixed(c)),0<g?f+=g:h+=Math.abs(g),d++;k=parseFloat((f/(e-1)).toFixed(c));for(l=parseFloat((h/
(e-1)).toFixed(c));d<r;d++)g=parseFloat((b[d][3]-b[d-1][3]).toFixed(c)),0<g?(f=g,h=0):(f=0,h=Math.abs(g)),k=parseFloat(((k*(e-1)+f)/e).toFixed(c)),l=parseFloat(((l*(e-1)+h)/e).toFixed(c)),f=0===l?100:0===k?0:parseFloat((100-100/(1+k/l)).toFixed(c)),m.push([a[d],f]),n.push(a[d]),p.push(f);return{values:m,xData:n,yData:p}}})})(a)});
(function(a){"object"===typeof module&&module.exports?module.exports=a:a(Highcharts)})(function(a){(function(a){var q=a.isArray;a.seriesType("rsi","sma",{params:{period:14,decimals:4}},{getValues:function(b,c){var e=c.period,a=b.xData,r=(b=b.yData)?b.length:0;c=c.decimals;var d=1,m=[],n=[],p=[],f=0,h=0,g,k,l;if(a.length<e||!q(b[0])||4!==b[0].length)return!1;for(;d<e;)g=parseFloat((b[d][3]-b[d-1][3]).toFixed(c)),0<g?f+=g:h+=Math.abs(g),d++;k=parseFloat((f/(e-1)).toFixed(c));for(l=parseFloat((h/(e-
1)).toFixed(c));d<r;d++)g=parseFloat((b[d][3]-b[d-1][3]).toFixed(c)),0<g?(f=g,h=0):(f=0,h=Math.abs(g)),k=parseFloat(((k*(e-1)+f)/e).toFixed(c)),l=parseFloat(((l*(e-1)+h)/e).toFixed(c)),f=0===l?100:0===k?0:parseFloat((100-100/(1+k/l)).toFixed(c)),m.push([a[d],f]),n.push(a[d]),p.push(f);return{values:m,xData:n,yData:p}}})})(a)});
@@ -1,5 +1,5 @@
/**
* @license Highcharts JS v6.0.4 (2017-12-15)
* @license Highcharts JS v6.0.5 (2018-01-31)
*
* Indicator series type for Highstock
*
@@ -16,6 +16,7 @@
}
}(function(Highcharts) {
(function(H) {
/* eslint max-len: 0 */


var isArray = H.isArray;
@@ -38,7 +39,6 @@
* @optionparent plotOptions.rsi
*/
{
name: 'RSI (14)',
/**
* @excluding index
*/
@@ -1,5 +1,5 @@
/**
* @license Highcharts JS v6.0.4 (2017-12-15)
* @license Highcharts JS v6.0.5 (2018-01-31)
*
* Indicator series type for Highstock
*
@@ -16,6 +16,7 @@
}
}(function(Highcharts) {
(function(H) {
/* eslint max-len: 0 */


var each = H.each,
@@ -130,6 +131,8 @@
approximation: 'averages'
}
}, /** @lends Highcharts.Series.prototype */ {
nameComponents: ['periods'],
nameBase: 'Stochastic',
pointArrayMap: ['y', 'smoothed'],
parallelArrays: ['x', 'y', 'smoothed'],
pointValKey: 'y',