/** * Highstock JS v11.2.0 (2023-10-30) * * Indicator series type for Highcharts Stock * * (c) 2010-2021 Daniel Studencki * * License: www.highcharts.com/license */!function(t){"object"==typeof module&&module.exports?(t.default=t,module.exports=t):"function"==typeof define&&define.amd?define("highcharts/indicators/acceleration-bands",["highcharts","highcharts/modules/stock"],function(e){return t(e),t.Highcharts=e,t}):t("undefined"!=typeof Highcharts?Highcharts:void 0)}(function(t){"use strict";var e=t?t._modules:{};function o(t,e,o,i){t.hasOwnProperty(e)||(t[e]=i.apply(null,o),"function"==typeof CustomEvent&&window.dispatchEvent(new CustomEvent("HighchartsModuleLoaded",{detail:{path:e,module:t[e]}})))}o(e,"Stock/Indicators/MultipleLinesComposition.js",[e["Core/Series/SeriesRegistry.js"],e["Core/Utilities.js"]],function(t,e){var o,i=t.seriesTypes.sma.prototype,a=e.defined,n=e.error,r=e.merge;return function(t){var o=[],s=["bottomLine"],p=["top","bottom"],l=["top"];function c(t){return"plot"+t.charAt(0).toUpperCase()+t.slice(1)}function h(t,e){var o=[];return(t.pointArrayMap||[]).forEach(function(t){t!==e&&o.push(c(t))}),o}function u(){var t,e=this,o=e.pointValKey,s=e.linesApiNames,p=e.areaLinesNames,l=e.points,u=e.options,f=e.graph,d={options:{gapSize:u.gapSize}},y=[],m=h(e,o),g=l.length;if(m.forEach(function(e,o){for(y[o]=[];g--;)t=l[g],y[o].push({x:t.x,plotX:t.plotX,plotY:t[e],isNull:!a(t[e])});g=l.length}),e.userOptions.fillColor&&p.length){var v=y[m.indexOf(c(p[0]))],x=1===p.length?l:y[m.indexOf(c(p[1]))],A=e.color;e.points=x,e.nextPoints=v,e.color=e.userOptions.fillColor,e.options=r(l,d),e.graph=e.area,e.fillGraph=!0,i.drawGraph.call(e),e.area=e.graph,delete e.nextPoints,delete e.fillGraph,e.color=A}s.forEach(function(t,o){y[o]?(e.points=y[o],u[t]?e.options=r(u[t].styles,d):n('Error: "There is no '+t+' in DOCS options declared. Check if linesApiNames are consistent with your DOCS line names."'),e.graph=e["graph"+t],i.drawGraph.call(e),e["graph"+t]=e.graph):n('Error: "'+t+" doesn't have equivalent in pointArrayMap. To many elements in linesApiNames relative to pointArrayMap.\"")}),e.points=l,e.options=u,e.graph=f,i.drawGraph.call(e)}function f(t){var e,o=[],a=[];if(t=t||this.points,this.fillGraph&&this.nextPoints){if((e=i.getGraphPath.call(this,this.nextPoints))&&e.length){e[0][0]="L",o=i.getGraphPath.call(this,t),a=e.slice(0,o.length);for(var n=a.length-1;n>=0;n--)o.push(a[n])}}else o=i.getGraphPath.apply(this,arguments);return o}function d(t){var e=[];return(this.pointArrayMap||[]).forEach(function(o){e.push(t[o])}),e}function y(){var t,e=this,o=this.pointArrayMap,a=[];a=h(this),i.translate.apply(this,arguments),this.points.forEach(function(i){o.forEach(function(o,n){t=i[o],e.dataModify&&(t=e.dataModify.modifyValue(t)),null!==t&&(i[a[n]]=e.yAxis.toPixels(t,!0))})})}t.compose=function(t){if(e.pushUnique(o,t)){var i=t.prototype;i.linesApiNames=i.linesApiNames||s.slice(),i.pointArrayMap=i.pointArrayMap||p.slice(),i.pointValKey=i.pointValKey||"top",i.areaLinesNames=i.areaLinesNames||l.slice(),i.drawGraph=u,i.getGraphPath=f,i.toYData=d,i.translate=y}return t}}(o||(o={})),o}),o(e,"Stock/Indicators/ABands/ABandsIndicator.js",[e["Stock/Indicators/MultipleLinesComposition.js"],e["Core/Series/SeriesRegistry.js"],e["Core/Utilities.js"]],function(t,e,o){var i,a=this&&this.__extends||(i=function(t,e){return(i=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}),n=e.seriesTypes.sma,r=o.correctFloat,s=o.extend,p=o.merge,l=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.data=void 0,e.options=void 0,e.points=void 0,e}return a(e,t),e.prototype.getValues=function(e,o){var i,a,n,s,p,l,c,h,u,f,d,y,m,g=o.period,v=o.factor,x=o.index,A=e.xData,D=e.yData,C=D?D.length:0,O=[],b=[],L=[],M=[],S=[];if(!(C=g&&(d=A.slice(m-g,m),y=D.slice(m-g,m),u=t.prototype.getValues.call(this,{xData:d,yData:O.slice(m-g,m)},{period:g}),f=t.prototype.getValues.call(this,{xData:d,yData:b.slice(m-g,m)},{period:g}),l=(h=t.prototype.getValues.call(this,{xData:d,yData:y},{period:g,index:x})).xData[0],s=u.yData[0],p=f.yData[0],n=h.yData[0],L.push([l,s,n,p]),M.push(l),S.push([s,n,p]));return{values:L,xData:M,yData:S}}},e.defaultOptions=p(n.defaultOptions,{params:{period:20,factor:.001,index:3},lineWidth:1,topLine:{styles:{lineWidth:1}},bottomLine:{styles:{lineWidth:1}},dataGrouping:{approximation:"averages"}}),e}(n);return s(l.prototype,{areaLinesNames:["top","bottom"],linesApiNames:["topLine","bottomLine"],nameBase:"Acceleration Bands",nameComponents:["period","factor"],pointArrayMap:["top","middle","bottom"],pointValKey:"middle"}),t.compose(l),e.registerSeriesType("abands",l),l}),o(e,"masters/indicators/acceleration-bands.src.js",[],function(){})});//# sourceMappingURL=acceleration-bands.js.map