/*
 Highstock JS v9.1.0 (2021-05-03)

 Indicator series type for Highcharts Stock

 (c) 2010-2021 Daniel Studencki

 License: www.highcharts.com/license
*/
(function(a){"object"===typeof module&&module.exports?(a["default"]=a,module.exports=a):"function"===typeof define&&define.amd?define("highcharts/indicators/acceleration-bands",["highcharts","highcharts/modules/stock"],function(d){a(d);a.Highcharts=d;return a}):a("undefined"!==typeof Highcharts?Highcharts:void 0)})(function(a){function d(a,h,g,d){a.hasOwnProperty(h)||(a[h]=d.apply(null,g))}a=a?a._modules:{};d(a,"Mixins/MultipleLines.js",[a["Core/Globals.js"],a["Core/Utilities.js"]],function(a,h){var g=
h.defined,d=h.error,q=h.merge,m=a.seriesTypes.sma;return{pointArrayMap:["top","bottom"],pointValKey:"top",linesApiNames:["bottomLine"],getTranslatedLinesNames:function(l){var a=[];(this.pointArrayMap||[]).forEach(function(b){b!==l&&a.push("plot"+b.charAt(0).toUpperCase()+b.slice(1))});return a},toYData:function(l){var a=[];(this.pointArrayMap||[]).forEach(function(b){a.push(l[b])});return a},translate:function(){var a=this,d=a.pointArrayMap,b=[],f;b=a.getTranslatedLinesNames();m.prototype.translate.apply(a,
arguments);a.points.forEach(function(c){d.forEach(function(l,w){f=c[l];null!==f&&(c[b[w]]=a.yAxis.toPixels(f,!0))})})},drawGraph:function(){var a=this,h=a.linesApiNames,b=a.points,f=b.length,c=a.options,z=a.graph,w={options:{gapSize:c.gapSize}},v=[],u;a.getTranslatedLinesNames(a.pointValKey).forEach(function(a,c){for(v[c]=[];f--;)u=b[f],v[c].push({x:u.x,plotX:u.plotX,plotY:u[a],isNull:!g(u[a])});f=b.length});h.forEach(function(b,f){v[f]?(a.points=v[f],c[b]?a.options=q(c[b].styles,w):d('Error: "There is no '+
b+' in DOCS options declared. Check if linesApiNames are consistent with your DOCS line names." at mixin/multiple-line.js:34'),a.graph=a["graph"+b],m.prototype.drawGraph.call(a),a["graph"+b]=a.graph):d('Error: "'+b+" doesn't have equivalent in pointArrayMap. To many elements in linesApiNames relative to pointArrayMap.\"")});a.points=b;a.options=c;a.graph=z;m.prototype.drawGraph.call(a)}}});d(a,"Stock/Indicators/ABands/ABandsIndicator.js",[a["Mixins/MultipleLines.js"],a["Core/Series/SeriesRegistry.js"],
a["Core/Utilities.js"]],function(a,d,g){var h=this&&this.__extends||function(){var a=function(b,c){a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,c){a.__proto__=c}||function(a,c){for(var b in c)c.hasOwnProperty(b)&&(a[b]=c[b])};return a(b,c)};return function(b,c){function d(){this.constructor=b}a(b,c);b.prototype=null===c?Object.create(c):(d.prototype=c.prototype,new d)}}(),t=d.seriesTypes.sma,m=g.correctFloat,l=g.extend,q=g.merge;g=function(a){function b(){var c=null!==a&&a.apply(this,
arguments)||this;c.data=void 0;c.options=void 0;c.points=void 0;return c}h(b,a);b.prototype.getValues=function(c,b){var d=b.period,g=b.factor;b=b.index;var h=c.xData,f=(c=c.yData)?c.length:0,l=[],q=[],t=[],x=[],y=[],e;if(!(f<d)){for(e=0;e<=f;e++){if(e<f){var k=c[e][2];var n=c[e][1];var r=g;k=m(n-k)/(m(n+k)/2)*1E3*r;l.push(c[e][1]*m(1+2*k));q.push(c[e][2]*m(1-2*k))}if(e>=d){k=h.slice(e-d,e);var p=c.slice(e-d,e);r=a.prototype.getValues.call(this,{xData:k,yData:l.slice(e-d,e)},{period:d});n=a.prototype.getValues.call(this,
{xData:k,yData:q.slice(e-d,e)},{period:d});p=a.prototype.getValues.call(this,{xData:k,yData:p},{period:d,index:b});k=p.xData[0];r=r.yData[0];n=n.yData[0];p=p.yData[0];t.push([k,r,p,n]);x.push(k);y.push([r,p,n])}}return{values:t,xData:x,yData:y}}};b.defaultOptions=q(t.defaultOptions,{params:{period:20,factor:.001,index:3},lineWidth:1,topLine:{styles:{lineWidth:1}},bottomLine:{styles:{lineWidth:1}},dataGrouping:{approximation:"averages"}});return b}(t);l(g.prototype,{drawGraph:a.drawGraph,getTranslatedLinesNames:a.getTranslatedLinesNames,
linesApiNames:["topLine","bottomLine"],nameBase:"Acceleration Bands",nameComponents:["period","factor"],pointArrayMap:["top","middle","bottom"],pointValKey:"middle",toYData:a.toYData,translate:a.translate});d.registerSeriesType("abands",g);"";return g});d(a,"masters/indicators/acceleration-bands.src.js",[],function(){})});
//# sourceMappingURL=acceleration-bands.js.map