/*
 Highstock JS v10.3.3 (2023-01-20)

 HeikinAshi series type for Highcharts Stock

 (c) 2010-2021 Karol Kolodziej

 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/modules/heikinashi",["highcharts","highcharts/modules/stock"],function(b){a(b);a.Highcharts=b;return a}):a("undefined"!==typeof Highcharts?Highcharts:void 0)})(function(a){function b(a,e,b,c){a.hasOwnProperty(e)||(a[e]=c.apply(null,b),"function"===typeof CustomEvent&&window.dispatchEvent(new CustomEvent("HighchartsModuleLoaded",{detail:{path:e,module:a[e]}})))}
a=a?a._modules:{};b(a,"Series/HeikinAshi/HeikinAshiPoint.js",[a["Core/Series/SeriesRegistry.js"]],function(a){var e=this&&this.__extends||function(){var a=function(c,b){a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,c){a.__proto__=c}||function(a,c){for(var b in c)c.hasOwnProperty(b)&&(a[b]=c[b])};return a(c,b)};return function(c,b){function e(){this.constructor=c}a(c,b);c.prototype=null===b?Object.create(b):(e.prototype=b.prototype,new e)}}();a=a.seriesTypes;var b=a.hlc.prototype.pointClass;
return function(a){function c(){var c=null!==a&&a.apply(this,arguments)||this;c.resolveColor=b.prototype.resolveColor;return c}e(c,a);return c}(a.candlestick.prototype.pointClass)});b(a,"Series/HeikinAshi/HeikinAshiSeriesDefaults.js",[],function(){"";return{dataGrouping:{groupAll:!0}}});b(a,"Series/HeikinAshi/HeikinAshiSeries.js",[a["Series/HeikinAshi/HeikinAshiPoint.js"],a["Series/HeikinAshi/HeikinAshiSeriesDefaults.js"],a["Core/Series/SeriesRegistry.js"],a["Core/Utilities.js"]],function(a,b,m,c){function e(){this.series.forEach(function(a){a.is("heikinashi")&&
(a.heikiashiData.length=0,a.getHeikinashiData())})}function n(){for(var a=this.points,c=this.heikiashiData,d=this.cropStart||0,g=this.processedYData.length=0;g<a.length;g++){var f=a[g],b=c[g+d];f.open=b[0];f.high=b[1];f.low=b[2];f.close=b[3];this.processedYData.push([f.open,f.high,f.low,f.close])}}function p(){this.heikiashiData.length&&(this.heikiashiData.length=0)}var q=this&&this.__extends||function(){var a=function(b,d){a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,d){a.__proto__=
d}||function(a,d){for(var b in d)d.hasOwnProperty(b)&&(a[b]=d[b])};return a(b,d)};return function(b,d){function c(){this.constructor=b}a(b,d);b.prototype=null===d?Object.create(d):(c.prototype=d.prototype,new c)}}(),k=m.seriesTypes.candlestick,l=c.addEvent,r=c.merge,h=[];c=function(a){function c(){var d=null!==a&&a.apply(this,arguments)||this;d.data=void 0;d.heikiashiData=[];d.options=void 0;d.points=void 0;d.yData=void 0;d.processedYData=void 0;return d}q(c,a);c.compose=function(a,b){for(var d=2;d<
arguments.length;d++);k.compose(a);-1===h.indexOf(b)&&(h.push(b),l(b,"postProcessData",e));-1===h.indexOf(c)&&(h.push(c),l(c,"afterTranslate",n),l(c,"updatedData",p))};c.prototype.getHeikinashiData=function(){var a=this.allGroupedData||this.yData,c=this.heikiashiData;if(!c.length&&a&&a.length){this.modifyFirstPointValue(a[0]);for(var b=1;b<a.length;b++)this.modifyDataPoint(a[b],c[b-1])}this.heikiashiData=c};c.prototype.init=function(){a.prototype.init.apply(this,arguments);this.heikiashiData=[]};
c.prototype.modifyFirstPointValue=function(a){this.heikiashiData.push([(a[0]+a[1]+a[2]+a[3])/4,a[1],a[2],(a[0]+a[3])/2])};c.prototype.modifyDataPoint=function(a,b){b=(b[0]+b[3])/2;var c=(a[0]+a[1]+a[2]+a[3])/4;this.heikiashiData.push([b,Math.max(a[1],c,b),Math.min(a[2],c,b),c])};c.defaultOptions=r(k.defaultOptions,b);return c}(k);c.prototype.pointClass=a;m.registerSeriesType("heikinashi",c);return c});b(a,"masters/modules/heikinashi.src.js",[a["Core/Globals.js"],a["Series/HeikinAshi/HeikinAshiSeries.js"]],
function(a,b){b.compose(a.Series,a.Axis)})});
//# sourceMappingURL=heikinashi.js.map