highcharts
Version:
JavaScript charting framework
14 lines • 69.6 kB
JavaScript
!/**
* Highstock JS v12.6.0 (2026-04-13)
* @module highcharts/indicators/indicators-all
* @requires highcharts
* @requires highcharts/modules/stock
*
* All technical indicators for Highcharts Stock
*
* (c) 2010-2026 Highsoft AS
* Author: Paweł Fus
*
* A commercial license may be required depending on use.
* See www.highcharts.com/license
*/function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(e._Highcharts,e._Highcharts.Chart,e._Highcharts.SeriesRegistry,e._Highcharts.dataGrouping.approximations,e._Highcharts.Color):"function"==typeof define&&define.amd?define("highcharts/indicators/indicators-all",["highcharts/highcharts"],function(e){return t(e,e.Chart,e.SeriesRegistry,e.dataGrouping,["approximations"],e.Color)}):"object"==typeof exports?exports["highcharts/indicators/indicators-all"]=t(e._Highcharts,e._Highcharts.Chart,e._Highcharts.SeriesRegistry,e._Highcharts.dataGrouping.approximations,e._Highcharts.Color):e.Highcharts=t(e.Highcharts,e.Highcharts.Chart,e.Highcharts.SeriesRegistry,e.Highcharts.dataGrouping.approximations,e.Highcharts.Color)}("u"<typeof window?this:window,(e,t,s,a,o)=>(()=>{"use strict";var i,n={512:e=>{e.exports=s},620:e=>{e.exports=o},944:t=>{t.exports=e},956:e=>{e.exports=a},960:e=>{e.exports=t}},r={};function l(e){var t=r[e];if(void 0!==t)return t.exports;var s=r[e]={exports:{}};return n[e](s,s.exports,l),s.exports}l.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return l.d(t,{a:t}),t},l.d=(e,t)=>{for(var s in t)l.o(t,s)&&!l.o(e,s)&&Object.defineProperty(e,s,{enumerable:!0,get:t[s]})},l.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var p={};l.d(p,{default:()=>tK});var u=l(944),h=l.n(u),d=l(960),c=l.n(d),g=l(512),m=l.n(g);let{doc:y,win:f}=h();function x(e,t,s,a={}){let o="function"==typeof e&&e.prototype||e;Object.hasOwnProperty.call(o,"hcEvents")||(o.hcEvents={});let i=o.hcEvents;h().Point&&e instanceof h().Point&&e.series&&e.series.chart&&(e.series.chart.runTrackerClick=!0);let n=e.addEventListener;n&&n.call(e,t,s,!!h().supportsPassiveEvents&&{passive:void 0===a.passive?-1!==t.indexOf("touch"):a.passive,capture:!1}),i[t]||(i[t]=[]);let r={fn:s,order:"number"==typeof a.order?a.order:1/0};return i[t].push(r),i[t].sort((e,t)=>e.order-t.order),function(){!function(e,t,s){function a(t,s){let a=e.removeEventListener;a&&a.call(e,t,s,!1)}function o(s){let o,i;e.nodeName&&(t?(o={})[t]=!0:o=s,O(o,function(e,t){if(s[t])for(i=s[t].length;i--;)a(t,s[t][i].fn)}))}let i="function"==typeof e&&e.prototype||e;if(Object.hasOwnProperty.call(i,"hcEvents")){let e=i.hcEvents;if(t){let i=e[t]||[];s?(e[t]=i.filter(function(e){return s!==e.fn}),a(t,s)):(o(e),e[t]=[])}else o(e),delete i.hcEvents}}(e,t,s)}}function v(e){let t=e.length,s=e[0];for(;t--;)e[t]>s&&(s=e[t]);return s}function D(e,t){return e>1e14?e:parseFloat(e.toPrecision(t||14))}function S(e){return null!=e}function b(e,t){let s;for(s in e||(e={}),t)e[s]=t[s];return e}function C(e){return P(e)&&"number"==typeof e.nodeType}function T(e){return"number"==typeof e&&!isNaN(e)&&e<1/0&&e>-1/0}function A(e){let t=Object.prototype.toString.call(e);return"[object Array]"===t||"[object Array Iterator]"===t}function P(e,t){return!!e&&"object"==typeof e&&(!t||!A(e))}function M(e,...t){let s,a=[e,...t],o={},i=function(e,t){return"object"!=typeof e&&(e={}),O(t,function(s,a){if("__proto__"!==a&&"constructor"!==a){let o;!P(s,!0)||(o=s?.constructor,P(s,!0)&&!C(s)&&o?.name&&"Object"!==o.name)||C(s)?e[a]=t[a]:e[a]=i(e[a]||{},s)}}),e};!0===e&&(o=a[1],a=Array.prototype.slice.call(a,2));let n=a.length;for(s=0;s<n;s++)o=i(o,a[s]);return o}function O(e,t,s){for(let a in e)Object.hasOwnProperty.call(e,a)&&t.call(s||e[a],e[a],a,e)}function V(){let e=arguments,t=e.length;for(let s=0;s<t;s++){let t=e[s];if(null!=t)return t}}Array.prototype.find;let{line:L}=m().seriesTypes,k=(e,t)=>{let s=[],a=e.pointArrayMap,o=t&&e.dataTable.getModified()||e.dataTable;if(!a)return e.getColumn("y",t);let i=a.map(s=>e.getColumn(s,t));for(let e=0;e<o.rowCount;e++){let t=a.map((t,s)=>i[s]?.[e]||0);s.push(t)}return s};class E extends L{destroy(){this.dataEventsToUnbind.forEach(function(e){e()}),super.destroy.apply(this,arguments)}getName(){let e=[],t=this.name;return t||((this.nameComponents||[]).forEach(function(t,s){e.push(this.options.params[t]+V(this.nameSuffixes[s],""))},this),t=(this.nameBase||this.type.toUpperCase())+(this.nameComponents?" ("+e.join(", ")+")":"")),t}getValues(e,t){let s=t.period,a=e.xData||[],o=e.yData,i=o.length,n=[],r=[],l=[],p,u=-1,h=0,d,c=0;if(!(a.length<s)){for(A(o[0])&&(u=t.index?t.index:0);h<s-1;)c+=u<0?o[h]:o[h][u],h++;for(p=h;p<i;p++)c+=u<0?o[p]:o[p][u],d=[a[p],c/s],n.push(d),r.push(d[0]),l.push(d[1]),c-=u<0?o[p-h]:o[p-h][u];return{values:n,xData:r,yData:l}}}init(e,t){let s=this;super.init.call(s,e,t);let a=x(c(),"afterLinkSeries",function({isUpdating:t}){if(t)return;let a=!!s.dataEventsToUnbind.length;if(!s.linkedParent)return(0,u.error)("Series "+s.options.linkedTo+" not found! Check `linkedTo`.",!1,e);if(!a&&(s.dataEventsToUnbind.push(x(s.linkedParent,"updatedData",function(){s.recalculateValues()})),s.calculateOn.xAxis&&s.dataEventsToUnbind.push(x(s.linkedParent.xAxis,s.calculateOn.xAxis,function(){s.recalculateValues()}))),"init"===s.calculateOn.chart)s.closestPointRange||s.recalculateValues();else if(!a){let e=x(s.chart,s.calculateOn.chart,function(){s.recalculateValues(),e()})}},{order:0});s.dataEventsToUnbind=[],s.eventsToUnbind.push(a)}recalculateValues(){let e=[],t=this.dataTable,s=this.points||[],a=this.dataTable.rowCount,o=!0,i,n,r,l,p=this.linkedParent.yData,u=this.linkedParent.processedYData;this.linkedParent.xData=this.linkedParent.getColumn("x"),this.linkedParent.yData=k(this.linkedParent),this.linkedParent.processedYData=k(this.linkedParent,!0);let d=this.linkedParent.options&&this.linkedParent.dataTable.rowCount&&this.getValues(this.linkedParent,this.options.params)||{values:[],xData:[],yData:[]};delete this.linkedParent.xData,this.linkedParent.yData=p,this.linkedParent.processedYData=u;let c=this.pointArrayMap||["y"],g={};if(d.yData.forEach(e=>{c.forEach((t,s)=>{let a=g[t]||[];a.push(A(e)?e[s]:e),g[t]||(g[t]=a)})}),a&&!this.hasGroupedData&&this.visible&&this.points)if(this.cropped){this.xAxis&&(r=this.xAxis.min,l=this.xAxis.max);let a=this.cropData(t,r,l),o=["x",...this.pointArrayMap||["y"]];for(let t=0;t<(a.modified?.rowCount||0);t++){let s=o.map(e=>this.getColumn(e)[t]||0);e.push(s)}let p=this.getColumn("x");i=d.xData.indexOf(p[0]),n=d.xData.indexOf(p[p.length-1]),-1===i&&n===d.xData.length-2&&e[0][0]===s[0].x&&e.shift(),this.updateData(e)}else(this.updateAllPoints||d.xData.length!==a-1&&d.xData.length!==a+1)&&(o=!1,this.updateData(d.values));o&&(t.setColumns({...g,x:d.xData}),this.options.data=d.values),this.calculateOn.xAxis&&this.getColumn("x",!0).length&&(this.isDirty=!0,this.redraw()),this.isDirtyData=!!this.linkedSeries.length,function(e,t,s,a){if(s=s||{},y?.createEvent&&(e.dispatchEvent||e.fireEvent&&e!==h())){let a=y.createEvent("Events");a.initEvent(t,!0,!0),s=b(a,s),e.dispatchEvent?e.dispatchEvent(s):e.fireEvent(t,s)}else if(e.hcEvents){s.target||b(s,{preventDefault:function(){s.defaultPrevented=!0},target:e,type:t});let a=[],o=e,i=!1;for(;o.hcEvents;)Object.hasOwnProperty.call(o,"hcEvents")&&o.hcEvents[t]&&(a.length&&(i=!0),a.unshift.apply(a,o.hcEvents[t])),o=Object.getPrototypeOf(o);i&&a.sort((e,t)=>e.order-t.order),a.forEach(t=>{!1===t.fn.call(e,s,e)&&s.preventDefault()})}}(this,"updatedData")}processData(){let e=this.options.compareToMain,t=this.linkedParent;super.processData.apply(this,arguments),this.dataModify&&t&&t.dataModify&&t.dataModify.compareValue&&e&&(this.dataModify.compareValue=t.dataModify.compareValue)}}E.defaultOptions=M(L.defaultOptions,{name:void 0,tooltip:{valueDecimals:4},linkedTo:void 0,compareToMain:!1,params:{index:3,period:14}}),b(E.prototype,{calculateOn:{chart:"init"},hasDerivedData:!0,nameComponents:["period"],nameSuffixes:[],useCommonDataGrouping:!0}),m().registerSeriesType("sma",E);let{sma:w}=m().seriesTypes;class I extends w{accumulatePeriodPoints(e,t,s){let a=0,o=0;for(;o<e;)a+=t<0?s[o]:s[o][t],o++;return a}calculateEma(e,t,s,a,o,i,n){let r=e[s-1],l=i<0?t[s-1]:t[s-1][i];return[r,void 0===o?n:D(l*a+o*(1-a))]}getValues(e,t){let s=t.period,a=e.xData,o=e.yData,i=o?o.length:0,n=2/(s+1),r=[],l=[],p=[],u,h,d,c=-1,g=0;if(!(i<s)){for(A(o[0])&&(c=t.index?t.index:0),g=this.accumulatePeriodPoints(s,c,o)/s,d=s;d<i+1;d++)h=this.calculateEma(a,o,d,n,u,c,g),r.push(h),l.push(h[0]),p.push(h[1]),u=h[1];return{values:r,xData:l,yData:p}}}}I.defaultOptions=M(w.defaultOptions,{params:{index:3,period:9}}),m().registerSeriesType("ema",I);let{sma:N}=m().seriesTypes;class B extends N{static populateAverage(e,t,s,a,o){let i=t[a][1],n=t[a][2],r=t[a][3],l=s[a],p=r===i&&r===n||i===n?0:(2*r-n-i)/(i-n)*l;return[e[a],p]}getValues(e,t){let s,a,o,i=t.period,n=e.xData,r=e.yData,l=t.volumeSeriesID,p=e.chart.get(l),h=p?.getColumn("y"),d=r?r.length:0,c=[],g=[],m=[];if(!(n.length<=i)||!d||4===r[0].length){if(!p)return void(0,u.error)("Series "+l+" not found! Check `volumeSeriesID`.",!0,e.chart);for(a=i;a<d;a++)s=c.length,o=B.populateAverage(n,r,h,a,i),s>0&&(o[1]+=c[s-1][1]),c.push(o),g.push(o[0]),m.push(o[1]);return{values:c,xData:g,yData:m}}}}B.defaultOptions=M(N.defaultOptions,{params:{index:void 0,volumeSeriesID:"volume"}}),b(B.prototype,{nameComponents:!1,nameBase:"Accumulation/Distribution"}),m().registerSeriesType("ad",B);let{noop:G}=h(),{column:{prototype:W},sma:z}=m().seriesTypes;class Y extends z{drawGraph(){let e,t=this.options,s=this.points,a=this.userOptions.color,o=t.greaterBarColor,i=t.lowerBarColor,n=s[0];if(!a&&n)for(e=1,n.color=o;e<s.length;e++)s[e].y>s[e-1].y?s[e].color=o:s[e].y<s[e-1].y?s[e].color=i:s[e].color=s[e-1].color}getValues(e){let t=e.xData||[],s=e.yData||[],a=s.length,o=[],i=[],n=[],r,l,p,u,h,d,c=0,g=0;if(!(t.length<=34)&&A(s[0])&&4===s[0].length){for(h=0;h<33;h++)u=(s[h][1]+s[h][2])/2,h>=29&&(g=D(g+u)),c=D(c+u);for(d=33;d<a;d++)g=D(g+(u=(s[d][1]+s[d][2])/2)),c=D(c+u),r=D(g/5-c/34),o.push([t[d],r]),i.push(t[d]),n.push(r),l=d+1-5,p=d+1-34,g=D(g-(s[l][1]+s[l][2])/2),c=D(c-(s[p][1]+s[p][2])/2);return{values:o,xData:i,yData:n}}}}Y.defaultOptions=M(z.defaultOptions,{params:{index:void 0,period:void 0},greaterBarColor:"#06b535",lowerBarColor:"#f21313",threshold:0,groupPadding:.2,pointPadding:.2,crisp:!1,states:{hover:{halo:{size:0}}}}),b(Y.prototype,{nameBase:"AO",nameComponents:void 0,markerAttribs:G,getColumnMetrics:W.getColumnMetrics,crispCol:W.crispCol,translate:W.translate,drawPoints:W.drawPoints}),m().registerSeriesType("ao",Y);let{sma:{prototype:X}}=m().seriesTypes;!function(e){let t=["bottomLine"],s=["top","bottom"],a=["top"];function o(e){return"plot"+e.charAt(0).toUpperCase()+e.slice(1)}function i(e,t){let s=[];return(e.pointArrayMap||[]).forEach(e=>{e!==t&&s.push(o(e))}),s}function n(){let e=this,t=e.pointValKey,s=e.linesApiNames,a=e.areaLinesNames,n=e.points,r=e.options,l=e.graph,p={options:{gapSize:r.gapSize}},h=[],d=i(e,t),c=n.length,g;if(d.forEach((e,t)=>{for(h[t]=[];c--;)g=n[c],h[t].push({x:g.x,plotX:g.plotX,plotY:g[e],isNull:!S(g[e])});c=n.length}),e.userOptions.fillColor&&a.length){let t=h[d.indexOf(o(a[0]))],s=1===a.length?n:h[d.indexOf(o(a[1]))],i=e.color;e.points=s,e.nextPoints=t,e.color=e.userOptions.fillColor,e.options=M(n,p),e.graph=e.area,e.fillGraph=!0,X.drawGraph.call(e),e.area=e.graph,delete e.nextPoints,delete e.fillGraph,e.color=i}s.forEach((t,s)=>{h[s]?(e.points=h[s],r[t]?e.options=M(r[t].styles,p):(0,u.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],X.drawGraph.call(e),e["graph"+t]=e.graph):(0,u.error)('Error: "'+t+" doesn't have equivalent in pointArrayMap. To many elements in linesApiNames relative to pointArrayMap.\"")}),e.points=n,e.options=r,e.graph=l,X.drawGraph.call(e)}function r(e){let t,s=[],a=[];if(e=e||this.points,this.fillGraph&&this.nextPoints){if((t=X.getGraphPath.call(this,this.nextPoints))&&t.length){t[0][0]="L",s=X.getGraphPath.call(this,e),a=t.slice(0,s.length);for(let e=a.length-1;e>=0;e--)s.push(a[e])}}else s=X.getGraphPath.apply(this,arguments);return s}function l(e){let t=[];return(this.pointArrayMap||[]).forEach(s=>{t.push(e[s])}),t}function p(){let e=this.pointArrayMap,t=[],s;t=i(this),X.translate.apply(this,arguments),this.points.forEach(a=>{e.forEach((e,o)=>{s=a[e],this.dataModify&&(s=this.dataModify.modifyValue(s)),null!==s&&(a[t[o]]=this.yAxis.toPixels(s,!0))})})}e.compose=function(e){let o=e.prototype;return o.linesApiNames=o.linesApiNames||t.slice(),o.pointArrayMap=o.pointArrayMap||s.slice(),o.pointValKey=o.pointValKey||"top",o.areaLinesNames=o.areaLinesNames||a.slice(),o.drawGraph=n,o.getGraphPath=r,o.toYData=l,o.translate=p,e}}(i||(i={}));let F=i,{sma:R}=m().seriesTypes;function K(e,t){let s=e[0],a=0,o;for(o=1;o<e.length;o++)("max"===t&&e[o]>=s||"min"===t&&e[o]<=s)&&(s=e[o],a=o);return a}class j extends R{getValues(e,t){let s,a,o,i,n,r=t.period,l=e.xData,p=e.yData,u=p?p.length:0,h=[],d=[],c=[];for(i=r-1;i<u;i++)o=K((n=p.slice(i-r+1,i+2)).map(function(e){return V(e[2],e)}),"min"),s=K(n.map(function(e){return V(e[1],e)}),"max")/r*100,a=o/r*100,l[i+1]&&(h.push([l[i+1],s,a]),d.push(l[i+1]),c.push([s,a]));return{values:h,xData:d,yData:c}}}j.defaultOptions=M(R.defaultOptions,{params:{index:void 0,period:25},marker:{enabled:!1},tooltip:{pointFormat:'<span style="color:{point.color}">●</span><b> {series.name}</b><br/>Aroon Up: {point.y}<br/>Aroon Down: {point.aroonDown}<br/>'},aroonDown:{styles:{lineWidth:1,lineColor:void 0}},dataGrouping:{approximation:"averages"}}),b(j.prototype,{areaLinesNames:[],linesApiNames:["aroonDown"],nameBase:"Aroon",pointArrayMap:["y","aroonDown"],pointValKey:"y"}),F.compose(j),m().registerSeriesType("aroon",j);let{aroon:H}=m().seriesTypes;class U extends H{getValues(e,t){let s,a,o=[],i=[],n=[],r=super.getValues.call(this,e,t);for(a=0;a<r.yData.length;a++)s=r.yData[a][0]-r.yData[a][1],o.push([r.xData[a],s]),i.push(r.xData[a]),n.push(s);return{values:o,xData:i,yData:n}}}U.defaultOptions=M(H.defaultOptions,{tooltip:{pointFormat:'<span style="color:{point.color}">●</span><b> {series.name}</b>: {point.y}'}}),b(U.prototype,{nameBase:"Aroon Oscillator",linesApiNames:[],pointArrayMap:["y"],pointValKey:"y"}),F.compose(H),m().registerSeriesType("aroonoscillator",U);let{sma:Z}=m().seriesTypes;function _(e,t){return Math.max(e[1]-e[2],void 0===t?0:Math.abs(e[1]-t[3]),void 0===t?0:Math.abs(e[2]-t[3]))}class q extends Z{getValues(e,t){let s=t.period,a=e.xData,o=e.yData,i=o?o.length:0,n=[[a[0],o[0]]],r=[],l=[],p=[],u,h,d=0,c=1,g=0;if(!(a.length<=s)&&A(o[0])&&4===o[0].length){for(h=1;h<=i;h++){var m,y,f,x,v;!function(e,t,s,a){let o=t[a],i=s[a];e.push([o,i])}(n,a,o,h),s<c?(d=(m=a,y=o,f=h,x=s,v=d,u=[m[f-1],(v*(x-1)+_(y[f-1],y[f-2]))/x])[1],r.push(u),l.push(u[0]),p.push(u[1])):(s===c?(d=g/(h-1),r.push([a[h-1],d]),l.push(a[h-1]),p.push(d)):g+=_(o[h-1],o[h-2]),c++)}return{values:r,xData:l,yData:p}}}}q.defaultOptions=M(Z.defaultOptions,{params:{index:void 0}}),m().registerSeriesType("atr",q);let{sma:$}=m().seriesTypes;class J extends ${init(){m().seriesTypes.sma.prototype.init.apply(this,arguments),this.options=M({topLine:{styles:{lineColor:this.color}},bottomLine:{styles:{lineColor:this.color}}},this.options)}getValues(e,t){let s,a,o,i,n,r,l,p,u,h=t.period,d=t.standardDeviation,c=[],g=[],y=e.xData,f=e.yData,x=f?f.length:0,v=[];if(y.length<h)return;let D=A(f[0]);for(u=h;u<=x;u++)n=y.slice(u-h,u),r=f.slice(u-h,u),i=(p=m().seriesTypes.sma.prototype.getValues.call(this,{xData:n,yData:r},t)).xData[0],s=p.yData[0],l=function(e,t,s,a){let o=e.length,i=0,n,r=0;for(;i<o;i++)r+=(n=(s?e[i][t]:e[i])-a)*n;return Math.sqrt(r/=o-1)}(r,t.index,D,s),a=s+d*l,o=s-d*l,v.push([i,a,s,o]),c.push(i),g.push([a,s,o]);return{values:v,xData:c,yData:g}}}J.defaultOptions=M($.defaultOptions,{params:{period:20,standardDeviation:2,index:3},bottomLine:{styles:{lineWidth:1,lineColor:void 0}},topLine:{styles:{lineWidth:1,lineColor:void 0}},tooltip:{pointFormat:'<span style="color:{point.color}">●</span><b> {series.name}</b><br/>Top: {point.top}<br/>Middle: {point.middle}<br/>Bottom: {point.bottom}<br/>'},marker:{enabled:!1},dataGrouping:{approximation:"averages"}}),b(J.prototype,{areaLinesNames:["top","bottom"],linesApiNames:["topLine","bottomLine"],nameComponents:["period","standardDeviation"],pointArrayMap:["top","middle","bottom"],pointValKey:"middle"}),F.compose(J),m().registerSeriesType("bb",J);let{sma:Q}=m().seriesTypes;class ee extends Q{getValues(e,t){let s=t.period,a=e.xData,o=e.yData,i=o?o.length:0,n=[],r=[],l=[],p=[],u,h,d=[],c,g=1,m,y,f,x;if(!(a.length<=s)&&A(o[0])&&4===o[0].length){for(;g<s;)h=o[g-1],n.push((h[1]+h[2]+h[3])/3),g++;for(x=s;x<=i;x++)y=((h=o[x-1])[1]+h[2]+h[3])/3,c=n.push(y),m=(d=n.slice(c-s)).reduce(function(e,t){return e+t},0)/s,f=function(e,t){let s=e.length,a=0,o;for(o=0;o<s;o++)a+=Math.abs(t-e[o]);return a}(d,m)/s,u=(y-m)/(.015*f),r.push([a[x-1],u]),l.push(a[x-1]),p.push(u);return{values:r,xData:l,yData:p}}}}ee.defaultOptions=M(Q.defaultOptions,{params:{index:void 0}}),m().registerSeriesType("cci",ee);let{sma:et}=m().seriesTypes;class es extends et{constructor(){super(...arguments),this.nameBase="Chaikin Money Flow"}isValid(){let e=this.chart,t=this.options,s=this.linkedParent,a=this.volumeSeries||(this.volumeSeries=e.get(t.params.volumeSeriesID)),o=s?.pointArrayMap?.length===4;function i(e){return e.dataTable.rowCount>=t.params.period}return!!(s&&a&&i(s)&&i(a)&&o)}getValues(e,t){if(this.isValid())return this.getMoneyFlow(e.xData,e.yData,this.volumeSeries.getColumn("y"),t.period)}getMoneyFlow(e,t,s,a){let o=t.length,i=[],n=[],r=[],l=[],p,u,h=-1,d=0,c=0;function g(e,t){let s=e[1],a=e[2],o=e[3];return null!==t&&null!==s&&null!==a&&null!==o&&s!==a?(o-a-(s-o))/(s-a)*t:(h=p,null)}if(a>0&&a<=o){for(p=0;p<a;p++)i[p]=g(t[p],s[p]),d+=s[p],c+=i[p];for(n.push(e[p-1]),r.push(p-h>=a&&0!==d?c/d:null),l.push([n[0],r[0]]);p<o;p++)i[p]=g(t[p],s[p]),d-=s[p-a],d+=s[p],c-=i[p-a],c+=i[p],u=[e[p],p-h>=a?c/d:null],n.push(u[0]),r.push(u[1]),l.push([u[0],u[1]])}return{values:l,xData:n,yData:r}}}es.defaultOptions=M(et.defaultOptions,{params:{index:void 0,volumeSeriesID:"volume"}}),m().registerSeriesType("cmf",es);let{sma:ea}=m().seriesTypes;class eo extends ea{calculateDM(e,t,s){let a=e[t][1],o=e[t][2],i=e[t-1][1],n=e[t-1][2];return D(a-i>n-o?s?Math.max(a-i,0):0:s?0:Math.max(n-o,0))}calculateDI(e,t){return e/t*100}calculateDX(e,t){return D(Math.abs(e-t)/Math.abs(e+t)*100)}smoothValues(e,t,s){return D(e-e/s+t)}getTR(e,t){return D(Math.max(e[1]-e[2],t?Math.abs(e[1]-t[3]):0,t?Math.abs(e[2]-t[3]):0))}getValues(e,t){let s=t.period,a=e.xData,o=e.yData,i=o?o.length:0,n=[],r=[],l=[];if(a.length<=s||!A(o[0])||4!==o[0].length)return;let p=0,u=0,h=0,d;for(d=1;d<i;d++){let e,t,i,c,g,m,y,f,x;d<=s?(c=this.calculateDM(o,d,!0),g=this.calculateDM(o,d),m=this.getTR(o[d],o[d-1]),p+=c,u+=g,h+=m,d===s&&(y=this.calculateDI(p,h),f=this.calculateDI(u,h),x=this.calculateDX(p,u),n.push([a[d],x,y,f]),r.push(a[d]),l.push([x,y,f]))):(c=this.calculateDM(o,d,!0),g=this.calculateDM(o,d),m=this.getTR(o[d],o[d-1]),e=this.smoothValues(p,c,s),t=this.smoothValues(u,g,s),i=this.smoothValues(h,m,s),p=e,u=t,h=i,y=this.calculateDI(p,h),f=this.calculateDI(u,h),x=this.calculateDX(p,u),n.push([a[d],x,y,f]),r.push(a[d]),l.push([x,y,f]))}return{values:n,xData:r,yData:l}}}eo.defaultOptions=M(ea.defaultOptions,{params:{index:void 0},marker:{enabled:!1},tooltip:{pointFormat:'<span style="color: {point.color}">●</span><b> {series.name}</b><br/><span style="color: {point.color}">DX</span>: {point.y}<br/><span style="color: {point.series.options.plusDILine.styles.lineColor}">+DI</span>: {point.plusDI}<br/><span style="color: {point.series.options.minusDILine.styles.lineColor}">-DI</span>: {point.minusDI}<br/>'},plusDILine:{styles:{lineWidth:1,lineColor:"#06b535"}},minusDILine:{styles:{lineWidth:1,lineColor:"#f21313"}},dataGrouping:{approximation:"averages"}}),b(eo.prototype,{areaLinesNames:[],nameBase:"DMI",linesApiNames:["plusDILine","minusDILine"],pointArrayMap:["y","plusDI","minusDI"],parallelArrays:["x","y","plusDI","minusDI"],pointValKey:"y"}),F.compose(eo),m().registerSeriesType("dmi",eo);let{sma:ei}=m().seriesTypes;function en(e,t,s,a,o){let i=V(t[s][a],t[s]);return o?D(e-i):D(e+i)}class er extends ei{getValues(e,t){let s=t.period,a=t.index,o=Math.floor(s/2+1),i=s+o,n=e.xData||[],r=e.yData||[],l=r.length,p=[],u=[],h=[],d,c,g,m,y,f=0;if(!(n.length<=i)){for(m=0;m<s-1;m++)f=en(f,r,m,a);for(y=0;y<=l-i;y++)c=y+s-1,g=y+i-1,f=en(f,r,c,a),d=V(r[g][a],r[g])-f/s,f=en(f,r,y,a,!0),p.push([n[g],d]),u.push(n[g]),h.push(d);return{values:p,xData:u,yData:h}}}}er.defaultOptions=M(ei.defaultOptions,{params:{index:0,period:21}}),b(er.prototype,{nameBase:"DPO"}),m().registerSeriesType("dpo",er);let{ema:el}=m().seriesTypes;class ep extends el{getValues(e,t){let s,a,o=t.periods,i=t.period,n=[],r=[],l=[];if(2!==o.length||o[1]<=o[0])return void(0,u.error)('Error: "Chaikin requires two periods. Notice, first period should be lower than the second one."');let p=B.prototype.getValues.call(this,e,{volumeSeriesID:t.volumeSeriesID,period:i});if(!p)return;let h=super.getValues.call(this,p,{period:o[0]}),d=super.getValues.call(this,p,{period:o[1]});if(!h||!d)return;let c=o[1]-o[0];for(a=0;a<d.yData.length;a++)s=D(h.yData[a+c]-d.yData[a]),n.push([d.xData[a],s]),r.push(d.xData[a]),l.push(s);return{values:n,xData:r,yData:l}}}ep.defaultOptions=M(el.defaultOptions,{params:{index:void 0,volumeSeriesID:"volume",period:9,periods:[3,10]}}),b(ep.prototype,{nameBase:"Chaikin Osc",nameComponents:["periods"]}),m().registerSeriesType("chaikin",ep);let{sma:eu}=m().seriesTypes;class eh extends eu{getValues(e,t){let s=t.period,a=e.xData,o=e.yData,i=o?o.length:0,n=[],r=[],l=[],p,u=t.index,h;if(a.length<s)return;T(o[0])?h=o:(u=Math.min(u,o[0].length-1),h=o.map(e=>e[u]));let d=0,c=0,g=0,m;for(let e=s;e>0;e--)h[e]>h[e-1]?c+=h[e]-h[e-1]:h[e]<h[e-1]&&(g+=h[e-1]-h[e]);for(m=c+g>0?100*(c-g)/(c+g):0,r.push(a[s]),l.push(m),n.push([a[s],m]),p=s+1;p<i;p++)d=Math.abs(h[p-s-1]-h[p-s]),h[p]>h[p-1]?c+=h[p]-h[p-1]:h[p]<h[p-1]&&(g+=h[p-1]-h[p]),h[p-s]>h[p-s-1]?c-=d:g-=d,m=c+g>0?100*(c-g)/(c+g):0,r.push(a[p]),l.push(m),n.push([a[p],m]);return{values:n,xData:r,yData:l}}}eh.defaultOptions=M(eu.defaultOptions,{params:{period:20,index:3}}),m().registerSeriesType("cmo",eh);let{ema:ed}=m().seriesTypes;class ec extends ed{getEMA(e,t,s,a,o,i){return super.calculateEma(i||[],e,void 0===o?1:o,this.EMApercent,t,void 0===a?-1:a,s)}getValues(e,t){let s=t.period,a=[],o=2*s,i=e.xData,n=e.yData,r=n?n.length:0,l=[],p=[],u=[],h=0,d=0,c,g,m,y,f=-1,x,v=0;if(this.EMApercent=2/(s+1),!(r<2*s-1)){for(A(n[0])&&(f=t.index?t.index:0),v=(h=super.accumulatePeriodPoints(s,f,n))/s,h=0,y=s;y<r+2;y++)y<r+1&&(d=this.getEMA(n,g,v,f,y)[1],a.push(d)),g=d,y<o?h+=d:(y===o&&(v=h/s),d=a[y-s-1],c=this.getEMA([d],m,v)[1],x=[i[y-2],D(2*d-c)],l.push(x),p.push(x[0]),u.push(x[1]),m=c);return{values:l,xData:p,yData:u}}}}ec.defaultOptions=M(ed.defaultOptions),m().registerSeriesType("dema",ec);let{ema:eg}=m().seriesTypes;class em extends eg{getEMA(e,t,s,a,o,i){return super.calculateEma(i||[],e,void 0===o?1:o,this.EMApercent,t,void 0===a?-1:a,s)}getTemaPoint(e,t,s,a){return[e[a-3],D(3*s.level1-3*s.level2+s.level3)]}getValues(e,t){let s=t.period,a=2*s,o=3*s,i=e.xData,n=e.yData,r=n?n.length:0,l=[],p=[],u=[],h=[],d=[],c={},g=-1,m=0,y=0,f,x,v,D;if(this.EMApercent=2/(s+1),!(r<3*s-2)){for(A(n[0])&&(g=t.index?t.index:0),y=(m=super.accumulatePeriodPoints(s,g,n))/s,m=0,v=s;v<r+3;v++)v<r+1&&(c.level1=this.getEMA(n,f,y,g,v)[1],h.push(c.level1)),f=c.level1,v<a?m+=c.level1:(v===a&&(y=m/s,m=0),c.level1=h[v-s-1],c.level2=this.getEMA([c.level1],x,y)[1],d.push(c.level2),x=c.level2,v<o?m+=c.level2:(v===o&&(y=m/s),v===r+1&&(c.level1=h[v-s-1],c.level2=this.getEMA([c.level1],x,y)[1],d.push(c.level2)),c.level1=h[v-s-2],c.level2=d[v-2*s-1],c.level3=this.getEMA([c.level2],c.prevLevel3,y)[1],(D=this.getTemaPoint(i,o,c,v))&&(l.push(D),p.push(D[0]),u.push(D[1])),c.prevLevel3=c.level3));return{values:l,xData:p,yData:u}}}}em.defaultOptions=M(eg.defaultOptions),m().registerSeriesType("tema",em);let{tema:ey}=m().seriesTypes;class ef extends ey{getTemaPoint(e,t,s,a){if(a>t)return[e[a-3],0!==s.prevLevel3?D(s.level3-s.prevLevel3)/s.prevLevel3*100:null]}}ef.defaultOptions=M(ey.defaultOptions),m().registerSeriesType("trix",ef);let{ema:ex}=m().seriesTypes;class ev extends ex{getValues(e,t){let s,a,o=t.periods,i=t.index,n=[],r=[],l=[];if(2!==o.length||o[1]<=o[0])return void(0,u.error)('Error: "APO requires two periods. Notice, first period should be lower than the second one."');let p=super.getValues.call(this,e,{index:i,period:o[0]}),h=super.getValues.call(this,e,{index:i,period:o[1]});if(!p||!h)return;let d=o[1]-o[0];for(a=0;a<h.yData.length;a++)s=p.yData[a+d]-h.yData[a],n.push([h.xData[a],s]),r.push(h.xData[a]),l.push(s);return{values:n,xData:r,yData:l}}}ev.defaultOptions=M(ex.defaultOptions,{params:{period:void 0,periods:[10,20]}}),b(ev.prototype,{nameBase:"APO",nameComponents:["periods"]}),m().registerSeriesType("apo",ev);var eD=l(956),eS=l.n(eD),eb=l(620);let{parse:eC}=l.n(eb)(),{sma:eT}=m().seriesTypes;function eA(e){return{high:e.reduce(function(e,t){return Math.max(e,t[1])},-1/0),low:e.reduce(function(e,t){return Math.min(e,t[2])},1/0)}}function eP(e){let t=e.indicator;t.points=e.points,t.nextPoints=e.nextPoints,t.color=e.color,t.options=M(e.options.senkouSpan.styles,e.gap),t.graph=e.graph,t.fillGraph=!0,m().seriesTypes.sma.prototype.drawGraph.call(t)}class eM extends eT{constructor(){super(...arguments),this.data=[],this.options={},this.points=[],this.graphCollection=[]}init(){super.init.apply(this,arguments),this.options=M({tenkanLine:{styles:{lineColor:this.color}},kijunLine:{styles:{lineColor:this.color}},chikouLine:{styles:{lineColor:this.color}},senkouSpanA:{styles:{lineColor:this.color,fill:eC(this.color).setOpacity(.5).get()}},senkouSpanB:{styles:{lineColor:this.color,fill:eC(this.color).setOpacity(.5).get()}},senkouSpan:{styles:{fill:eC(this.color).setOpacity(.2).get()}}},this.options)}toYData(e){return[e.tenkanSen,e.kijunSen,e.chikouSpan,e.senkouSpanA,e.senkouSpanB]}translate(){for(let e of(m().seriesTypes.sma.prototype.translate.apply(this),this.points))for(let t of this.pointArrayMap){let s=e[t];T(s)&&(e["plot"+t]=this.yAxis.toPixels(s,!0),e.plotY=e["plot"+t],e.tooltipPos=[e.plotX,e["plot"+t]],e.isNull=!1)}}drawGraph(){let e=this,t=e.points,s=e.options,a=e.graph,o=e.color,i={options:{gapSize:s.gapSize}},n=e.pointArrayMap.length,r=[[],[],[],[],[],[]],l={tenkanLine:r[0],kijunLine:r[1],chikouLine:r[2],senkouSpanA:r[3],senkouSpanB:r[4],senkouSpan:r[5]},p=[],u=e.options.senkouSpan,h=u.color||u.styles.fill,d=u.negativeColor,c=[[],[]],g=[[],[]],y=t.length,f=0,x,v,D,b,C,T,A,P,V,L,k,E,w;for(e.ikhMap=l;y--;){for(D=0,v=t[y];D<n;D++)S(v[x=e.pointArrayMap[D]])&&r[D].push({plotX:v.plotX,plotY:v["plot"+x],isNull:!1});if(d&&y!==t.length-1){let e=l.senkouSpanB.length-1,t=function(e,t,s,a){if(e&&t&&s&&a){let o=t.plotX-e.plotX,i=t.plotY-e.plotY,n=a.plotX-s.plotX,r=a.plotY-s.plotY,l=e.plotX-s.plotX,p=e.plotY-s.plotY,u=(-i*l+o*p)/(-n*i+o*r),h=(n*p-r*l)/(-n*i+o*r);if(u>=0&&u<=1&&h>=0&&h<=1)return{plotX:e.plotX+h*o,plotY:e.plotY+h*i}}}(l.senkouSpanA[e-1],l.senkouSpanA[e],l.senkouSpanB[e-1],l.senkouSpanB[e]);if(t){let s={plotX:t.plotX,plotY:t.plotY,isNull:!1,intersectPoint:!0};l.senkouSpanA.splice(e,0,s),l.senkouSpanB.splice(e,0,s),p.push(e)}}}if(O(l,(t,a)=>{s[a]&&"senkouSpan"!==a&&(e.points=r[f],e.options=M(s[a].styles,i),e.graph=e["graph"+a],e.fillGraph=!1,e.color=o,m().seriesTypes.sma.prototype.drawGraph.call(e),e["graph"+a]=e.graph),f++}),e.graphCollection)for(let t of e.graphCollection)e[t].destroy(),delete e[t];if(e.graphCollection=[],d&&l.senkouSpanA[0]&&l.senkouSpanB[0]){for(p.unshift(0),p.push(l.senkouSpanA.length-1),E=0;E<p.length-1;E++)if(b=p[E],C=p[E+1],T=l.senkouSpanB.slice(b,C+1),A=l.senkouSpanA.slice(b,C+1),Math.floor(T.length/2)>=1){let e=Math.floor(T.length/2);if(T[e].plotY===A[e].plotY){for(w=0,P=0,V=0;w<T.length;w++)P+=T[w].plotY,V+=A[w].plotY;c[k=P>V?0:1]=c[k].concat(T),g[k]=g[k].concat(A)}else c[k=T[e].plotY>A[e].plotY?0:1]=c[k].concat(T),g[k]=g[k].concat(A)}else c[k=T[0].plotY>A[0].plotY?0:1]=c[k].concat(T),g[k]=g[k].concat(A);["graphsenkouSpanColor","graphsenkouSpanNegativeColor"].forEach(function(t,a){c[a].length&&g[a].length&&(L=0===a?h:d,eP({indicator:e,points:c[a],nextPoints:g[a],color:L,options:s,gap:i,graph:e[t]}),e[t]=e.graph,e.graphCollection.push(t))})}else eP({indicator:e,points:l.senkouSpanB,nextPoints:l.senkouSpanA,color:h,options:s,gap:i,graph:e.graphsenkouSpan}),e.graphsenkouSpan=e.graph;delete e.nextPoints,delete e.fillGraph,e.points=t,e.options=s,e.graph=a,e.color=o}getGraphPath(e){let t=[],s,a=[];if(e=e||this.points,this.fillGraph&&this.nextPoints){if((s=m().seriesTypes.sma.prototype.getGraphPath.call(this,this.nextPoints))&&s.length){s[0][0]="L",t=m().seriesTypes.sma.prototype.getGraphPath.call(this,e),a=s.slice(0,t.length);for(let e=a.length-1;e>=0;e--)t.push(a[e])}}else t=m().seriesTypes.sma.prototype.getGraphPath.apply(this,arguments);return t}getValues(e,t){var s,a;let o,i,n,r,l,p,u,h,d,c,g,m,y,f,x,v=t.period,D=t.periodTenkan,S=t.periodSenkouSpanB,b=e.xData,C=e.yData,T=e.xAxis,P=C&&C.length||0,M=(s=T.series.map(e=>e.getColumn("x")),x=!a,s.forEach(e=>{if(e.length>1)for(f=m=e.length-1;f>0;f--)(y=e[f]-e[f-1])<0&&!x?(a?.(),a=void 0):y&&(void 0===g||y<g)&&(g=y)}),g),O=[],V=[];if(b.length<=v||!A(C[0])||4!==C[0].length)return;let L=b[0]-v*M;for(l=0;l<v;l++)V.push(L+l*M);for(l=0;l<P;l++)l>=D&&(p=((i=eA(C.slice(l-D,l))).high+i.low)/2),l>=v&&(d=(p+(u=((n=eA(C.slice(l-v,l))).high+n.low)/2))/2),l>=S&&(c=((r=eA(C.slice(l-S,l))).high+r.low)/2),h=C[l][3],o=b[l],void 0===O[l]&&(O[l]=[]),void 0===O[l+v-1]&&(O[l+v-1]=[]),O[l+v-1][0]=p,O[l+v-1][1]=u,O[l+v-1][2]=void 0,void 0===O[l+1]&&(O[l+1]=[]),O[l+1][2]=h,l<=v&&(O[l+v-1][3]=void 0,O[l+v-1][4]=void 0),void 0===O[l+2*v-2]&&(O[l+2*v-2]=[]),O[l+2*v-2][3]=d,O[l+2*v-2][4]=c,V.push(o);for(l=1;l<=v;l++)V.push(o+l*M);return{values:O,xData:V,yData:O}}}eM.defaultOptions=M(eT.defaultOptions,{params:{index:void 0,period:26,periodTenkan:9,periodSenkouSpanB:52},marker:{enabled:!1},tooltip:{pointFormat:'<span style="color:{point.color}">●</span> <b> {series.name}</b><br/>TENKAN SEN: {point.tenkanSen:.3f}<br/>KIJUN SEN: {point.kijunSen:.3f}<br/>CHIKOU SPAN: {point.chikouSpan:.3f}<br/>SENKOU SPAN A: {point.senkouSpanA:.3f}<br/>SENKOU SPAN B: {point.senkouSpanB:.3f}<br/>'},tenkanLine:{styles:{lineWidth:1,lineColor:void 0}},kijunLine:{styles:{lineWidth:1,lineColor:void 0}},chikouLine:{styles:{lineWidth:1,lineColor:void 0}},senkouSpanA:{styles:{lineWidth:1,lineColor:void 0}},senkouSpanB:{styles:{lineWidth:1,lineColor:void 0}},senkouSpan:{styles:{fill:"rgba(255, 0, 0, 0.5)"}},dataGrouping:{approximation:"ichimoku-averages"}}),b(eM.prototype,{pointArrayMap:["tenkanSen","kijunSen","chikouSpan","senkouSpanA","senkouSpanB"],pointValKey:"tenkanSen",nameComponents:["periodSenkouSpanB","period","periodTenkan"]}),eS()["ichimoku-averages"]=function(){let e,t=[];return[].forEach.call(arguments,function(s,a){t.push(eS().average(s)),e=!e&&void 0===t[a]}),e?void 0:t},m().registerSeriesType("ikh",eM);let{sma:eO}=m().seriesTypes;class eV extends eO{init(){m().seriesTypes.sma.prototype.init.apply(this,arguments),this.options=M({topLine:{styles:{lineColor:this.color}},bottomLine:{styles:{lineColor:this.color}}},this.options)}getValues(e,t){let s,a,o,i,n,r,l,p=t.period,u=t.periodATR,h=t.multiplierATR,d=t.index,c=e.yData,g=c?c.length:0,y=[],f=m().seriesTypes.ema.prototype.getValues(e,{period:p,index:d}),x=m().seriesTypes.atr.prototype.getValues(e,{period:u}),v=[],S=[];if(!(g<p)){for(l=p;l<=g;l++)n=f.values[l-p],r=x.values[l-u],i=n[0],a=D(n[1]+h*r[1]),o=D(n[1]-h*r[1]),s=n[1],y.push([i,a,s,o]),v.push(i),S.push([a,s,o]);return{values:y,xData:v,yData:S}}}}eV.defaultOptions=M(eO.defaultOptions,{params:{index:0,period:20,periodATR:10,multiplierATR:2},bottomLine:{styles:{lineWidth:1,lineColor:void 0}},topLine:{styles:{lineWidth:1,lineColor:void 0}},tooltip:{pointFormat:'<span style="color:{point.color}">●</span><b> {series.name}</b><br/>Upper Channel: {point.top}<br/>EMA({series.options.params.period}): {point.middle}<br/>Lower Channel: {point.bottom}<br/>'},marker:{enabled:!1},dataGrouping:{approximation:"averages"},lineWidth:1}),b(eV.prototype,{nameBase:"Keltner Channels",areaLinesNames:["top","bottom"],nameComponents:["period","periodATR","multiplierATR"],linesApiNames:["topLine","bottomLine"],pointArrayMap:["top","middle","bottom"],pointValKey:"middle"}),F.compose(eV),m().registerSeriesType("keltnerchannels",eV);let{ema:eL,sma:ek}=m().seriesTypes;class eE extends ek{calculateTrend(e,t){return e[t][1]+e[t][2]+e[t][3]>e[t-1][1]+e[t-1][2]+e[t-1][3]?1:-1}isValidData(e){let t=this.chart,s=this.options,a=this.linkedParent,o=A(e)&&4===e.length,i=this.volumeSeries||(this.volumeSeries=t.get(s.params.volumeSeriesID));return i||(0,u.error)("Series "+s.params.volumeSeriesID+" not found! Check `volumeSeriesID`.",!0,a.chart),!!([a,i].every(function(e){return e&&e.dataTable.rowCount>=s.params.slowAvgPeriod})&&o)}getCM(e,t,s,a,o){return D(t+(s===a?e:o))}getDM(e,t){return D(e-t)}getVolumeForce(e){let t=[],s=0,a,o=1,i=0,n=e[0][1]-e[0][2],r=0,l;for(;o<e.length;o++)l=this.calculateTrend(e,o),a=this.getDM(e[o][1],e[o][2]),s=this.getCM(i,a,l,r,n),t.push([this.volumeSeries.getColumn("y")[o]*l*Math.abs(2*(a/s-1))*100]),r=l,i=s,n=a;return t}getEMA(e,t,s,a,o,i,n){return eL.prototype.calculateEma(n||[],e,void 0===i?1:i,a,t,void 0===o?-1:o,s)}getSMA(e,t,s){return eL.prototype.accumulatePeriodPoints(e,t,s)/e}getValues(e,t){let s=[],a=e.xData,o=e.yData,i=[],n=[],r=[],l,p=0,u=0,h,d,c,g=null;if(!this.isValidData(o[0]))return;let m=this.getVolumeForce(o),y=this.getSMA(t.fastAvgPeriod,0,m),f=this.getSMA(t.slowAvgPeriod,0,m),x=2/(t.fastAvgPeriod+1),v=2/(t.slowAvgPeriod+1);for(;p<o.length;p++)p>=t.fastAvgPeriod&&(d=u=this.getEMA(m,d,y,x,0,p,a)[1]),p>=t.slowAvgPeriod&&(c=h=this.getEMA(m,c,f,v,0,p,a)[1],r.push(l=D(u-h)),r.length>=t.signalPeriod&&(g=r.slice(-t.signalPeriod).reduce((e,t)=>e+t)/t.signalPeriod),s.push([a[p],l,g]),i.push(a[p]),n.push([l,g]));return{values:s,xData:i,yData:n}}}eE.defaultOptions=M(ek.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/>'}}),b(eE.prototype,{areaLinesNames:[],linesApiNames:["signalLine"],nameBase:"Klinger",nameComponents:["fastAvgPeriod","slowAvgPeriod"],pointArrayMap:["y","signal"],parallelArrays:["x","y","signal"],pointValKey:"y"}),F.compose(eE),m().registerSeriesType("klinger",eE);let{noop:ew}=h(),{sma:eI}=m().seriesTypes;class eN extends eI{init(){m().seriesTypes.sma.prototype.init.apply(this,arguments);let e=this.color,t=this.colorIndex;this.options&&(S(this.colorIndex)&&(this.options.signalLine?.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),this.options.macdLine?.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:this.options.macdLine?.zones,startIndex:0},this.signalZones={zones:this.macdZones.zones?.concat(this.options.signalLine.zones),startIndex:this.macdZones.zones?.length}),this.color=e,this.colorIndex=t}toYData(e){return[e.y,e.signal,e.MACD]}translate(){let e=this,t=["plotSignal","plotMACD"];h().seriesTypes.column.prototype.translate.apply(e),e.points.forEach(function(s){[s.signal,s.MACD].forEach(function(a,o){null!==a&&(s[t[o]]=e.yAxis.toPixels(a,!0))})})}destroy(){this.graph=null,this.graphmacd=this.graphmacd&&this.graphmacd.destroy(),this.graphsignal=this.graphsignal&&this.graphsignal.destroy(),m().seriesTypes.sma.prototype.destroy.apply(this,arguments)}drawGraph(){let e=this,t=e.points,s=e.options,a=e.zones,o={options:{gapSize:s.gapSize}},i=[[],[]],n,r=t.length;for(;r--;)S((n=t[r]).plotMACD)&&i[0].push({plotX:n.plotX,plotY:n.plotMACD,isNull:!S(n.plotMACD)}),S(n.plotSignal)&&i[1].push({plotX:n.plotX,plotY:n.plotSignal,isNull:!S(n.plotMACD)});["macd","signal"].forEach((t,a)=>{e.points=i[a],e.options=M(s[`${t}Line`]?.styles||{},o),e.graph=e[`graph${t}`],e.zones=(e[`${t}Zones`].zones||[]).slice(e[`${t}Zones`].startIndex||0),m().seriesTypes.sma.prototype.drawGraph.call(e),e[`graph${t}`]=e.graph}),e.points=t,e.options=s,e.zones=a}applyZones(){let e=this.zones;this.zones=this.signalZones.zones,m().seriesTypes.sma.prototype.applyZones.call(this),this.graphmacd&&this.options.macdLine.zones.length&&this.graphmacd.hide(),this.zones=e}getValues(e,t){let s=t.longPeriod-t.shortPeriod,a=[],o=[],i=[],n,r,l,p=0,u=[];if(!(e.xData.length<t.longPeriod+t.signalPeriod)){for(l=0,n=m().seriesTypes.ema.prototype.getValues(e,{period:t.shortPeriod,index:t.index}),r=m().seriesTypes.ema.prototype.getValues(e,{period:t.longPeriod,index:t.index}),n=n.values,r=r.values;l<=n.length;l++)S(r[l])&&S(r[l][1])&&S(n[l+s])&&S(n[l+s][0])&&a.push([n[l+s][0],0,null,n[l+s][1]-r[l][1]]);for(l=0;l<a.length;l++)o.push(a[l][0]),i.push([0,null,a[l][3]]);for(l=0,u=(u=m().seriesTypes.ema.prototype.getValues({xData:o,yData:i},{period:t.signalPeriod,index:2})).values;l<a.length;l++)a[l][0]>=u[0][0]&&(a[l][2]=u[p][1],i[l]=[0,u[p][1],a[l][3]],null===a[l][3]?(a[l][1]=0,i[l][0]=0):(a[l][1]=D(a[l][3]-u[p][1]),i[l][0]=D(a[l][3]-u[p][1])),p++);return{values:a,xData:o,yData:i}}}}eN.defaultOptions=M(eI.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}),b(eN.prototype,{nameComponents:["longPeriod","shortPeriod","signalPeriod"],pointArrayMap:["y","signal","MACD"],parallelArrays:["x","y","signal","MACD"],pointValKey:"y",markerAttribs:ew,getColumnMetrics:h().seriesTypes.column.prototype.getColumnMetrics,crispCol:h().seriesTypes.column.prototype.crispCol,drawPoints:h().seriesTypes.column.prototype.drawPoints}),m().registerSeriesType("macd",eN);let{sma:eB}=m().seriesTypes;function eG(e){return e.reduce(function(e,t){return e+t})}function eW(e){return(e[1]+e[2]+e[3])/3}class ez extends eB{getValues(e,t){let s=t.period,a=e.xData,o=e.yData,i=o?o.length:0,n=t.decimals,r=e.chart.get(t.volumeSeriesID),l=r?.getColumn("y")||[],p=[],h=[],d=[],c=[],g=[],m,y,f,x,v,D,S=!1,b=1;if(!r)return void(0,u.error)("Series "+t.volumeSeriesID+" not found! Check `volumeSeriesID`.",!0,e.chart);if(!(a.length<=s)&&A(o[0])&&4===o[0].length&&l){for(m=eW(o[b]);b<s+1;)y=m,S=(m=eW(o[b]))>=y,f=m*l[b],c.push(S?f:0),g.push(S?0:f),b++;for(D=b-1;D<i;D++){var C;D>b-1&&(c.shift(),g.shift(),y=m,S=(m=eW(o[D]))>y,f=m*l[D],c.push(S?f:0),g.push(S?0:f)),x=eG(g),C=100-100/(1+eG(c)/x),v=parseFloat(C.toFixed(n)),p.push([a[D],v]),h.push(a[D]),d.push(v)}return{values:p,xData:h,yData:d}}}}ez.defaultOptions=M(eB.defaultOptions,{params:{index:void 0,volumeSeriesID:"volume",decimals:4}}),b(ez.prototype,{nameBase:"Money Flow Index"}),m().registerSeriesType("mfi",ez);let{sma:eY}=m().seriesTypes;function eX(e,t,s,a,o){let i=t[s-1][o]-t[s-a-1][o];return[e[s-1],i]}class eF extends eY{getValues(e,t){let s,a,o=t.period,i=t.index,n=e.xData,r=e.yData,l=r?r.length:0,p=[],u=[],h=[];if(!(n.length<=o)&&A(r[0])){for(s=o+1;s<l;s++)a=eX(n,r,s,o,i),p.push(a),u.push(a[0]),h.push(a[1]);return a=eX(n,r,s,o,i),p.push(a),u.push(a[0]),h.push(a[1]),{values:p,xData:u,yData:h}}}}eF.defaultOptions=M(eY.defaultOptions,{params:{index:3}}),b(eF.prototype,{nameBase:"Momentum"}),m().registerSeriesType("momentum",eF);let{atr:eR}=m().seriesTypes;class eK extends eR{getValues(e,t){let s=super.getValues.apply(this,arguments),a=s.values.length,o=e.yData,i=0,n=t.period-1;if(s){for(;i<a;i++)s.yData[i]=s.values[i][1]/o[n][3]*100,s.values[i][1]=s.yData[i],n++;return s}}}eK.defaultOptions=M(eR.defaultOptions,{tooltip:{valueSuffix:"%"}}),m().registerSeriesType("natr",eK);let{sma:ej}=m().seriesTypes;class eH extends ej{getValues(e,t){let s=e.chart.get(t.volumeSeriesID),a=e.xData,o=e.yData,i=[],n=[],r=[],l=!T(o[0]),p=[],h=1,d=0,c=0,g=0,m=0,y;if(!s)return void(0,u.error)("Series "+t.volumeSeriesID+" not found! Check `volumeSeriesID`.",!0,e.chart);for(y=s.getColumn("y"),p=[a[0],d],g=l?o[0][3]:o[0],i.push(p),n.push(a[0]),r.push(p[1]);h<o.length;h++)c=(m=l?o[h][3]:o[h])>g?d+y[h]:m===g?d:d-y[h],p=[a[h],c],d=c,g=m,i.push(p),n.push(a[h]),r.push(p[1]);return{values:i,xData:n,yData:r}}}eH.defaultOptions=M(ej.defaultOptions,{marker:{enabled:!1},params:{index:void 0,period:void 0,volumeSeriesID:"volume"},tooltip:{valueDecimals:0}}),b(eH.prototype,{nameComponents:void 0}),m().registerSeriesType("obv",eH);let eU=m().seriesTypes.sma.prototype.pointClass;function eZ(e,t){let s=e.series.pointArrayMap,a,o=s.length;for(m().seriesTypes.sma.prototype.pointClass.prototype[t].call(e);o--;)e[a="dataLabel"+s[o]]&&e[a].element&&e[a].destroy(),e[a]=null}let{sma:e_}=m().seriesTypes;class eq extends e_{toYData(e){return[e.P]}translate(){let e=this;super.translate.apply(e),e.points.forEach(function(t){e.pointArrayMap.forEach(function(s){S(t[s])&&(t["plot"+s]=e.yAxis.toPixels(t[s],!0))})}),e.plotEndPoint=e.xAxis.toPixels(e.endPoint,!0)}getGraphPath(e){let t=this,s=[[],[],[],[],[],[],[],[],[]],a=t.pointArrayMap.length,o=t.plotEndPoint,i=[],n,r,l=e.length,p;for(;l--;){for(p=0,r=e[l];p<a;p++)S(r[n=t.pointArrayMap[p]])&&s[p].push({plotX:r.plotX,plotY:r["plot"+n],isNull:!1},{plotX:o,plotY:r["plot"+n],isNull:!1},{plotX:o,plotY:null,isNull:!0});o=r.plotX}return s.forEach(e=>{i=i.concat(super.getGraphPath.call(t,e))}),i}drawDataLabels(){let e,t,s,a,o=this,i=o.pointArrayMap;o.options.dataLabels.enabled&&(t=o.points.length,i.concat([!1]).forEach((n,r)=>{for(a=t;a--;)s=o.points[a],n?(s.y=s[n],s.pivotLine=n,s.plotY=s["plot"+n],e=s["dataLabel"+n],r&&(s["dataLabel"+i[r-1]]=s.dataLabel),s.dataLabels||(s.dataLabels=[]),s.dataLabels[0]=s.dataLabel=e=e&&e.element?e:null):s["dataLabel"+i[r-1]]=s.dataLabel;super.drawDataLabels.call(o)}))}getValues(e,t){let s,a,o,i,n,r,l,p=t.period,u=e.xData,h=e.yData,d=h?h.length:0,c=this[t.algorithm+"Placement"],g=[],m=[],y=[];if(!(u.length<p)&&A(h[0])&&4===h[0].length){for(l=p+1;l<=d+p;l+=p)o=u.slice(l-p-1,l),i=h.slice(l-p-1,l),a=o.length,s=o[a-1],r=c(this.getPivotAndHLC(i)),n=g.push([s].concat(r)),m.push(s),y.push(g[n-1].slice(1));return this.endPoint=o[0]+(s-o[0])/a*p,{values:g,xData:m,yData:y}}}getPivotAndHLC(e){let t=e[e.length-1][3],s=-1/0,a=1/0;return e.forEach(function(e){s=Math.max(s,e[1]),a=Math.min(a,e[2])}),[(s+a+t)/3,s,a,t]}standardPlacement(e){let t=e[1]-e[2];return[null,null,e[0]+t,2*e[0]-e[2],e[0],2*e[0]-e[1],e[0]-t,null,null]}camarillaPlacement(e){let t=e[1]-e[2];return[e[3]+1.5*t,e[3]+1.25*t,e[3]+1.1666*t,e[3]+1.0833*t,e[0],e[3]-1.0833*t,e[3]-1.1666*t,e[3]-1.25*t,e[3]-1.5*t]}fibonacciPlacement(e){let t=e[1]-e[2];return[null,e[0]+t,e[0]+.618*t,e[0]+.382*t,e[0],e[0]-.382*t,e[0]-.618*t,e[0]-t,null]}}eq.defaultOptions=M(e_.defaultOptions,{params:{index:void 0,period:28,algorithm:"standard"},marker:{enabled:!1},enableMouseTracking:!1,dataLabels:{enabled:!0,format:"{point.pivotLine}"},dataGrouping:{approximation:"averages"}}),b(eq.prototype,{nameBase:"Pivot Points",pointArrayMap:["R4","R3","R2","R1","P","S1","S2","S3","S4"],pointValKey:"P",pointClass:class extends eU{destroyElements(){eZ(this,"destroyElements")}destroy(){eZ(this,"destroyElements")}}}),m().registerSeriesType("pivotpoints",eq);let{ema:e$}=m().seriesTypes;class eJ extends e${getValues(e,t){let s,a,o=t.periods,i=t.index,n=[],r=[],l=[];if(2!==o.length||o[1]<=o[0])return void(0,u.error)('Error: "PPO requires two periods. Notice, first period should be lower than the second one."');let p=super.getValues.call(this,e,{index:i,period:o[0]}),h=super.getValues.call(this,e,{index:i,period:o[1]});if(!p||!h)return;let d=o[1]-o[0];for(a=0;a<h.yData.length;a++)s=D((p.yData[a+d]-h.yData[a])/h.yData[a]*100),n.push([h.xData[a],s]),r.push(h.xData[a]),l.push(s);return{values:n,xData:r,yData:l}}}eJ.defaultOptions=M(e$.defaultOptions,{params:{period:void 0,periods:[12,26]}}),b(eJ.prototype,{nameBase:"PPO",nameComponents:["periods"]}),m().registerSeriesType("ppo",eJ);let eQ=function(e,t,s){return e.reduce((e,a)=>[Math.min(e[0],a[t]),Math.max(e[1],a[s])],[Number.MAX_VALUE,-Number.MAX_VALUE])},{sma:e0}=m().seriesTypes;class e1 extends e0{getValues(e,t){let s,a,o,i,n,r,l=t.period,p=e.xData,u=e.yData,h=u?u.length:0,d=[],c=[],g=[];if(!(h<l)){for(r=l;r<=h;r++)i=p[r-1],s=((a=(n=eQ(u.slice(r-l,r),2,1))[1])+(o=n[0]))/2,d.push([i,a,s,o]),c.push(i),g.push([a,s,o]);return{values:d,xData:c,yData:g}}}}e1.defaultOptions=M(e0.defaultOptions,{params:{index:void 0,period:20},lineWidth:1,topLine:{styles:{lineColor:"#00e272",lineWidth:1}},bottomLine:{styles:{lineColor:"#feb56a",lineWidth:1}},dataGrouping:{approximation:"averages"}}),b(e1.prototype,{areaLinesNames:["top","bottom"],nameBase:"Price Channel",nameComponents:["period"],linesApiNames:["topLine","bottomLine"],pointArrayMap:["top","middle","bottom"],pointValKey:"middle"}),F.compose(e1),m().registerSeriesType("pc",e1);let{sma:e2}=m().seriesTypes;class e3 extends e2{init(){super.init.apply(this,arguments),this.options=M({topLine:{styles:{lineColor:this.color}},bottomLine:{styles:{lineColor:this.color}}},this.options)}getValues(e,t){let s,a,o,i,n,r,l,p,u=t.period,h=t.topBand,d=t.bottomBand,c=e.xData,g=e.yData,m=g?g.length:0,y=[],f=[],x=[];if(!(c.length<u)&&A(g[0])&&4===g[0].length){for(p=u;p<=m;p++)n=c.slice(p-u,p),r=g.slice(p-u,p),i=(l=super.getValues({xData:n,yData:r},t)).xData[0],a=(s=l.yData[0])*(1+h),o=s*(1-d),y.push([i,a,s,o]),f.push(i),x.push([a,s,o]);return{values:y,xData:f,yData:x}}}}e3.defaultOptions=M(e2.defaultOptions,{marker:{enabled:!1},tooltip:{pointFormat:'<span style="color:{point.color}">●</span><b> {series.name}</b><br/>Top: {point.top}<br/>Middle: {point.middle}<br/>Bottom: {point.bottom}<br/>'},params:{period:20,topBand:.1,bottomBand:.1},bottomLine:{styles:{lineWidth:1,lineColor:void 0}},topLine:{styles:{lineWidth:1}},dataGrouping:{approximation:"averages"}}),b(e3.prototype,{areaLinesNames:["top","bottom"],linesApiNames:["topLine","bottomLine"],nameComponents:["period","topBand","bottomBand"],nameBase:"Price envelopes",pointArrayMap:["top","middle","bottom"],parallelArrays:["x","y","top","bottom"],pointValKey:"middle"}),F.compose(e3),m().registerSeriesType("priceenvelopes",e3);let{sma:e4}=m().seriesTypes;function e5(e,t){return parseFloat(e.toFixed(t))}class e6 extends e4{constructor(){super(...arguments),this.nameComponents=void 0}getValues(e,t){let s=e.xData,a=e.yData,o=t.maxAccelerationFactor,i=t.increment,n=t.initialAccelerationFactor,r=t.decimals,l=t.index,p=[],u=[],h=[],d=t.initialAccelerationFactor,c,g=a[0][1],m,y,f,x=1,v,D,S,b,C=a[0][2],T,A,P,M;if(!(l>=a.length)){for(M=0;M<l;M++)g=Math.max(a[M][1],g),C=Math.min(a[M][2],e5(C,r));for(c=a[M][1]>C?1:-1,m=g-C,y=(d=t.initialAccelerationFactor)*m,p.push([s[l],C]),u.push(s[l]),h.push(e5(C,r)),M=l+1;M<a.length;M++)if(v=a[M-1][2],D=a[M-2][2],S=a[M-1][1],b=a[M-2][1],A=a[M][1],P=a[M][2],null!==D&&null!==b&&null!==v&&null!==S&&null!==A&&null!==P){var O,V,L,k,E,w,I,N,B,G,W,z,Y,X,F,R,K,j,H,U,Z;E=c,w=x,I=C,N=y,B=D,G=v,W=S,z=b,Y=g,C=E===w?1===E?I+N<Math.min(B,G)?I+N:Math.min(B,G):I+N>Math.max(z,W)?I+N:Math.max(z,W):Y,O=c,V=g,T=1===O?A>V?A:V:P<V?P:V,L=x,k=C,X=f=1===L&&P>k||-1===L&&A>k?1:-1,F=c,R=T,K=g,j=d,H=i,U=o,Z=n,y=(d=X===F?1===X&&R>K||-1===X&&R<K?j===U?U:e5(j+H,2):j:Z)*(m=T-C),p.push([s[M],e5(C,r)]),u.push(s[M]),h.push(e5(C,r)),x=c,c=f,g=T}return{values:p,xData:u,yData:h}}}}e6.defaultOptions=M(e4.defaultOptions,{lineWidth:0,marker:{enabled:!0},states:{hover:{lineWidthPlus:0}},params:{period:void 0,initialAccelerationFactor:.02,maxAccelerationFactor:.2,increment:.02,index:2,decimals:4}}),m().registerSeriesType("psar",e6);let{sma:e9}=m().seriesTypes;class e8 extends e9{getValues(e,t){let s=t.period,a=e.xData,o=e.yData,i=o?o.length:0,n=[],r=[],l=[],p,u=-1,h;if(!(a.length<=s)){for(A(o[0])&&(u=t.index),p=s;p<i;p++)h=function(e,t,s,a,o){let i,n;return n=o<0?(i=t[s-a])?(t[s]-i)/i*100:null:(i=t[s-a][o])?(t[s][o]-i)/i*100:null,[e[s],n]}(a,o,p,s,u),n.push(h),r.push(h[0]),l.push(h[1]);return{values:n,xData:r,yData:l}}}}e8.defaultOptions=M(e9.defaultOptions,{params:{index:3,period:9}}),b(e8.prototype,{nameBase:"Rate of Change"}),m().registerSeriesType("roc",e8);let{sma:e7}=m().seriesTypes;function te(e,t){return parseFloat(e.toFixed(t))}class tt extends e7{getValues(e,t){let s=t.period,a=e.xData,o=e.yData,i=o?o.length:0,n=t.decimals,r=[],l=[],p=[],u=0,h=0,d=t.index,c=1,g,m,y,f,x,v;if(!(a.length<s)){for(T(o[0])?v=o:(d=Math.min(d,o[0].length-1),v=o.map(e=>e[d]));c<s;)(m=te(v[c]-v[c-1],n))>0?u+=m:h+=Math.abs(m),c++;for(y=te(u/(s-1),n),f=te(h/(s-1),n),x=c;x<i;x++)(m=te(v[x]-v[x-1],n))>0?(u=m,h=0):(u=0,h=Math.abs(m)),y=te((y*(s-1)+u)/s,n),g=0===(f=te((f*(s-1)+h)/s,n))?100:0===y?0:te(100-100/(1+y/f),n),r.push([a[x],g]),l.push(a[x]),p.push(g);return{values:r,xData:l,yData:p}}}}tt.defaultOptions=M(e7.defaultOptions,{params:{decimals:4,index:3}}),m().registerSeriesType("rsi",tt);let{sma:ts}=m().seriesTypes;class ta extends ts{init(){super.init.apply(this,arguments),this.options=M({smoothedLine:{styles:{lineColor:this.color}}},this.options)}getValues(e,t){let s=t.periods[0],a=t.periods