File: /var/www/quadcode/frontend/node_modules/highcharts/es5/indicators/bollinger-bands.js
/*
Highstock JS v10.3.3 (2023-01-20)
Indicator series type for Highcharts Stock
(c) 2010-2021 Pawe Fus
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/bollinger-bands",["highcharts","highcharts/modules/stock"],function(g){a(g);a.Highcharts=g;return a}):a("undefined"!==typeof Highcharts?Highcharts:void 0)})(function(a){function g(a,d,e,g){a.hasOwnProperty(d)||(a[d]=g.apply(null,e),"function"===typeof CustomEvent&&window.dispatchEvent(new CustomEvent("HighchartsModuleLoaded",{detail:{path:d,module:a[d]}})))}
a=a?a._modules:{};g(a,"Stock/Indicators/MultipleLinesComposition.js",[a["Core/Series/SeriesRegistry.js"],a["Core/Utilities.js"]],function(a,d){var e=a.seriesTypes.sma.prototype,g=d.defined,p=d.error,r=d.merge,h;(function(a){function d(b){return"plot"+b.charAt(0).toUpperCase()+b.slice(1)}function A(b,f){var a=[];(b.pointArrayMap||[]).forEach(function(b){b!==f&&a.push(d(b))});return a}function c(){var b=this,f=b.linesApiNames,a=b.areaLinesNames,c=b.points,k=b.options,u=b.graph,x={options:{gapSize:k.gapSize}},
n=[],m=A(b,b.pointValKey),l=c.length,h;m.forEach(function(b,a){for(n[a]=[];l--;)h=c[l],n[a].push({x:h.x,plotX:h.plotX,plotY:h[b],isNull:!g(h[b])});l=c.length});if(b.userOptions.fillColor&&a.length){var v=m.indexOf(d(a[0]));v=n[v];a=1===a.length?c:n[m.indexOf(d(a[1]))];m=b.color;b.points=a;b.nextPoints=v;b.color=b.userOptions.fillColor;b.options=r(c,x);b.graph=b.area;b.fillGraph=!0;e.drawGraph.call(b);b.area=b.graph;delete b.nextPoints;delete b.fillGraph;b.color=m}f.forEach(function(a,f){n[f]?(b.points=
n[f],k[a]?b.options=r(k[a].styles,x):p('Error: "There is no '+a+' in DOCS options declared. Check if linesApiNames are consistent with your DOCS line names."'),b.graph=b["graph"+a],e.drawGraph.call(b),b["graph"+a]=b.graph):p('Error: "'+a+" doesn't have equivalent in pointArrayMap. To many elements in linesApiNames relative to pointArrayMap.\"")});b.points=c;b.options=k;b.graph=u;e.drawGraph.call(b)}function u(b){var a,c=[];b=b||this.points;if(this.fillGraph&&this.nextPoints){if((a=e.getGraphPath.call(this,
this.nextPoints))&&a.length){a[0][0]="L";c=e.getGraphPath.call(this,b);a=a.slice(0,c.length);for(var d=a.length-1;0<=d;d--)c.push(a[d])}}else c=e.getGraphPath.apply(this,arguments);return c}function x(b){var a=[];(this.pointArrayMap||[]).forEach(function(c){a.push(b[c])});return a}function v(){var b=this,a=this.pointArrayMap,c=[],d;c=A(this);e.translate.apply(this,arguments);this.points.forEach(function(f){a.forEach(function(a,e){d=f[a];b.dataModify&&(d=b.dataModify.modifyValue(d));null!==d&&(f[c[e]]=
b.yAxis.toPixels(d,!0))})})}var h=[],B=["bottomLine"],y=["top","bottom"],z=["top"];a.compose=function(b){if(-1===h.indexOf(b)){h.push(b);var a=b.prototype;a.linesApiNames=a.linesApiNames||B.slice();a.pointArrayMap=a.pointArrayMap||y.slice();a.pointValKey=a.pointValKey||"top";a.areaLinesNames=a.areaLinesNames||z.slice();a.drawGraph=c;a.getGraphPath=u;a.toYData=x;a.translate=v}return b}})(h||(h={}));return h});g(a,"Stock/Indicators/BB/BBIndicator.js",[a["Stock/Indicators/MultipleLinesComposition.js"],
a["Core/Series/SeriesRegistry.js"],a["Core/Utilities.js"]],function(a,d,e){var g=this&&this.__extends||function(){var a=function(d,c){a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,c){a.__proto__=c}||function(a,c){for(var d in c)Object.prototype.hasOwnProperty.call(c,d)&&(a[d]=c[d])};return a(d,c)};return function(d,c){function e(){this.constructor=d}if("function"!==typeof c&&null!==c)throw new TypeError("Class extends value "+String(c)+" is not a constructor or null");a(d,c);
d.prototype=null===c?Object.create(c):(e.prototype=c.prototype,new e)}}(),p=d.seriesTypes.sma,r=e.extend,h=e.isArray,t=e.merge;e=function(a){function e(){var c=null!==a&&a.apply(this,arguments)||this;c.data=void 0;c.options=void 0;c.points=void 0;return c}g(e,a);e.prototype.init=function(){d.seriesTypes.sma.prototype.init.apply(this,arguments);this.options=t({topLine:{styles:{lineColor:this.color}},bottomLine:{styles:{lineColor:this.color}}},this.options)};e.prototype.getValues=function(a,e){var c=
e.period,g=e.standardDeviation,p=a.xData,r=(a=a.yData)?a.length:0,y=[],z=[],b=[],f;if(!(p.length<c)){var u=h(a[0]);for(f=c;f<=r;f++){var w=p.slice(f-c,f);var k=a.slice(f-c,f);var q=d.seriesTypes.sma.prototype.getValues.call(this,{xData:w,yData:k},e);w=q.xData[0];q=q.yData[0];for(var t=0,n=k.length,m=0;m<n;m++){var l=(u?k[m][e.index]:k[m])-q;t+=l*l}l=Math.sqrt(t/(n-1));k=q+g*l;l=q-g*l;y.push([w,k,q,l]);z.push(w);b.push([k,q,l])}return{values:y,xData:z,yData:b}}};e.defaultOptions=t(p.defaultOptions,
{params:{period:20,standardDeviation:2,index:3},bottomLine:{styles:{lineWidth:1,lineColor:void 0}},topLine:{styles:{lineWidth:1,lineColor:void 0}},tooltip:{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:!1},dataGrouping:{approximation:"averages"}});return e}(p);r(e.prototype,{areaLinesNames:["top","bottom"],linesApiNames:["topLine","bottomLine"],nameComponents:["period",
"standardDeviation"],pointArrayMap:["top","middle","bottom"],pointValKey:"middle"});a.compose(e);d.registerSeriesType("bb",e);"";return e});g(a,"masters/indicators/bollinger-bands.src.js",[],function(){})});
//# sourceMappingURL=bollinger-bands.js.map