!/**
 * Highstock JS v12.6.0 (2026-04-13)
 * @module highcharts/indicators/macd
 * @requires highcharts
 * @requires highcharts/modules/stock
 *
 * Indicator series type for Highcharts Stock
 *
 * (c) 2010-2026 Highsoft AS
 * Author: Sebastian Bochan
 *
 * A commercial license may be required depending on use.
 * See www.highcharts.com/license
 */function(o,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(o._Highcharts,o._Highcharts.SeriesRegistry):"function"==typeof define&&define.amd?define("highcharts/indicators/macd",["highcharts/highcharts"],function(o){return t(o,o.SeriesRegistry)}):"object"==typeof exports?exports["highcharts/indicators/macd"]=t(o._Highcharts,o._Highcharts.SeriesRegistry):o.Highcharts=t(o.Highcharts,o.Highcharts.SeriesRegistry)}("u"<typeof window?this:window,function(o,t){return function(){"use strict";var e,n={512:function(o){o.exports=t},944:function(t){t.exports=o}},i={};function r(o){var t=i[o];if(void 0!==t)return t.exports;var e=i[o]={exports:{}};return n[o](e,e.exports,r),e.exports}r.n=function(o){var t=o&&o.__esModule?function(){return o.default}:function(){return o};return r.d(t,{a:t}),t},r.d=function(o,t){for(var e in t)r.o(t,e)&&!r.o(o,e)&&Object.defineProperty(o,e,{enumerable:!0,get:t[e]})},r.o=function(o,t){return Object.prototype.hasOwnProperty.call(o,t)};var s={};r.d(s,{default:function(){return b}});var a=r(944),l=r.n(a),p=r(512),c=r.n(p),h=function(o,t,e){if(e||2==arguments.length)for(var n,i=0,r=t.length;i<r;i++)!n&&i in t||(n||(n=Array.prototype.slice.call(t,0,i)),n[i]=t[i]);return o.concat(n||Array.prototype.slice.call(t))};function u(o,t){return o>1e14?o:parseFloat(o.toPrecision(t||14))}function d(o){return null!=o}function y(o){return g(o)&&"number"==typeof o.nodeType}function g(o,t){var e;return!!o&&"object"==typeof o&&(!t||"[object Array]"!==(e=Object.prototype.toString.call(o))&&"[object Array Iterator]"!==e)}function f(o){for(var t=[],e=1;e<arguments.length;e++)t[e-1]=arguments[e];var n,i=h([o],t,!0),r={},s=function(o,t){return"object"!=typeof o&&(o={}),function(o,t,e){for(var n in o)Object.hasOwnProperty.call(o,n)&&t.call((0,o[n]),o[n],n,o)}(t,function(e,n){if("__proto__"!==n&&"constructor"!==n){var i;!g(e,!0)||(i=null==e?void 0:e.constructor,g(e,!0)&&!y(e)&&(null==i?void 0:i.name)&&"Object"!==i.name)||y(e)?o[n]=t[n]:o[n]=s(o[n]||{},e)}}),o};!0===o&&(r=i[1],i=Array.prototype.slice.call(i,2));var a=i.length;for(n=0;n<a;n++)r=s(r,i[n]);return r}l().doc,l().win,Array.prototype.find;var m=(e=function(o,t){return(e=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(o,t){o.__proto__=t}||function(o,t){for(var e in t)t.hasOwnProperty(e)&&(o[e]=t[e])})(o,t)},function(o,t){function n(){this.constructor=o}e(o,t),o.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),v=l().noop,x=c().seriesTypes.sma,P=function(o){function t(){return null!==o&&o.apply(this,arguments)||this}return m(t,o),t.prototype.init=function(){c().seriesTypes.sma.prototype.init.apply(this,arguments);var o,t,e,n,i,r=this.color,s=this.colorIndex;this.options&&(d(this.colorIndex)&&((null==(o=this.options.signalLine)?void 0:o.styles)&&!this.options.signalLine.styles.lineColor&&(this.options.colorIndex=this.colorIndex+1,this.getCyclic("color",void 0,this.chart.options.colors),this.options.signalLine.styles.lineColor=this.color),(null==(t=this.options.macdLine)?void 0:t.styles)&&!this.options.macdLine.styles.lineColor&&(this.options.colorIndex=this.colorIndex+1,this.getCyclic("color",void 0,this.chart.options.colors),this.options.macdLine.styles.lineColor=this.color)),this.macdZones={zones:null==(e=this.options.macdLine)?void 0:e.zones,startIndex:0},this.signalZones={zones:null==(n=this.macdZones.zones)?void 0:n.concat(this.options.signalLine.zones),startIndex:null==(i=this.macdZones.zones)?void 0:i.length}),this.color=r,this.colorIndex=s},t.prototype.toYData=function(o){return[o.y,o.signal,o.MACD]},t.prototype.translate=function(){var o=this,t=["plotSignal","plotMACD"];l().seriesTypes.column.prototype.translate.apply(o),o.points.forEach(function(e){[e.signal,e.MACD].forEach(function(n,i){null!==n&&(e[t[i]]=o.yAxis.toPixels(n,!0))})})},t.prototype.destroy=function(){this.graph=null,this.graphmacd=this.graphmacd&&this.graphmacd.destroy(),this.graphsignal=this.graphsignal&&this.graphsignal.destroy(),c().seriesTypes.sma.prototype.destroy.apply(this,arguments)},t.prototype.drawGraph=function(){for(var o,t=this,e=t.points,n=t.options,i=t.zones,r={options:{gapSize:n.gapSize}},s=[[],[]],a=e.length;a--;)d((o=e[a]).plotMACD)&&s[0].push({plotX:o.plotX,plotY:o.plotMACD,isNull:!d(o.plotMACD)}),d(o.plotSignal)&&s[1].push({plotX:o.plotX,plotY:o.plotSignal,isNull:!d(o.plotMACD)});["macd","signal"].forEach(function(o,e){var i;t.points=s[e],t.options=f((null==(i=n[""+o+"Line"])?void 0:i.styles)||{},r),t.graph=t["graph".concat(o)],t.zones=(t[""+o+"Zones"].zones||[]).slice(t[""+o+"Zones"].startIndex||0),c().seriesTypes.sma.prototype.drawGraph.call(t),t["graph".concat(o)]=t.graph}),t.points=e,t.options=n,t.zones=i},t.prototype.applyZones=function(){var o=this.zones;this.zones=this.signalZones.zones,c().seriesTypes.sma.prototype.applyZones.call(this),this.graphmacd&&this.options.macdLine.zones.length&&this.graphmacd.hide(),this.zones=o},t.prototype.getValues=function(o,t){var e,n,i,r=t.longPeriod-t.shortPeriod,s=[],a=[],l=[],p=0,h=[];if(!(o.xData.length<t.longPeriod+t.signalPeriod)){for(i=0,e=c().seriesTypes.ema.prototype.getValues(o,{period:t.shortPeriod,index:t.index}),n=c().seriesTypes.ema.prototype.getValues(o,{period:t.longPeriod,index:t.index}),e=e.values,n=n.values;i<=e.length;i++)d(n[i])&&d(n[i][1])&&d(e[i+r])&&d(e[i+r][0])&&s.push([e[i+r][0],0,null,e[i+r][1]-n[i][1]]);for(i=0;i<s.length;i++)a.push(s[i][0]),l.push([0,null,s[i][3]]);for(i=0,h=(h=c().seriesTypes.ema.prototype.getValues({xData:a,yData:l},{period:t.signalPeriod,index:2})).values;i<s.length;i++)s[i][0]>=h[0][0]&&(s[i][2]=h[p][1],l[i]=[0,h[p][1],s[i][3]],null===s[i][3]?(s[i][1]=0,l[i][0]=0):(s[i][1]=u(s[i][3]-h[p][1]),l[i][0]=u(s[i][3]-h[p][1])),p++);return{values:s,xData:a,yData:l}}},t.defaultOptions=f(x.defaultOptions,{params:{shortPeriod:12,longPeriod:26,signalPeriod:9,period:26},signalLine:{zones:[],styles:{lineWidth:1,lineColor:void 0}},macdLine:{zones:[],styles:{lineWidth:1,lineColor:void 0}},threshold:0,groupPadding:.1,pointPadding:.1,crisp:!1,states:{hover:{halo:{size:0}}},tooltip:{pointFormat:'<span style="color:{point.color}">●</span> <b> {series.name}</b><br/>Value: {point.MACD}<br/>Signal: {point.signal}<br/>Histogram: {point.y}<br/>'},dataGrouping:{approximation:"averages"},minPointLength:0}),t}(x);!function(o,t){var e;for(e in o||(o={}),t)o[e]=t[e]}(P.prototype,{nameComponents:["longPeriod","shortPeriod","signalPeriod"],pointArrayMap:["y","signal","MACD"],parallelArrays:["x","y","signal","MACD"],pointValKey:"y",markerAttribs:v,getColumnMetrics:l().seriesTypes.column.prototype.getColumnMetrics,crispCol:l().seriesTypes.column.prototype.crispCol,drawPoints:l().seriesTypes.column.prototype.drawPoints}),c().registerSeriesType("macd",P);var b=l();return s.default}()});