/* Highstock JS v9.1.1 (2021-06-03) Indicator series type for Highcharts Stock (c) 2010-2021 Wojciech Chmiel License: www.highcharts.com/license */ 'use strict';(function(a){"object"===typeof module&&module.exports?(a["default"]=a,module.exports=a):"function"===typeof define&&define.amd?define("highcharts/indicators/supertrend",["highcharts","highcharts/modules/stock"],function(g){a(g);a.Highcharts=g;return a}):a("undefined"!==typeof Highcharts?Highcharts:void 0)})(function(a){function g(a,g,n,t){a.hasOwnProperty(g)||(a[g]=t.apply(null,n))}a=a?a._modules:{};g(a,"Stock/Indicators/Supertrend/SupertrendIndicator.js",[a["Core/Color/Palette.js"], a["Core/Series/SeriesRegistry.js"],a["Core/Utilities.js"]],function(a,g,n){function t(a,e,c){return{index:e,close:a.yData[e][c],x:a.xData[e]}}var B=this&&this.__extends||function(){var a=function(e,c){a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(c,a){c.__proto__=a}||function(c,a){for(var d in a)a.hasOwnProperty(d)&&(c[d]=a[d])};return a(e,c)};return function(e,c){function d(){this.constructor=e}a(e,c);e.prototype=null===c?Object.create(c):(d.prototype=c.prototype,new d)}}(),y= g.seriesTypes,C=y.atr,z=y.sma,A=n.correctFloat,D=n.isArray;y=n.extend;var x=n.merge,E=n.objectEach;n=function(g){function e(){var c=null!==g&&g.apply(this,arguments)||this;c.data=void 0;c.linkedParent=void 0;c.options=void 0;c.points=void 0;return c}B(e,g);e.prototype.init=function(){z.prototype.init.apply(this,arguments);var c=this.options;c.cropThreshold=this.linkedParent.options.cropThreshold-(c.params.period-1)};e.prototype.drawGraph=function(){var c=this,d=c.options,a=c.linkedParent,e=a?a.points: [],g=c.points,n=c.graph,u=g.length,v=e.length-u;v=0=f.close&&l.y>=h.close?(b.color=q||d.fallingTrendColor||d.color,m.top.push(r)):b.y=f.close&&l.y=h.close&&(b.color=q||d.risingTrendColor||d.color,l.color=q||d.fallingTrendColor||d.color,m.bottom.push(r),m.bottom.push(x(k,{isNull:!0}))))):f&&(b.y>=f.close?(b.color=q||d.fallingTrendColor||d.color,m.top.push(r)): (b.color=q||d.risingTrendColor||d.color,m.bottom.push(r)));E(m,function(a,b){c.points=a;c.options=x(w[b].styles,F);c.graph=c["graph"+b+"Line"];z.prototype.drawGraph.call(c);c["graph"+b+"Line"]=c.graph});c.points=g;c.options=d;c.graph=n};e.prototype.getValues=function(a,d){var c=d.period;d=d.multiplier;var e=a.xData,g=a.yData,n=[],u=[],v=[],t=0===c?0:c-1,m=[],w=[],b;if(!(e.length<=c||!D(g[0])||4!==g[0].length||0>c)){a=C.prototype.getValues.call(this,a,{period:c}).yData;for(b=0;bh?c:h;w[b]=q>k||f[3]m[b]||p===k&&l[3]>w[b])r=w[b];n.push([e[t+b],r]);u.push(e[t+b]);v.push(r)}return{values:n,xData:u,yData:v}}};e.defaultOptions=x(z.defaultOptions,{params:{index:void 0,multiplier:3,period:10},risingTrendColor:a.positiveColor,fallingTrendColor:a.negativeColor, changeTrendLine:{styles:{lineWidth:1,lineColor:a.neutralColor80,dashStyle:"LongDash"}}});return e}(z);y(n.prototype,{nameBase:"Supertrend",nameComponents:["multiplier","period"],requiredIndicators:["atr"]});g.registerSeriesType("supertrend",n);"";return n});g(a,"masters/indicators/supertrend.src.js",[],function(){})}); //# sourceMappingURL=supertrend.js.map