!/**
 * Highcharts Stock JS v13.0.0 (2026-06-11)
 * @module highcharts/indicators/klinger
 * @requires highcharts
 * @requires highcharts/modules/stock
 *
 * Indicator series type for Highcharts Stock
 *
 * (c) 2010-2026 Highsoft AS
 * Author: Karol Kołodziej
 *
 * A commercial license may be required depending on use,
 * see www.highcharts.com/license
 */function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(t._Highcharts,t._Highcharts.SeriesRegistry):"function"==typeof define&&define.amd?define("highcharts/indicators/klinger",["highcharts/highcharts"],function(t){return e(t,t.SeriesRegistry)}):"object"==typeof exports?exports["highcharts/indicators/klinger"]=e(t._Highcharts,t._Highcharts.SeriesRegistry):t.Highcharts=e(t.Highcharts,t.Highcharts.SeriesRegistry)}("u"<typeof window?this:window,function(t,e){return function(){"use strict";var r,o,i={512:function(t){t.exports=e},944:function(e){e.exports=t}},n={};function a(t){var e=n[t];if(void 0!==e)return e.exports;var r=n[t]={exports:{}};return i[t](r,r.exports,a),r.exports}a.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return a.d(e,{a:e}),e},a.d=function(t,e){for(var r in e)a.o(e,r)&&!a.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},a.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)};var s={};a.d(s,{default:function(){return A}});var p=a(944),l=a.n(p),u=a(512),c=a.n(u),h=c().seriesTypes.sma.prototype;!function(t){var e=["bottomLine"],r=["top","bottom"],o=["top"];function i(t){return"plot"+t.charAt(0).toUpperCase()+t.slice(1)}function n(t,e){var r=[];return(t.pointArrayMap||[]).forEach(function(t){t!==e&&r.push(i(t))}),r}function a(){var t,e=this,r=e.pointValKey,o=e.linesApiNames,a=e.areaLinesNames,s=e.points,l=e.options,u=e.graph,c={options:{gapSize:l.gapSize}},f=[],g=n(e,r),y=s.length;if(g.forEach(function(e,r){for(f[r]=[];y--;)t=s[y],f[r].push({x:t.x,plotX:t.plotX,plotY:t[e],isNull:!(0,p.defined)(t[e])});y=s.length}),e.userOptions.fillColor&&a.length){var d=f[g.indexOf(i(a[0]))],v=1===a.length?s:f[g.indexOf(i(a[1]))],m=e.color;e.points=v,e.nextPoints=d,e.color=e.userOptions.fillColor,e.options=(0,p.merge)(s,c),e.graph=e.area,e.fillGraph=!0,h.drawGraph.call(e),e.area=e.graph,delete e.nextPoints,delete e.fillGraph,e.color=m}o.forEach(function(t,r){f[r]?(e.points=f[r],l[t]?e.options=(0,p.merge)(l[t].styles,c):(0,p.error)('Error: "There is no '+t+' in DOCS options declared. Check if linesApiNames are consistent with your DOCS line names."'),e.graph=e["graph"+t],h.drawGraph.call(e),e["graph"+t]=e.graph):(0,p.error)('Error: "'+t+" doesn't have equivalent in pointArrayMap. To many elements in linesApiNames relative to pointArrayMap.\"")}),e.points=s,e.options=l,e.graph=u,h.drawGraph.call(e)}function s(t){var e,r=[],o=[];if(t=t||this.points,this.fillGraph&&this.nextPoints){if((e=h.getGraphPath.call(this,this.nextPoints))&&e.length){e[0][0]="L",r=h.getGraphPath.call(this,t),o=e.slice(0,r.length);for(var i=o.length-1;i>=0;i--)r.push(o[i])}}else r=h.getGraphPath.apply(this,arguments);return r}function l(t){var e=[];return(this.pointArrayMap||[]).forEach(function(r){e.push(t[r])}),e}function u(){var t,e=this,r=this.pointArrayMap,o=[];o=n(this),h.translate.apply(this,arguments),this.points.forEach(function(i){r.forEach(function(r,n){t=i[r],e.dataModify&&(t=e.dataModify.modifyValue(t)),null!==t&&(i[o[n]]=e.yAxis.toPixels(t,!0))})})}t.compose=function(t){var i=t.prototype;return i.linesApiNames=i.linesApiNames||e.slice(),i.pointArrayMap=i.pointArrayMap||r.slice(),i.pointValKey=i.pointValKey||"top",i.areaLinesNames=i.areaLinesNames||o.slice(),i.drawGraph=a,i.getGraphPath=s,i.toYData=l,i.translate=u,t}}(o||(o={}));var f=o,g=(r=function(t,e){return(r=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)},function(t,e){function o(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}),y=c().seriesTypes,d=y.ema,v=y.sma,m=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return g(e,t),e.prototype.calculateTrend=function(t,e){return t[e][1]+t[e][2]+t[e][3]>t[e-1][1]+t[e-1][2]+t[e-1][3]?1:-1},e.prototype.isValidData=function(t){var e=this.chart,r=this.options,o=this.linkedParent,i=(0,p.isArray)(t)&&4===t.length,n=this.volumeSeries||(this.volumeSeries=e.get(r.params.volumeSeriesID));return n||(0,p.error)("Series "+r.params.volumeSeriesID+" not found! Check `volumeSeriesID`.",!0,o.chart),!!([o,n].every(function(t){return t&&t.dataTable.rowCount>=r.params.slowAvgPeriod})&&i)},e.prototype.getCM=function(t,e,r,o,i){return(0,p.correctFloat)(e+(r===o?t:i))},e.prototype.getDM=function(t,e){return(0,p.correctFloat)(t-e)},e.prototype.getVolumeForce=function(t){for(var e,r,o=[],i=0,n=1,a=0,s=t[0][1]-t[0][2],p=0;n<t.length;n++)r=this.calculateTrend(t,n),e=this.getDM(t[n][1],t[n][2]),i=this.getCM(a,e,r,p,s),o.push([this.volumeSeries.getColumn("y")[n]*r*Math.abs(2*(e/i-1))*100]),p=r,a=i,s=e;return o},e.prototype.getEMA=function(t,e,r,o,i,n,a){return d.prototype.calculateEma(a||[],t,void 0===n?1:n,o,e,void 0===i?-1:i,r)},e.prototype.getSMA=function(t,e,r){return d.prototype.accumulatePeriodPoints(t,e,r)/t},e.prototype.getValues=function(t,e){var r,o,i=[],n=t.xData,a=t.yData,s=[],l=[],u=[],c=0,h=0,f=void 0,g=void 0,y=null;if(this.isValidData(a[0])){for(var d=this.getVolumeForce(a),v=this.getSMA(e.fastAvgPeriod,0,d),m=this.getSMA(e.slowAvgPeriod,0,d),A=2/(e.fastAvgPeriod+1),P=2/(e.slowAvgPeriod+1);c<a.length;c++)c>=e.fastAvgPeriod&&(f=h=this.getEMA(d,f,v,A,0,c,n)[1]),c>=e.slowAvgPeriod&&(g=o=this.getEMA(d,g,m,P,0,c,n)[1],r=(0,p.correctFloat)(h-o),u.push(r),u.length>=e.signalPeriod&&(y=u.slice(-e.signalPeriod).reduce(function(t,e){return t+e})/e.signalPeriod),i.push([n[c],r,y]),s.push(n[c]),l.push([r,y]));return{values:i,xData:s,yData:l}}},e.defaultOptions=(0,p.merge)(v.defaultOptions,{params:{fastAvgPeriod:34,slowAvgPeriod:55,signalPeriod:13,volumeSeriesID:"volume"},signalLine:{styles:{lineWidth:1,lineColor:"#ff0000"}},dataGrouping:{approximation:"averages"},tooltip:{pointFormat:'<span style="color: {point.color}">●</span><b> {series.name}</b><br/><span style="color: {point.color}">Klinger</span>: {point.y}<br/><span style="color: {point.series.options.signalLine.styles.lineColor}">Signal</span>: {point.signal}<br/>'}}),e}(v);(0,p.extend)(m.prototype,{areaLinesNames:[],linesApiNames:["signalLine"],nameBase:"Klinger",nameComponents:["fastAvgPeriod","slowAvgPeriod"],pointArrayMap:["y","signal"],parallelArrays:["x","y","signal"],pointValKey:"y"}),f.compose(m),c().registerSeriesType("klinger",m);var A=l();return s.default}()});