highcharts
Version:
JavaScript charting framework
14 lines • 71 kB
JavaScript
/**
* Highstock JS v13.0.1 (2026-08-17)
* @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
*/import*as e from"../highcharts.js";import*as t from"../modules/datagrouping.js";let s={};s.n=e=>{let t=e&&e.__esModule?()=>e.default:()=>e;return s.d(t,{a:t}),t},s.d=(e,t)=>{if(Array.isArray(t))for(var a=0;a<t.length;){var o=t[a++],i=t[a++];s.o(e,o)?0===i&&a++:0===i?Object.defineProperty(e,o,{enumerable:!0,value:t[a++]}):Object.defineProperty(e,o,{enumerable:!0,get:i})}else for(var o in t)s.o(t,o)&&!s.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},s.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);let a=e.default;var o,i=s.n(a);let r=e.default.Chart;var n=s.n(r);let{setLength:l,splice:p}={convertToNumber:function(e,t){switch(typeof e){case"boolean":return+!!e;case"number":return isNaN(e)&&!t?null:e;default:return isNaN(e=parseFloat(`${e??""}`))&&!t?null:e}},setLength:function(e,t,s){return Array.isArray(e)?(e.length=t,e):e[s?"subarray":"slice"](0,t)},splice:function(e,t,s,a,o=[]){if(Array.isArray(e))return Array.isArray(o)||(o=Array.from(o)),{removed:e.splice(t,s,...o),array:e};let i=Object.getPrototypeOf(e).constructor,r=e[a?"subarray":"slice"](t,t+s),n=new i(e.length-s+o.length);return n.set(e.subarray(0,t),0),n.set(o,t),n.set(e.subarray(t+s),t+o.length),{removed:r,array:n}}},u=class{constructor(e={}){this.isDataTable=!0,this.autoId=!e.id,this.columns={},this.id=e.id||(0,a.uniqueKey)(),this.rowCount=0,this.versionTag=(0,a.uniqueKey)();let t=0;(0,a.objectEach)(e.columns||{},(e,s)=>{this.columns[s]=e.slice(),t=Math.max(t,e.length)}),this.applyRowCount(t)}applyRowCount(e){this.rowCount=e,(0,a.objectEach)(this.columns,(t,s)=>{t.length!==e&&(this.columns[s]=l(t,e))})}deleteRows(e,t=1){if(t>0&&e<this.rowCount){let s=0;(0,a.objectEach)(this.columns,(a,o)=>{this.columns[o]=p(a,e,t).array,s=a.length}),this.rowCount=s}(0,a.fireEvent)(this,"afterDeleteRows",{rowIndex:e,rowCount:t}),this.versionTag=(0,a.uniqueKey)()}getColumn(e,t){return this.columns[e]}getColumns(e,t){return(e||Object.keys(this.columns)).reduce((e,t)=>(e[t]=this.columns[t],e),{})}getRowObject(e,t){let s={},a=this.columns;for(let o of(t??(t=Object.keys(this.columns)),t))s[o]=a[o]?.[e];return s}setColumn(e,t=[],s=0,a){this.setColumns({[e]:t},s,a)}setColumns(e,t,s){let o=this.rowCount;(0,a.objectEach)(e,(e,t)=>{this.columns[t]=e.slice(),o=e.length}),this.applyRowCount(o),s?.silent||((0,a.fireEvent)(this,"afterSetColumns"),this.versionTag=(0,a.uniqueKey)())}setRow(e,t=this.rowCount,s,o){var i;let{columns:r}=this,n=s?this.rowCount+1:t+1,l=Object.keys(e);if(o?.addColumns!==!1)for(let e=0,t=l.length;e<t;e++)r[i=l[e]]||(r[i]=Array(this.rowCount));(0,a.objectEach)(r,(a,o)=>{a&&(s?a=p(a,t,0,!0,[e[o]]).array:a[t]=o in e?e[o]:a[t],r[o]=a)}),this.applyRowCount(Math.max(n,this.rowCount)),o?.silent||((0,a.fireEvent)(this,"afterSetRows",{rowIndex:t}),this.versionTag=(0,a.uniqueKey)())}getModified(){return this.modified||this}},h=e.default.SeriesRegistry;var d=s.n(h);let{line:c}=d().seriesTypes,m=(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 g extends c{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]+(0,a.pick)(this.nameSuffixes[s],""))},this),t=(this.nameBase||this.type.toUpperCase())+(this.nameComponents?" ("+e.join(", ")+")":"")),t}getValues(e,t){let s=t.period,o=e.xData||[],i=e.yData,r=i.length,n=[],l=[],p=[],u,h=-1,d=0,c,m=0;if(!(o.length<s)){for((0,a.isArray)(i[0])&&(h=t.index?t.index:0);d<s-1;)m+=h<0?i[d]:i[d][h],d++;for(u=d;u<r;u++)m+=h<0?i[u]:i[u][h],c=[o[u],m/s],n.push(c),l.push(c[0]),p.push(c[1]),m-=h<0?i[u-d]:i[u-d][h];return{values:n,xData:l,yData:p}}}init(e,t){let s=this;super.init.call(s,e,t);let o=(0,a.addEvent)(n(),"afterLinkSeries",function({isUpdating:t}){if(t)return;let o=!!s.dataEventsToUnbind.length;if(!s.linkedParent)return(0,a.error)("Series "+s.options.linkedTo+" not found! Check `linkedTo`.",!1,e);if(!o&&(s.dataEventsToUnbind.push((0,a.addEvent)(s.linkedParent,"updatedData",function(){s.recalculateValues()})),s.calculateOn.xAxis&&s.dataEventsToUnbind.push((0,a.addEvent)(s.linkedParent.xAxis,s.calculateOn.xAxis,function(){s.recalculateValues()}))),"init"===s.calculateOn.chart)s.closestPointRange||s.recalculateValues();else if(!o){let e=(0,a.addEvent)(s.chart,s.calculateOn.chart,function(){s.recalculateValues(),e()})}},{order:0});s.dataEventsToUnbind=[],s.eventsToUnbind.push(o)}recalculateValues(){let e=this.dataTable,t=this.dataTable.rowCount,s=!0,o,i,r=this.linkedParent.yData,n=this.linkedParent.processedYData;this.linkedParent.xData=this.linkedParent.getColumn("x"),this.linkedParent.yData=m(this.linkedParent),this.linkedParent.processedYData=m(this.linkedParent,!0);let l=this.linkedParent.options&&this.linkedParent.dataTable.rowCount&&this.getValues(this.linkedParent,this.options.params)||{values:[],xData:[],yData:[]};l.xData.length=l.values.length,delete this.linkedParent.xData,this.linkedParent.yData=r,this.linkedParent.processedYData=n;let p=this.pointArrayMap||["y"],h={};if(l.yData.forEach(e=>{p.forEach((t,s)=>{let o=h[t]||[];o.push((0,a.isArray)(e)?e[s]:e),h[t]||(h[t]=o)})}),t&&!this.hasGroupedData&&this.visible&&this.points)if(this.cropped){this.xAxis&&(o=this.xAxis.min,i=this.xAxis.max);let t=this.cropData(e,o,i);this.setData(t.modified,!1)}else(this.updateAllPoints||l.xData.length!==t-1&&l.xData.length!==t+1)&&(s=!1,this.setData(new u({columns:{x:l.xData,...h}}),!1));s&&(h.x=l.xData,l.values.reduce((e,t,s)=>(Object.keys(t).forEach(a=>{e[a]||(e[a]=[]),e[a][s]=t[a]}),e),h),e.setColumns(h),delete this.xColumn,delete this.xColumnIsNumbers),this.calculateOn.xAxis&&this.getColumn("x",!0).length&&(this.isDirty=!0,this.redraw()),this.isDirtyData=!!this.linkedSeries.length,(0,a.fireEvent)(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)}}g.defaultOptions=(0,a.merge)(c.defaultOptions,{name:void 0,tooltip:{valueDecimals:4},linkedTo:void 0,compareToMain:!1,params:{index:3,period:14}}),(0,a.extend)(g.prototype,{calculateOn:{chart:"init"},hasDerivedData:!0,nameComponents:["period"],nameSuffixes:[],useCommonDataGrouping:!0}),d().registerSeriesType("sma",g);let{sma:y}=d().seriesTypes;class f extends y{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,o,i,r,n){let l=e[s-1],p=r<0?t[s-1]:t[s-1][r];return[l,void 0===i?n:(0,a.correctFloat)(p*o+i*(1-o))]}getValues(e,t){let s=t.period,o=e.xData,i=e.yData,r=i?i.length:0,n=2/(s+1),l=[],p=[],u=[],h,d,c,m=-1,g=0;if(!(r<s)){for((0,a.isArray)(i[0])&&(m=t.index?t.index:0),g=this.accumulatePeriodPoints(s,m,i)/s,c=s;c<r+1;c++)d=this.calculateEma(o,i,c,n,h,m,g),l.push(d),p.push(d[0]),u.push(d[1]),h=d[1];return{values:l,xData:p,yData:u}}}}f.defaultOptions=(0,a.merge)(y.defaultOptions,{params:{index:3,period:9}}),d().registerSeriesType("ema",f);let{sma:x}=d().seriesTypes;class v extends x{static populateAverage(e,t,s,a,o){let i=t[a][1],r=t[a][2],n=t[a][3],l=s[a],p=n===i&&n===r||i===r?0:(2*n-r-i)/(i-r)*l;return[e[a],p]}getValues(e,t){let s,o,i,r=t.period,n=e.xData,l=e.yData,p=t.volumeSeriesID,u=e.chart.get(p),h=u?.getColumn("y"),d=l?l.length:0,c=[],m=[],g=[];if(!(n.length<=r)||!d||4===l[0].length){if(!u)return void(0,a.error)("Series "+p+" not found! Check `volumeSeriesID`.",!0,e.chart);for(o=r;o<d;o++)s=c.length,i=v.populateAverage(n,l,h,o,r),s>0&&(i[1]+=c[s-1][1]),c.push(i),m.push(i[0]),g.push(i[1]);return{values:c,xData:m,yData:g}}}}v.defaultOptions=(0,a.merge)(x.defaultOptions,{params:{index:void 0,volumeSeriesID:"volume"}}),(0,a.extend)(v.prototype,{nameComponents:!1,nameBase:"Accumulation/Distribution"}),d().registerSeriesType("ad",v);let{noop:D}=i(),{column:{prototype:A},sma:b}=d().seriesTypes;class S extends b{drawGraph(){let e,t=this.options,s=this.points,a=this.userOptions.color,o=t.greaterBarColor,i=t.lowerBarColor,r=s[0];if(!a&&r)for(e=1,r.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||[],o=s.length,i=[],r=[],n=[],l,p,u,h,d,c,m,g,y=0,f=0;if(!(t.length<=34)&&(0,a.isArray)(s[0])&&4===s[0].length){for(m=0;m<33;m++)c=(s[m][1]+s[m][2])/2,m>=29&&(f=(0,a.correctFloat)(f+c)),y=(0,a.correctFloat)(y+c);for(g=33;g<o;g++)c=(s[g][1]+s[g][2])/2,f=(0,a.correctFloat)(f+c),y=(0,a.correctFloat)(y+c),l=f/5,p=y/34,u=(0,a.correctFloat)(l-p),i.push([t[g],u]),r.push(t[g]),n.push(u),h=g+1-5,d=g+1-34,f=(0,a.correctFloat)(f-(s[h][1]+s[h][2])/2),y=(0,a.correctFloat)(y-(s[d][1]+s[d][2])/2);return{values:i,xData:r,yData:n}}}}S.defaultOptions=(0,a.merge)(b.defaultOptions,{params:{index:void 0,period:void 0},greaterBarColor:"var(--highcharts-positive-color)",lowerBarColor:"var(--highcharts-negative-color)",threshold:0,groupPadding:.2,pointPadding:.2,crisp:!1,states:{hover:{halo:{size:0}}}}),(0,a.extend)(S.prototype,{nameBase:"AO",nameComponents:void 0,markerAttribs:D,getColumnMetrics:A.getColumnMetrics,crispCol:A.crispCol,translate:A.translate,drawPoints:A.drawPoints}),d().registerSeriesType("ao",S);let{sma:{prototype:C}}=d().seriesTypes;!function(e){let t=["bottomLine"],s=["top","bottom"],o=["top"];function i(e){return"plot"+e.charAt(0).toUpperCase()+e.slice(1)}function r(e,t){let s=[];return(e.pointArrayMap||[]).forEach(e=>{e!==t&&s.push(i(e))}),s}function n(){let e=this,t=e.pointValKey,s=e.linesApiNames,o=e.areaLinesNames,n=e.points,l=e.options,p=e.graph,u={options:{gapSize:l.gapSize}},h=[],d=r(e,t),c=n.length,m;if(d.forEach((e,t)=>{for(h[t]=[];c--;)m=n[c],h[t].push({x:m.x,plotX:m.plotX,plotY:m[e],isNull:!(0,a.defined)(m[e])});c=n.length}),e.userOptions.fillColor&&o.length){let t=h[d.indexOf(i(o[0]))],s=1===o.length?n:h[d.indexOf(i(o[1]))],r=e.color;e.points=s,e.nextPoints=t,e.color=e.userOptions.fillColor,e.options=(0,a.merge)(n,u),e.graph=e.area,e.fillGraph=!0,C.drawGraph.call(e),e.area=e.graph,delete e.nextPoints,delete e.fillGraph,e.color=r}s.forEach((t,s)=>{h[s]?(e.points=h[s],l[t]?e.options=(0,a.merge)(l[t].styles,u):(0,a.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],C.drawGraph.call(e),e["graph"+t]=e.graph):(0,a.error)('Error: "'+t+" doesn't have equivalent in pointArrayMap. To many elements in linesApiNames relative to pointArrayMap.\"")}),e.points=n,e.options=l,e.graph=p,C.drawGraph.call(e)}function l(e){let t,s=[],a=[];if(e=e||this.points,this.fillGraph&&this.nextPoints){if((t=C.getGraphPath.call(this,this.nextPoints))&&t.length){t[0][0]="L",s=C.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=C.getGraphPath.apply(this,arguments);return s}function p(e){let t=[];return(this.pointArrayMap||[]).forEach(s=>{t.push(e[s])}),t}function u(){let e=this.pointArrayMap,t=[],s;t=r(this),C.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 a=e.prototype;return a.linesApiNames=a.linesApiNames||t.slice(),a.pointArrayMap=a.pointArrayMap||s.slice(),a.pointValKey=a.pointValKey||"top",a.areaLinesNames=a.areaLinesNames||o.slice(),a.drawGraph=n,a.getGraphPath=l,a.toYData=p,a.translate=u,e}}(o||(o={}));let T=o,{sma:P}=d().seriesTypes;function M(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 V extends P{getValues(e,t){let s,o,i,r,n,l=t.period,p=e.xData,u=e.yData,h=u?u.length:0,d=[],c=[],m=[];for(r=l-1;r<h;r++)i=M((n=u.slice(r-l+1,r+2)).map(function(e){return(0,a.pick)(e[2],e)}),"min"),s=M(n.map(function(e){return(0,a.pick)(e[1],e)}),"max")/l*100,o=i/l*100,p[r+1]&&(d.push([p[r+1],s,o]),c.push(p[r+1]),m.push([s,o]));return{values:d,xData:c,yData:m}}}V.defaultOptions=(0,a.merge)(P.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"}}),(0,a.extend)(V.prototype,{areaLinesNames:[],linesApiNames:["aroonDown"],nameBase:"Aroon",pointArrayMap:["y","aroonDown"],pointValKey:"y"}),T.compose(V),d().registerSeriesType("aroon",V);let{aroon:O}=d().seriesTypes;class k extends O{getValues(e,t){let s,a,o=[],i=[],r=[],n=super.getValues.call(this,e,t);for(a=0;a<n.yData.length;a++)s=n.yData[a][0]-n.yData[a][1],o.push([n.xData[a],s]),i.push(n.xData[a]),r.push(s);return{values:o,xData:i,yData:r}}}k.defaultOptions=(0,a.merge)(O.defaultOptions,{tooltip:{pointFormat:'<span style="color:{point.color}">●</span><b> {series.name}</b>: {point.y}'}}),(0,a.extend)(k.prototype,{nameBase:"Aroon Oscillator",linesApiNames:[],pointArrayMap:["y"],pointValKey:"y"}),T.compose(O),d().registerSeriesType("aroonoscillator",k);let{sma:L}=d().seriesTypes;function w(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 E extends L{getValues(e,t){let s=t.period,o=e.xData,i=e.yData,r=i?i.length:0,n=[[o[0],i[0]]],l=[],p=[],u=[],h,d,c=0,m=1,g=0;if(!(o.length<=s)&&(0,a.isArray)(i[0])&&4===i[0].length){for(d=1;d<=r;d++){var y,f,x,v,D;!function(e,t,s,a){let o=t[a],i=s[a];e.push([o,i])}(n,o,i,d),s<m?(c=(y=o,f=i,x=d,v=s,D=c,h=[y[x-1],(D*(v-1)+w(f[x-1],f[x-2]))/v])[1],l.push(h),p.push(h[0]),u.push(h[1])):(s===m?(c=g/(d-1),l.push([o[d-1],c]),p.push(o[d-1]),u.push(c)):g+=w(i[d-1],i[d-2]),m++)}return{values:l,xData:p,yData:u}}}}E.defaultOptions=(0,a.merge)(L.defaultOptions,{params:{index:void 0}}),d().registerSeriesType("atr",E);let{sma:I}=d().seriesTypes;class N extends I{init(){d().seriesTypes.sma.prototype.init.apply(this,arguments),this.options=(0,a.merge)({topLine:{styles:{lineColor:this.color}},bottomLine:{styles:{lineColor:this.color}}},this.options)}getValues(e,t){let s,o,i,r,n,l,p,u,h,c=t.period,m=t.standardDeviation,g=[],y=[],f=e.xData,x=e.yData,v=x?x.length:0,D=[];if(f.length<c)return;let A=(0,a.isArray)(x[0]);for(h=c;h<=v;h++)n=f.slice(h-c,h),l=x.slice(h-c,h),r=(u=d().seriesTypes.sma.prototype.getValues.call(this,{xData:n,yData:l},t)).xData[0],s=u.yData[0],p=function(e,t,s,a){let o=e.length,i=0,r,n=0;for(;i<o;i++)n+=(r=(s?e[i][t]:e[i])-a)*r;return Math.sqrt(n/=o-1)}(l,t.index,A,s),o=s+m*p,i=s-m*p,D.push([r,o,s,i]),g.push(r),y.push([o,s,i]);return{values:D,xData:g,yData:y}}}N.defaultOptions=(0,a.merge)(I.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"}}),(0,a.extend)(N.prototype,{areaLinesNames:["top","bottom"],linesApiNames:["topLine","bottomLine"],nameComponents:["period","standardDeviation"],pointArrayMap:["top","middle","bottom"],pointValKey:"middle"}),T.compose(N),d().registerSeriesType("bb",N);let{sma:F}=d().seriesTypes;class B extends F{getValues(e,t){let s=t.period,o=e.xData,i=e.yData,r=i?i.length:0,n=[],l=[],p=[],u=[],h,d,c=[],m,g=1,y,f,x,v;if(!(o.length<=s)&&(0,a.isArray)(i[0])&&4===i[0].length){for(;g<s;)d=i[g-1],n.push((d[1]+d[2]+d[3])/3),g++;for(v=s;v<=r;v++)f=((d=i[v-1])[1]+d[2]+d[3])/3,m=n.push(f),y=(c=n.slice(m-s)).reduce(function(e,t){return e+t},0)/s,x=function(e,t){let s=e.length,a=0,o;for(o=0;o<s;o++)a+=Math.abs(t-e[o]);return a}(c,y)/s,h=(f-y)/(.015*x),l.push([o[v-1],h]),p.push(o[v-1]),u.push(h);return{values:l,xData:p,yData:u}}}}B.defaultOptions=(0,a.merge)(F.defaultOptions,{params:{index:void 0}}),d().registerSeriesType("cci",B);let{sma:G}=d().seriesTypes;class W extends G{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=[],r=[],n=[],l=[],p,u,h=-1,d=0,c=0;function m(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]=m(t[p],s[p]),d+=s[p],c+=i[p];for(r.push(e[p-1]),n.push(p-h>=a&&0!==d?c/d:null),l.push([r[0],n[0]]);p<o;p++)i[p]=m(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],r.push(u[0]),n.push(u[1]),l.push([u[0],u[1]])}return{values:l,xData:r,yData:n}}}W.defaultOptions=(0,a.merge)(G.defaultOptions,{params:{index:void 0,volumeSeriesID:"volume"}}),d().registerSeriesType("cmf",W);let{sma:z}=d().seriesTypes;class Y extends z{calculateDM(e,t,s){let o,i=e[t][1],r=e[t][2],n=e[t-1][1],l=e[t-1][2];return o=i-n>l-r?s?Math.max(i-n,0):0:s?0:Math.max(l-r,0),(0,a.correctFloat)(o)}calculateDI(e,t){return e/t*100}calculateDX(e,t){return(0,a.correctFloat)(Math.abs(e-t)/Math.abs(e+t)*100)}smoothValues(e,t,s){return(0,a.correctFloat)(e-e/s+t)}getTR(e,t){return(0,a.correctFloat)(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,o=e.xData,i=e.yData,r=i?i.length:0,n=[],l=[],p=[];if(o.length<=s||!(0,a.isArray)(i[0])||4!==i[0].length)return;let u=0,h=0,d=0,c;for(c=1;c<r;c++){let e,t,a,r,m,g,y,f,x;c<=s?(r=this.calculateDM(i,c,!0),m=this.calculateDM(i,c),g=this.getTR(i[c],i[c-1]),u+=r,h+=m,d+=g,c===s&&(y=this.calculateDI(u,d),f=this.calculateDI(h,d),x=this.calculateDX(u,h),n.push([o[c],x,y,f]),l.push(o[c]),p.push([x,y,f]))):(r=this.calculateDM(i,c,!0),m=this.calculateDM(i,c),g=this.getTR(i[c],i[c-1]),e=this.smoothValues(u,r,s),t=this.smoothValues(h,m,s),a=this.smoothValues(d,g,s),u=e,h=t,d=a,y=this.calculateDI(u,d),f=this.calculateDI(h,d),x=this.calculateDX(u,h),n.push([o[c],x,y,f]),l.push(o[c]),p.push([x,y,f]))}return{values:n,xData:l,yData:p}}}Y.defaultOptions=(0,a.merge)(z.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:"var(--highcharts-positive-color)"}},minusDILine:{styles:{lineWidth:1,lineColor:"var(--highcharts-negative-color)"}},dataGrouping:{approximation:"averages"}}),(0,a.extend)(Y.prototype,{areaLinesNames:[],nameBase:"DMI",linesApiNames:["plusDILine","minusDILine"],pointArrayMap:["y","plusDI","minusDI"],parallelArrays:["x","y","plusDI","minusDI"],pointValKey:"y"}),T.compose(Y),d().registerSeriesType("dmi",Y);let{sma:X}=d().seriesTypes;function R(e,t,s,o,i){let r=(0,a.pick)(t[s][o],t[s]);return i?(0,a.correctFloat)(e-r):(0,a.correctFloat)(e+r)}class K extends X{getValues(e,t){let s=t.period,o=t.index,i=Math.floor(s/2+1),r=s+i,n=e.xData||[],l=e.yData||[],p=l.length,u=[],h=[],d=[],c,m,g,y,f,x=0;if(!(n.length<=r)){for(y=0;y<s-1;y++)x=R(x,l,y,o);for(f=0;f<=p-r;f++)m=f+s-1,g=f+r-1,x=R(x,l,m,o),c=(0,a.pick)(l[g][o],l[g])-x/s,x=R(x,l,f,o,!0),u.push([n[g],c]),h.push(n[g]),d.push(c);return{values:u,xData:h,yData:d}}}}K.defaultOptions=(0,a.merge)(X.defaultOptions,{params:{index:0,period:21}}),(0,a.extend)(K.prototype,{nameBase:"DPO"}),d().registerSeriesType("dpo",K);let{ema:j}=d().seriesTypes;class U extends j{getValues(e,t){let s,o,i=t.periods,r=t.period,n=[],l=[],p=[];if(2!==i.length||i[1]<=i[0])return void(0,a.error)('Error: "Chaikin requires two periods. Notice, first period should be lower than the second one."');let u=v.prototype.getValues.call(this,e,{volumeSeriesID:t.volumeSeriesID,period:r});if(!u)return;let h=super.getValues.call(this,u,{period:i[0]}),d=super.getValues.call(this,u,{period:i[1]});if(!h||!d)return;let c=i[1]-i[0];for(o=0;o<d.yData.length;o++)s=(0,a.correctFloat)(h.yData[o+c]-d.yData[o]),n.push([d.xData[o],s]),l.push(d.xData[o]),p.push(s);return{values:n,xData:l,yData:p}}}U.defaultOptions=(0,a.merge)(j.defaultOptions,{params:{index:void 0,volumeSeriesID:"volume",period:9,periods:[3,10]}}),(0,a.extend)(U.prototype,{nameBase:"Chaikin Osc",nameComponents:["periods"]}),d().registerSeriesType("chaikin",U);let{sma:Z}=d().seriesTypes;class q extends Z{getValues(e,t){let s=t.period,o=e.xData,i=e.yData,r=i?i.length:0,n=[],l=[],p=[],u,h=t.index,d;if(o.length<s)return;(0,a.isNumber)(i[0])?d=i:(h=Math.min(h,i[0].length-1),d=i.map(e=>e[h]));let c=0,m=0,g=0,y;for(let e=s;e>0;e--)d[e]>d[e-1]?m+=d[e]-d[e-1]:d[e]<d[e-1]&&(g+=d[e-1]-d[e]);for(y=m+g>0?100*(m-g)/(m+g):0,l.push(o[s]),p.push(y),n.push([o[s],y]),u=s+1;u<r;u++)c=Math.abs(d[u-s-1]-d[u-s]),d[u]>d[u-1]?m+=d[u]-d[u-1]:d[u]<d[u-1]&&(g+=d[u-1]-d[u]),d[u-s]>d[u-s-1]?m-=c:g-=c,y=m+g>0?100*(m-g)/(m+g):0,l.push(o[u]),p.push(y),n.push([o[u],y]);return{values:n,xData:l,yData:p}}}q.defaultOptions=(0,a.merge)(Z.defaultOptions,{params:{period:20,index:3}}),d().registerSeriesType("cmo",q);let{ema:$}=d().seriesTypes;class _ extends ${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,o=[],i=2*s,r=e.xData,n=e.yData,l=n?n.length:0,p=[],u=[],h=[],d=0,c=0,m,g,y,f,x=-1,v,D=0;if(this.EMApercent=2/(s+1),!(l<2*s-1)){for((0,a.isArray)(n[0])&&(x=t.index?t.index:0),D=(d=super.accumulatePeriodPoints(s,x,n))/s,d=0,f=s;f<l+2;f++)f<l+1&&(c=this.getEMA(n,g,D,x,f)[1],o.push(c)),g=c,f<i?d+=c:(f===i&&(D=d/s),c=o[f-s-1],m=this.getEMA([c],y,D)[1],v=[r[f-2],(0,a.correctFloat)(2*c-m)],p.push(v),u.push(v[0]),h.push(v[1]),y=m);return{values:p,xData:u,yData:h}}}}_.defaultOptions=(0,a.merge)($.defaultOptions),d().registerSeriesType("dema",_);let{ema:H}=d().seriesTypes;class J extends H{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,o){return[e[o-3],(0,a.correctFloat)(3*s.level1-3*s.level2+s.level3)]}getValues(e,t){let s=t.period,o=2*s,i=3*s,r=e.xData,n=e.yData,l=n?n.length:0,p=[],u=[],h=[],d=[],c=[],m={},g=-1,y=0,f=0,x,v,D,A;if(this.EMApercent=2/(s+1),!(l<3*s-2)){for((0,a.isArray)(n[0])&&(g=t.index?t.index:0),f=(y=super.accumulatePeriodPoints(s,g,n))/s,y=0,D=s;D<l+3;D++)D<l+1&&(m.level1=this.getEMA(n,x,f,g,D)[1],d.push(m.level1)),x=m.level1,D<o?y+=m.level1:(D===o&&(f=y/s,y=0),m.level1=d[D-s-1],m.level2=this.getEMA([m.level1],v,f)[1],c.push(m.level2),v=m.level2,D<i?y+=m.level2:(D===i&&(f=y/s),D===l+1&&(m.level1=d[D-s-1],m.level2=this.getEMA([m.level1],v,f)[1],c.push(m.level2)),m.level1=d[D-s-2],m.level2=c[D-2*s-1],m.level3=this.getEMA([m.level2],m.prevLevel3,f)[1],(A=this.getTemaPoint(r,i,m,D))&&(p.push(A),u.push(A[0]),h.push(A[1])),m.prevLevel3=m.level3));return{values:p,xData:u,yData:h}}}}J.defaultOptions=(0,a.merge)(H.defaultOptions),d().registerSeriesType("tema",J);let{tema:Q}=d().seriesTypes;class ee extends Q{getTemaPoint(e,t,s,o){if(o>t)return[e[o-3],0!==s.prevLevel3?(0,a.correctFloat)(s.level3-s.prevLevel3)/s.prevLevel3*100:null]}}ee.defaultOptions=(0,a.merge)(Q.defaultOptions),d().registerSeriesType("trix",ee);let{ema:et}=d().seriesTypes;class es extends et{getValues(e,t){let s,o,i=t.periods,r=t.index,n=[],l=[],p=[];if(2!==i.length||i[1]<=i[0])return void(0,a.error)('Error: "APO requires two periods. Notice, first period should be lower than the second one."');let u=super.getValues.call(this,e,{index:r,period:i[0]}),h=super.getValues.call(this,e,{index:r,period:i[1]});if(!u||!h)return;let d=i[1]-i[0];for(o=0;o<h.yData.length;o++)s=u.yData[o+d]-h.yData[o],n.push([h.xData[o],s]),l.push(h.xData[o]),p.push(s);return{values:n,xData:l,yData:p}}}es.defaultOptions=(0,a.merge)(et.defaultOptions,{params:{period:void 0,periods:[10,20]}}),(0,a.extend)(es.prototype,{nameBase:"APO",nameComponents:["periods"]}),d().registerSeriesType("apo",es);let ea=t.default.dataGrouping.approximations;var eo=s.n(ea);let ei=e.default.Color,{parse:er}=s.n(ei)(),{sma:en}=d().seriesTypes;function el(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=(0,a.merge)(e.options.senkouSpan.styles,e.gap),t.graph=e.graph,t.fillGraph=!0,d().seriesTypes.sma.prototype.drawGraph.call(t)}class eu extends en{constructor(){super(...arguments),this.data=[],this.options={},this.points=[],this.graphCollection=[]}init(){super.init.apply(this,arguments),this.options=(0,a.merge)({tenkanLine:{styles:{lineColor:this.color}},kijunLine:{styles:{lineColor:this.color}},chikouLine:{styles:{lineColor:this.color}},senkouSpanA:{styles:{lineColor:this.color,fill:er(this.color).setOpacity(.5).get()}},senkouSpanB:{styles:{lineColor:this.color,fill:er(this.color).setOpacity(.5).get()}},senkouSpan:{styles:{fill:er(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(d().seriesTypes.sma.prototype.translate.apply(this),this.points))for(let t of this.pointArrayMap){let s=e[t];(0,a.isNumber)(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,o=e.graph,i=e.color,r={options:{gapSize:s.gapSize}},n=e.pointArrayMap.length,l=[[],[],[],[],[],[]],p={tenkanLine:l[0],kijunLine:l[1],chikouLine:l[2],senkouSpanA:l[3],senkouSpanB:l[4],senkouSpan:l[5]},u=[],h=e.options.senkouSpan,c=h.color||h.styles.fill,m=h.negativeColor,g=[[],[]],y=[[],[]],f=t.length,x=0,v,D,A,b,S,C,T,P,M,V,O,k,L;for(e.ikhMap=p;f--;){for(A=0,D=t[f];A<n;A++)v=e.pointArrayMap[A],(0,a.defined)(D[v])&&l[A].push({plotX:D.plotX,plotY:D["plot"+v],isNull:!1});if(m&&f!==t.length-1){let e=p.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,r=a.plotX-s.plotX,n=a.plotY-s.plotY,l=e.plotX-s.plotX,p=e.plotY-s.plotY,u=(-i*l+o*p)/(-r*i+o*n),h=(r*p-n*l)/(-r*i+o*n);if(u>=0&&u<=1&&h>=0&&h<=1)return{plotX:e.plotX+h*o,plotY:e.plotY+h*i}}}(p.senkouSpanA[e-1],p.senkouSpanA[e],p.senkouSpanB[e-1],p.senkouSpanB[e]);if(t){let s={plotX:t.plotX,plotY:t.plotY,isNull:!1,intersectPoint:!0};p.senkouSpanA.splice(e,0,s),p.senkouSpanB.splice(e,0,s),u.push(e)}}}if((0,a.objectEach)(p,(t,o)=>{s[o]&&"senkouSpan"!==o&&(e.points=l[x],e.options=(0,a.merge)(s[o].styles,r),e.graph=e["graph"+o],e.fillGraph=!1,e.color=i,d().seriesTypes.sma.prototype.drawGraph.call(e),e["graph"+o]=e.graph),x++}),e.graphCollection)for(let t of e.graphCollection)e[t].destroy(),delete e[t];if(e.graphCollection=[],m&&p.senkouSpanA[0]&&p.senkouSpanB[0]){for(u.unshift(0),u.push(p.senkouSpanA.length-1),k=0;k<u.length-1;k++)if(b=u[k],S=u[k+1],C=p.senkouSpanB.slice(b,S+1),T=p.senkouSpanA.slice(b,S+1),Math.floor(C.length/2)>=1){let e=Math.floor(C.length/2);if(C[e].plotY===T[e].plotY){for(L=0,P=0,M=0;L<C.length;L++)P+=C[L].plotY,M+=T[L].plotY;g[O=P>M?0:1]=g[O].concat(C),y[O]=y[O].concat(T)}else g[O=C[e].plotY>T[e].plotY?0:1]=g[O].concat(C),y[O]=y[O].concat(T)}else g[O=C[0].plotY>T[0].plotY?0:1]=g[O].concat(C),y[O]=y[O].concat(T);["graphsenkouSpanColor","graphsenkouSpanNegativeColor"].forEach(function(t,a){g[a].length&&y[a].length&&(V=0===a?c:m,ep({indicator:e,points:g[a],nextPoints:y[a],color:V,options:s,gap:r,graph:e[t]}),e[t]=e.graph,e.graphCollection.push(t))})}else ep({indicator:e,points:p.senkouSpanB,nextPoints:p.senkouSpanA,color:c,options:s,gap:r,graph:e.graphsenkouSpan}),e.graphsenkouSpan=e.graph;delete e.nextPoints,delete e.fillGraph,e.points=t,e.options=s,e.graph=o,e.color=i}getGraphPath(e){let t=[],s,a=[];if(e=e||this.points,this.fillGraph&&this.nextPoints){if((s=d().seriesTypes.sma.prototype.getGraphPath.call(this,this.nextPoints))&&s.length){s[0][0]="L",t=d().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=d().seriesTypes.sma.prototype.getGraphPath.apply(this,arguments);return t}getValues(e,t){let s,o,i,r,n,l,p,u,h,d,c=t.period,m=t.periodTenkan,g=t.periodSenkouSpanB,y=e.xData,f=e.yData,x=e.xAxis,v=f&&f.length||0,D=(0,a.getClosestDistance)(x.series.map(e=>e.getColumn("x"))),A=[],b=[];if(y.length<=c||!(0,a.isArray)(f[0])||4!==f[0].length)return;let S=y[0]-c*D;for(n=0;n<c;n++)b.push(S+n*D);for(n=0;n<v;n++)n>=m&&(l=((o=el(f.slice(n-m,n))).high+o.low)/2),n>=c&&(h=(l+(p=((i=el(f.slice(n-c,n))).high+i.low)/2))/2),n>=g&&(d=((r=el(f.slice(n-g,n))).high+r.low)/2),u=f[n][3],s=y[n],void 0===A[n]&&(A[n]=[]),void 0===A[n+c-1]&&(A[n+c-1]=[]),A[n+c-1][0]=l,A[n+c-1][1]=p,A[n+c-1][2]=void 0,void 0===A[n+1]&&(A[n+1]=[]),A[n+1][2]=u,n<=c&&(A[n+c-1][3]=void 0,A[n+c-1][4]=void 0),void 0===A[n+2*c-2]&&(A[n+2*c-2]=[]),A[n+2*c-2][3]=h,A[n+2*c-2][4]=d,b.push(s);for(n=1;n<=c;n++)b.push(s+n*D);return{values:A,xData:b,yData:A}}}eu.defaultOptions=(0,a.merge)(en.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"}}),(0,a.extend)(eu.prototype,{pointArrayMap:["tenkanSen","kijunSen","chikouSpan","senkouSpanA","senkouSpanB"],pointValKey:"tenkanSen",nameComponents:["periodSenkouSpanB","period","periodTenkan"]}),eo()["ichimoku-averages"]=function(){let e,t=[];return[].forEach.call(arguments,function(s,a){t.push(eo().average(s)),e=!e&&void 0===t[a]}),e?void 0:t},d().registerSeriesType("ikh",eu);let{sma:eh}=d().seriesTypes;class ed extends eh{init(){d().seriesTypes.sma.prototype.init.apply(this,arguments),this.options=(0,a.merge)({topLine:{styles:{lineColor:this.color}},bottomLine:{styles:{lineColor:this.color}}},this.options)}getValues(e,t){let s,o,i,r,n,l,p,u=t.period,h=t.periodATR,c=t.multiplierATR,m=t.index,g=e.yData,y=g?g.length:0,f=[],x=d().seriesTypes.ema.prototype.getValues(e,{period:u,index:m}),v=d().seriesTypes.atr.prototype.getValues(e,{period:h}),D=[],A=[];if(!(y<u)){for(p=u;p<=y;p++)n=x.values[p-u],l=v.values[p-h],r=n[0],o=(0,a.correctFloat)(n[1]+c*l[1]),i=(0,a.correctFloat)(n[1]-c*l[1]),s=n[1],f.push([r,o,s,i]),D.push(r),A.push([o,s,i]);return{values:f,xData:D,yData:A}}}}ed.defaultOptions=(0,a.merge)(eh.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}),(0,a.extend)(ed.prototype,{nameBase:"Keltner Channels",areaLinesNames:["top","bottom"],nameComponents:["period","periodATR","multiplierATR"],linesApiNames:["topLine","bottomLine"],pointArrayMap:["top","middle","bottom"],pointValKey:"middle"}),T.compose(ed),d().registerSeriesType("keltnerchannels",ed);let{ema:ec,sma:em}=d().seriesTypes;class eg extends em{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,o=this.linkedParent,i=(0,a.isArray)(e)&&4===e.length,r=this.volumeSeries||(this.volumeSeries=t.get(s.params.volumeSeriesID));return r||(0,a.error)("Series "+s.params.volumeSeriesID+" not found! Check `volumeSeriesID`.",!0,o.chart),!!([o,r].every(function(e){return e&&e.dataTable.rowCount>=s.params.slowAvgPeriod})&&i)}getCM(e,t,s,o,i){return(0,a.correctFloat)(t+(s===o?e:i))}getDM(e,t){return(0,a.correctFloat)(e-t)}getVolumeForce(e){let t=[],s=0,a,o=1,i=0,r=e[0][1]-e[0][2],n=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,n,r),t.push([this.volumeSeries.getColumn("y")[o]*l*Math.abs(2*(a/s-1))*100]),n=l,i=s,r=a;return t}getEMA(e,t,s,a,o,i,r){return ec.prototype.calculateEma(r||[],e,void 0===i?1:i,a,t,void 0===o?-1:o,s)}getSMA(e,t,s){return ec.prototype.accumulatePeriodPoints(e,t,s)/e}getValues(e,t){let s=[],o=e.xData,i=e.yData,r=[],n=[],l=[],p,u=0,h=0,d,c,m,g=null;if(!this.isValidData(i[0]))return;let y=this.getVolumeForce(i),f=this.getSMA(t.fastAvgPeriod,0,y),x=this.getSMA(t.slowAvgPeriod,0,y),v=2/(t.fastAvgPeriod+1),D=2/(t.slowAvgPeriod+1);for(;u<i.length;u++)u>=t.fastAvgPeriod&&(c=h=this.getEMA(y,c,f,v,0,u,o)[1]),u>=t.slowAvgPeriod&&(m=d=this.getEMA(y,m,x,D,0,u,o)[1],l.push(p=(0,a.correctFloat)(h-d)),l.length>=t.signalPeriod&&(g=l.slice(-t.signalPeriod).reduce((e,t)=>e+t)/t.signalPeriod),s.push([o[u],p,g]),r.push(o[u]),n.push([p,g]));return{values:s,xData:r,yData:n}}}eg.defaultOptions=(0,a.merge)(em.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/>'}}),(0,a.extend)(eg.prototype,{areaLinesNames:[],linesApiNames:["signalLine"],nameBase:"Klinger",nameComponents:["fastAvgPeriod","slowAvgPeriod"],pointArrayMap:["y","signal"],parallelArrays:["x","y","signal"],pointValKey:"y"}),T.compose(eg),d().registerSeriesType("klinger",eg);let{noop:ey}=i(),{sma:ef}=d().seriesTypes;class ex extends ef{init(){d().seriesTypes.sma.prototype.init.apply(this,arguments);let e=this.color,t=this.colorIndex;this.options&&((0,a.defined)(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"];i().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(),d().seriesTypes.sma.prototype.destroy.apply(this,arguments)}drawGraph(){let e=this,t=e.points,s=e.options,o=e.zones,i={options:{gapSize:s.gapSize}},r=[[],[]],n,l=t.length;for(;l--;)n=t[l],(0,a.defined)(n.plotMACD)&&r[0].push({plotX:n.plotX,plotY:n.plotMACD,isNull:!(0,a.defined)(n.plotMACD)}),(0,a.defined)(n.plotSignal)&&r[1].push({plotX:n.plotX,plotY:n.plotSignal,isNull:!(0,a.defined)(n.plotMACD)});["macd","signal"].forEach((t,o)=>{e.points=r[o],e.options=(0,a.merge)(s[`${t}Line`]?.styles||{},i),e.graph=e[`graph${t}`],e.zones=(e[`${t}Zones`].zones||[]).slice(e[`${t}Zones`].startIndex||0),d().seriesTypes.sma.prototype.drawGraph.call(e),e[`graph${t}`]=e.graph}),e.points=t,e.options=s,e.zones=o}applyZones(){let e=this.zones;this.zones=this.signalZones.zones,d().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,o=[],i=[],r=[],n,l,p,u=0,h=[];if(!(e.xData.length<t.longPeriod+t.signalPeriod)){for(p=0,n=d().seriesTypes.ema.prototype.getValues(e,{period:t.shortPeriod,index:t.index}),l=d().seriesTypes.ema.prototype.getValues(e,{period:t.longPeriod,index:t.index}),n=n.values,l=l.values;p<=n.length;p++)(0,a.defined)(l[p])&&(0,a.defined)(l[p][1])&&(0,a.defined)(n[p+s])&&(0,a.defined)(n[p+s][0])&&o.push([n[p+s][0],0,null,n[p+s][1]-l[p][1]]);for(p=0;p<o.length;p++)i.push(o[p][0]),r.push([0,null,o[p][3]]);for(p=0,h=(h=d().seriesTypes.ema.prototype.getValues({xData:i,yData:r},{period:t.signalPeriod,index:2})).values;p<o.length;p++)o[p][0]>=h[0][0]&&(o[p][2]=h[u][1],r[p]=[0,h[u][1],o[p][3]],null===o[p][3]?(o[p][1]=0,r[p][0]=0):(o[p][1]=(0,a.correctFloat)(o[p][3]-h[u][1]),r[p][0]=(0,a.correctFloat)(o[p][3]-h[u][1])),u++);return{values:o,xData:i,yData:r}}}}ex.defaultOptions=(0,a.merge)(ef.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}),(0,a.extend)(ex.prototype,{nameComponents:["longPeriod","shortPeriod","signalPeriod"],pointArrayMap:["y","signal","MACD"],parallelArrays:["x","y","signal","MACD"],pointValKey:"y",markerAttribs:ey,getColumnMetrics:i().seriesTypes.column.prototype.getColumnMetrics,crispCol:i().seriesTypes.column.prototype.crispCol,drawPoints:i().seriesTypes.column.prototype.drawPoints}),d().registerSeriesType("macd",ex);let{sma:ev}=d().seriesTypes;function eD(e){return e.reduce(function(e,t){return e+t})}function eA(e){return(e[1]+e[2]+e[3])/3}class eb extends ev{getValues(e,t){let s=t.period,o=e.xData,i=e.yData,r=i?i.length:0,n=t.decimals,l=e.chart.get(t.volumeSeriesID),p=l?.getColumn("y")||[],u=[],h=[],d=[],c=[],m=[],g,y,f,x,v,D,A=!1,b=1;if(!l)return void(0,a.error)("Series "+t.volumeSeriesID+" not found! Check `volumeSeriesID`.",!0,e.chart);if(!(o.length<=s)&&(0,a.isArray)(i[0])&&4===i[0].length&&p){for(g=eA(i[b]);b<s+1;)y=g,A=(g=eA(i[b]))>=y,f=g*p[b],c.push(A?f:0),m.push(A?0:f),b++;for(D=b-1;D<r;D++){var S;D>b-1&&(c.shift(),m.shift(),y=g,A=(g=eA(i[D]))>y,f=g*p[D],c.push(A?f:0),m.push(A?0:f)),x=eD(m),S=100-100/(1+eD(c)/x),v=parseFloat(S.toFixed(n)),u.push([o[D],v]),h.push(o[D]),d.push(v)}return{values:u,xData:h,yData:d}}}}eb.defaultOptions=(0,a.merge)(ev.defaultOptions,{params:{index:void 0,volumeSeriesID:"volume",decimals:4}}),(0,a.extend)(eb.prototype,{nameBase:"Money Flow Index"}),d().registerSeriesType("mfi",eb);let{sma:eS}=d().seriesTypes;function eC(e,t,s,a,o){let i=t[s-1][o]-t[s-a-1][o];return[e[s-1],i]}class eT extends eS{getValues(e,t){let s,o,i=t.period,r=t.index,n=e.xData,l=e.yData,p=l?l.length:0,u=[],h=[],d=[];if(!(n.length<=i)&&(0,a.isArray)(l[0])){for(s=i+1;s<p;s++)o=eC(n,l,s,i,r),u.push(o),h.push(o[0]),d.push(o[1]);return o=eC(n,l,s,i,r),u.push(o),h.push(o[0]),d.push(o[1]),{values:u,xData:h,yData:d}}}}eT.defaultOptions=(0,a.merge)(eS.defaultOptions,{params:{index:3}}),(0,a.extend)(eT.prototype,{nameBase:"Momentum"}),d().registerSeriesType("momentum",eT);let{atr:eP}=d().seriesTypes;class eM extends eP{getValues(e,t){let s=super.getValues.apply(this,arguments),a=s.values.length,o=e.yData,i=0,r=t.period-1;if(s){for(;i<a;i++)s.yData[i]=s.values[i][1]/o[r][3]*100,s.values[i][1]=s.yData[i],r++;return s}}}eM.defaultOptions=(0,a.merge)(eP.defaultOptions,{tooltip:{valueSuffix:"%"}}),d().registerSeriesType("natr",eM);let{sma:eV}=d().seriesTypes;class eO extends eV{getValues(e,t){let s=e.chart.get(t.volumeSeriesID),o=e.xData,i=e.yData,r=[],n=[],l=[],p=!(0,a.isNumber)(i[0]),u=[],h=1,d=0,c=0,m=0,g=0,y;if(!s)return void(0,a.error)("Series "+t.volumeSeriesID+" not found! Check `volumeSeriesID`.",!0,e.chart);for(y=s.getColumn("y"),u=[o[0],d],m=p?i[0][3]:i[0],r.push(u),n.push(o[0]),l.push(u[1]);h<i.length;h++)c=(g=p?i[h][3]:i[h])>m?d+y[h]:g===m?d:d-y[h],u=[o[h],c],d=c,m=g,r.push(u),n.push(o[h]),l.push(u[1]);return{values:r,xData:n,yData:l}}}eO.defaultOptions=(0,a.merge)(eV.defaultOptions,{marker:{enabled:!1},params:{index:void 0,period:void 0,volumeSeriesID:"volume"},tooltip:{valueDecimals:0}}),(0,a.extend)(eO.prototype,{nameComponents:void 0}),d().registerSeriesType("obv",eO);let ek=d().seriesTypes.sma.prototype.pointClass;function eL(e,t){let s=e.series.pointArrayMap,a,o=s.length;for(d().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:ew}=d().seriesTypes;class eE extends ew{toYData(e){return[e.P]}translate(){let e=this;super.translate.apply(e),e.points.forEach(function(t){e.pointArrayMap.forEach(function(s){(0,a.defined)(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=[[],[],[],[],[],[],[],[],[]],o=t.pointArrayMap.length,i=t.plotEndPoint,r=[],n,l,p=e.length,u;for(;p--;){for(u=0,l=e[p];u<o;u++)n=t.pointArrayMap[u],(0,a.defined)(l[n])&&s[u].push({plotX:l.plotX,plotY:l["plot"+n],isNull:!1},{plotX:i,plotY:l["plot"+n],isNull:!1},{plotX:i,plotY:null,isNull:!0});i=l.plotX}return s.forEach(e=>{r=r.concat(super.getGraphPath.call(t,e))}),r}drawDataLabels(){let e,t,s,a,o=this,i=o.pointArrayMap;o.options.dataLabels.enabled&&(t=o.points.length,i.concat([!1]).forEach((r,n)=>{for(a=t;a--;)s=o.points[a],r?(s.y=s[r],s.pivotLine=r,s.plotY=s["plot"+r],e=s["dataLabel"+r],n&&(s["dataLabel"+i[n-1]]=s.dataLabel),s.dataLabels||(s.dataLabels=[]),s.dataLabels[0]=s.dataLabel=e=e&&e.element?e:null):s["dataLabel"+i[n-1]]=s.dataLabel;super.drawDataLabels.call(o)}))}getValues(e,t){let s,o,i,r,n,l,p,u=t.period,h=e.xData,d=e.yData,c=d?d.length:0,m=this[t.algorithm+"Placement"],g=[],y=[],f=[];if(!(h.length<u)&&(0,a.isArray)(d[0])&&4===d[0].length){for(p=u+1;p<=c+u;p+=u)i=h.slice(p-u-1,p),r=d.slice(p-u-1,p),o=i.length,s=i[o-1],l=m(this.getPivotAndHLC(r)),n=g.push([s].concat(l)),y.push(s),f.push(g[n-1].slice(1));return this.endPoint=i[0]+(s-i[0])/o*u,{values:g,xData:y,yData:f}}}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]}}eE.defaultOptions=(0,a.merge)(ew.defaultOptions,{params:{index:void 0,period:28,algorithm:"standard"},marker:{enabled:!1},enableMouseTracking:!1,dataLabels:{enabled:!0,format:"{point.pivotLine}"},dataGrouping:{approximation:"averages"}}),(0,a.extend)(eE.prototype,{nameBase:"Pivot Points",pointArrayMap:["R4","R3","R2","R1","P","S1","S2","S3","S4"],pointValKey:"P",pointClass:class extends ek{destroyElements(){eL(this,"destroyElements")}destroy(){eL(this,"destroyElements")}}}),d().registerSeriesType("pivotpoints",eE);let{ema:eI}=d().seriesTypes;class eN extends eI{getValues(e,t){let s,o,i=t.periods,r=t.index,n=[],l=[],p=[];if(2!==i.length||i[1]<=i[0])return void(0,a.error)('Error: "PPO requires two periods. Notice, first period should be lower than the second one."');let u=super.getValues.call(this,e,{index:r,period:i[0]}),h=super.getValues.call(this,e,{index:r,period:i[1]});if(!u||!h)return;let d=i[1]-i[0];for(o=0;o<h.yData.length;o++)s=(0,a.correctFloat)((u.yData[o+d]-h.yData[o])/h.yData[o]*100),n.push([h.xData[o],s]),l.push(h.xData[o]),p.push(s);return{values:n,xData:l,yData:p}}}eN.defaultOptions=(0,a.merge)(eI.defaultOptions,{params:{period:void 0,periods:[12,26]}}),(0,a.extend)(eN.prototype,{nameBase:"PPO",nameComponents:["periods"]}),d().registerSeriesType("ppo",eN);let eF=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:eB}=d().seriesTypes;class eG extends eB{getValues(e,t){let s,a,o,i,r,n,l=t.period,p=e.xData,u=e.yData,h=u?u.length:0,d=[],c=[],m=[];if(!(h<l)){for(n=l;n<=h;n++)i=p[n-1],s=((a=(r=eF(u.slice(n-l,n),2,1))[1])+(o=r[0]))/2,d.push([i,a,s,o]),c.push(i),m.push([a,s,o]);return{values:d,xData:c,yData:m}}}}eG.defaultOptions=(0,a.merge)(eB.defaultOptions,{params:{index:void 0,period:20},lineWidth:1,topLine:{styles:{lineColor:"var(--highcharts-color-2)",lineWidth:1}},bottomLine:{styles:{lineColor:"var(--highcharts-color-8)",lineWidth:1}},dataGrouping:{approximation:"averages"}}),(0,a.extend)(eG.prototype,{areaLinesNames:["top","bottom"],nameBase:"Price Channel",nameComponents:["period"],linesApiNames:["topLine","bottomLine"],pointArrayMap:["top","middle","bottom"],pointValKey:"middle"}),T.compose(eG),d().registerSeriesType("pc",eG);let{sma:eW}=d().seriesTypes;class ez extends eW{init(){super.init.apply(this,arguments),this.options=(0,a.merge)({topLine:{styles:{lineColor:this.color}},bottomLine:{styles:{lineColor:this.color}}},this.options)}getValues(e,t){let s,o,i,r,n,l,p,u,h=t.period,d=t.topBand,c=t.bottomBand,m=e.xData,g=e.yData,y=g?g.length:0,f=[],x=[],v=[];if(!(m.length<h)&&(0,a.isArray)(g[0])&&4===g[0].length){for(u=h;u<=y;u++)n=m.slice(u-h,u),l=g.slice(u-h,u),r=(p=super.getValues({xData:n,yData:l},t)).xData[0],o=(s=p.yData[0])*(1+d),i=s*(1-c),f.push([r,o,s,i]),x.push(r),v.push([o,s,i]);return{values:f,xData:x,yData:v}}}}ez.defaultOptions=(0,a.merge)(eW.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"}}),(0,a.extend)(ez.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"}),T.compose(ez),d().registerSeriesType("priceenvelopes",ez);let{sma:eY}=d().seriesTypes;function eX(e,t){return parseFloat(e.toFixed(t))}class eR extends eY{constructor(){super(...arguments),this.nameComponents=void 0}getValues(e,t){let s=e.xData,a=e.yData,o=t.maxAccelerationFactor,i=t.increment,r=t.initialAccelerationFactor,n=t.decimals,l=t.index,p=[],u=[],h=[],d=t.initialAccelerationFactor,c,m=a[0][1],g,y,f,x=1,v,D,A,b,S=a[0][2],C,T,P,M;if(!(l>=a.length)){for(M=0;M<l;M++)m=Math.max(a[M][1],m),S=Math.min(a[M][2],eX(S,n));for(c=a[M][1]>S?1:-1,g=m-S,y=(d=t.initialAccelerationFactor)*g,p.push([s[l],S]),u.push(s[l]),h.push(eX(S,n)),M=l+1;M<a.length;M++)if(v=a[M-1][2],D=a[M-2][2],A=a[M-1][1],b=a[M-2][1],T=a[M][1],P=a[M][2],null!==D&&null!==b&&null!==v&&null!==A&&null!==T&&null!==P){var V,O,k,L,w,E,I,N,F,B,G,W,z,Y,X,R,K,j,U,Z,q;w=c,E=x,I=S,N=y,F=D,B=v,G=A,W=b,z=m,S=w===E?1===w?I+N<Math.min(F,B)?I+N:Math.min(F,B):I+N>Math.max(W,G)?I+N:Math.max(W,G):z,V=c,O=m,C=1===V?T>O?T:O:P<O?P:O,k=x,L=S,Y=f=1===k&&P>L||-1===k&&T>L?1:-1,X=c,R=C,K=m,j=d,U=i,Z=o,q=r,y=(d=Y===X?1===Y&&R>K||-1===Y&&R<K?j===Z?Z:eX(j+U,2):j:q)*(g=C-S),p.push([s[M],eX(S,n)]),u.push(s[M]),h.push(eX(S,n)),x=c,c=f,m=C}return{values:p,xData:u,yData:h}}}}eR.defaultOptions=(0,a.merge)(eY.defaultOptions,{lineWidth:0,marker:{enabled:!0},states:{hover:{lineWidthPlus:0}},params:{period:void 0,initialAccelerationFactor:.02,maxAccelerationFactor:.2,increment:.02,index:2,decimals:4}}),d().registerSeriesType("psar",eR);let{sma:eK}=d().seriesTypes;class ej extends eK{getValues(e,t){let s=t.period,o=e.xData,i=e.yData,r=i?i.length:0,n=[],l=[],p=[],u,h=-1,d;if(!(o.length<=s)){for((0,a.isArray)(i[0])&&(h=t.index),u=s;u<r;u++)d=function(e,t,s,a,o){let i,r;return r=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],r]}(o,i,u,s,h),n.push(d),l.push(d[0]),p.push(d[1]);return{values:n,xData:l,yData:p}}}}ej.defaultOptions=(0,a.merge)(eK.defaultOptions,{params:{index:3,period:9}}),(0,a.extend)(ej.prototype,{nameBase:"Rate of Change"}),d().registerSeriesType("roc",ej);let{sma:eU}=d().seriesTypes;function eZ(e,t){return parseFloat(e.toFixed(t))}class eq extends eU{getValues(e,t){let s=t.period,o=e.xData,i=e.yData,r=i?i.length:0,n=t.decimals,l=[],p=[],u=[],h=0,d=0,c=t.index,m=1,g,y,f,x,v,D;if(!(o.length<s)){for((0,a.isNumber)(i[0])?D=i:(c=Math.min(c,i[0].length-1),D=i.map(e=>e[c]));m<s;)(y=eZ(D[m]-D[m-1],n))>0?h+=y:d+=Math.abs(y),m++;for(f=eZ(h/(s-1),n),x=eZ(d/(s-1),n),v=m;v<r;v++)(y=eZ(D[v]-D[v-1],n))>0?(h=y,d=0):(h=0,d=Math.abs(y)),f=eZ((f*(s-1)+h)/s,n),g=0===(x=eZ((x*(s-1)+d)/s,n))?100:0===f?0:eZ(100-100/(1