!/**
 * Highstock JS v13.0.0 (2026-06-11)
 * @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,i={512:function(o){o.exports=t},944:function(t){t.exports=o}},n={};function s(o){var t=n[o];if(void 0!==t)return t.exports;var e=n[o]={exports:{}};return i[o](e,e.exports,s),e.exports}s.n=function(o){var t=o&&o.__esModule?function(){return o.default}:function(){return o};return s.d(t,{a:t}),t},s.d=function(o,t){for(var e in t)s.o(t,e)&&!s.o(o,e)&&Object.defineProperty(o,e,{enumerable:!0,get:t[e]})},s.o=function(o,t){return Object.prototype.hasOwnProperty.call(o,t)};var r={};s.d(r,{default:function(){return y}});var a=s(944),p=s.n(a),l=s(512),c=s.n(l),h=(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 i(){this.constructor=o}e(o,t),o.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}),d=p().noop,u=c().seriesTypes.sma,g=function(o){function t(){return null!==o&&o.apply(this,arguments)||this}return h(t,o),t.prototype.init=function(){c().seriesTypes.sma.prototype.init.apply(this,arguments);var o,t,e,i,n,s=this.color,r=this.colorIndex;this.options&&((0,a.defined)(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==(i=this.macdZones.zones)?void 0:i.concat(this.options.signalLine.zones),startIndex:null==(n=this.macdZones.zones)?void 0:n.length}),this.color=s,this.colorIndex=r},t.prototype.toYData=function(o){return[o.y,o.signal,o.MACD]},t.prototype.translate=function(){var o=this,t=["plotSignal","plotMACD"];p().seriesTypes.column.prototype.translate.apply(o),o.points.forEach(function(e){[e.signal,e.MACD].forEach(function(i,n){null!==i&&(e[t[n]]=o.yAxis.toPixels(i,!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,i=t.options,n=t.zones,s={options:{gapSize:i.gapSize}},r=[[],[]],p=e.length;p--;)o=e[p],(0,a.defined)(o.plotMACD)&&r[0].push({plotX:o.plotX,plotY:o.plotMACD,isNull:!(0,a.defined)(o.plotMACD)}),(0,a.defined)(o.plotSignal)&&r[1].push({plotX:o.plotX,plotY:o.plotSignal,isNull:!(0,a.defined)(o.plotMACD)});["macd","signal"].forEach(function(o,e){var n;t.points=r[e],t.options=(0,a.merge)((null==(n=i[""+o+"Line"])?void 0:n.styles)||{},s),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=i,t.zones=n},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,i,n,s=t.longPeriod-t.shortPeriod,r=[],p=[],l=[],h=0,d=[];if(!(o.xData.length<t.longPeriod+t.signalPeriod)){for(n=0,e=c().seriesTypes.ema.prototype.getValues(o,{period:t.shortPeriod,index:t.index}),i=c().seriesTypes.ema.prototype.getValues(o,{period:t.longPeriod,index:t.index}),e=e.values,i=i.values;n<=e.length;n++)(0,a.defined)(i[n])&&(0,a.defined)(i[n][1])&&(0,a.defined)(e[n+s])&&(0,a.defined)(e[n+s][0])&&r.push([e[n+s][0],0,null,e[n+s][1]-i[n][1]]);for(n=0;n<r.length;n++)p.push(r[n][0]),l.push([0,null,r[n][3]]);for(n=0,d=(d=c().seriesTypes.ema.prototype.getValues({xData:p,yData:l},{period:t.signalPeriod,index:2})).values;n<r.length;n++)r[n][0]>=d[0][0]&&(r[n][2]=d[h][1],l[n]=[0,d[h][1],r[n][3]],null===r[n][3]?(r[n][1]=0,l[n][0]=0):(r[n][1]=(0,a.correctFloat)(r[n][3]-d[h][1]),l[n][0]=(0,a.correctFloat)(r[n][3]-d[h][1])),h++);return{values:r,xData:p,yData:l}}},t.defaultOptions=(0,a.merge)(u.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}(u);(0,a.extend)(g.prototype,{nameComponents:["longPeriod","shortPeriod","signalPeriod"],pointArrayMap:["y","signal","MACD"],parallelArrays:["x","y","signal","MACD"],pointValKey:"y",markerAttribs:d,getColumnMetrics:p().seriesTypes.column.prototype.getColumnMetrics,crispCol:p().seriesTypes.column.prototype.crispCol,drawPoints:p().seriesTypes.column.prototype.drawPoints}),c().registerSeriesType("macd",g);var y=p();return r.default}()});