/*
 Highstock JS v8.2.0 (2020-08-20)

 All technical indicators for Highstock

 (c) 2010-2019 Pawel Fus

 License: www.highcharts.com/license
*/
(function(h){"object"===typeof module&&module.exports?(h["default"]=h,module.exports=h):"function"===typeof define&&define.amd?define("highcharts/indicators/indicators-all",["highcharts","highcharts/modules/stock"],function(t){h(t);h.Highcharts=t;return h}):h("undefined"!==typeof Highcharts?Highcharts:void 0)})(function(h){function t(d,k,l,g){d.hasOwnProperty(k)||(d[k]=g.apply(null,l))}h=h?h._modules:{};t(h,"Mixins/IndicatorRequired.js",[h["Core/Utilities.js"]],function(d){var k=d.error;return{isParentLoaded:function(l,
g,e,a,c){if(l)return a?a(l):!0;k(c||this.generateMessage(e,g));return!1},generateMessage:function(l,g){return'Error: "'+l+'" indicator type requires "'+g+'" indicator loaded before. Please read docs: https://api.highcharts.com/highstock/plotOptions.'+l}}});t(h,"Stock/Indicators/Indicators.js",[h["Core/Globals.js"],h["Mixins/IndicatorRequired.js"],h["Core/Utilities.js"]],function(d,k,l){var g=l.addEvent,e=l.error,a=l.extend,c=l.isArray,b=l.pick,f=l.seriesType,u=l.splat,x=d.Series,n=d.seriesTypes,q=
d.seriesTypes.ohlc.prototype,m=k.generateMessage;g(d.Series,"init",function(b){b=b.options;b.useOhlcData&&"highcharts-navigator-series"!==b.id&&a(this,{pointValKey:q.pointValKey,keys:q.keys,pointArrayMap:q.pointArrayMap,toYData:q.toYData})});g(x,"afterSetOptions",function(b){b=b.options;var c=b.dataGrouping;c&&b.useOhlcData&&"highcharts-navigator-series"!==b.id&&(c.approximation="ohlc")});f("sma","line",{name:void 0,tooltip:{valueDecimals:4},linkedTo:void 0,compareToMain:!1,params:{index:0,period:14}},
{processData:function(){var b=this.options.compareToMain,c=this.linkedParent;x.prototype.processData.apply(this,arguments);c&&c.compareValue&&b&&(this.compareValue=c.compareValue)},bindTo:{series:!0,eventName:"updatedData"},hasDerivedData:!0,useCommonDataGrouping:!0,nameComponents:["period"],nameSuffixes:[],calculateOn:"init",requiredIndicators:[],requireIndicators:function(){var b={allLoaded:!0};this.requiredIndicators.forEach(function(c){n[c]?n[c].prototype.requireIndicators():(b.allLoaded=!1,b.needed=
c)});return b},init:function(b,c){function f(){var b=a.points||[],c=(a.xData||[]).length,f=a.getValues(a.linkedParent,a.options.params)||{values:[],xData:[],yData:[]},e=[],p=!0;if(c&&!a.hasGroupedData&&a.visible&&a.points)if(a.cropped){if(a.xAxis){var n=a.xAxis.min;var g=a.xAxis.max}c=a.cropData(f.xData,f.yData,n,g);for(n=0;n<c.xData.length;n++)e.push([c.xData[n]].concat(u(c.yData[n])));c=f.xData.indexOf(a.xData[0]);n=f.xData.indexOf(a.xData[a.xData.length-1]);-1===c&&n===f.xData.length-2&&e[0][0]===
b[0].x&&e.shift();a.updateData(e)}else f.xData.length!==c-1&&f.xData.length!==c+1&&(p=!1,a.updateData(f.values));p&&(a.xData=f.xData,a.yData=f.yData,a.options.data=f.values);!1===a.bindTo.series&&(delete a.processedXData,a.isDirty=!0,a.redraw());a.isDirtyData=!1}var a=this,p=a.requireIndicators();if(!p.allLoaded)return e(m(a.type,p.needed));x.prototype.init.call(a,b,c);b.linkSeries();a.dataEventsToUnbind=[];if(!a.linkedParent)return e("Series "+a.options.linkedTo+" not found! Check `linkedTo`.",!1,
b);a.dataEventsToUnbind.push(g(a.bindTo.series?a.linkedParent:a.linkedParent.xAxis,a.bindTo.eventName,f));if("init"===a.calculateOn)f();else var n=g(a.chart,a.calculateOn,function(){f();n()});return a},getName:function(){var c=this.name,a=[];c||((this.nameComponents||[]).forEach(function(c,f){a.push(this.options.params[c]+b(this.nameSuffixes[f],""))},this),c=(this.nameBase||this.type.toUpperCase())+(this.nameComponents?" ("+a.join(", ")+")":""));return c},getValues:function(b,a){var f=a.period,e=
b.xData;b=b.yData;var u=b.length,n=0,p=0,g=[],x=[],q=[],l=-1;if(!(e.length<f)){for(c(b[0])&&(l=a.index?a.index:0);n<f-1;)p+=0>l?b[n]:b[n][l],n++;for(a=n;a<u;a++){p+=0>l?b[a]:b[a][l];var m=[e[a],p/f];g.push(m);x.push(m[0]);q.push(m[1]);p-=0>l?b[a-n]:b[a-n][l]}return{values:g,xData:x,yData:q}}},destroy:function(){this.dataEventsToUnbind.forEach(function(b){b()});x.prototype.destroy.apply(this,arguments)}});""});t(h,"Stock/Indicators/ADIndicator.js",[h["Core/Utilities.js"]],function(d){var k=d.error;
d=d.seriesType;d("ad","sma",{params:{volumeSeriesID:"volume"}},{nameComponents:!1,nameBase:"Accumulation/Distribution",getValues:function(l,g){var e=g.period,a=l.xData,c=l.yData,b=g.volumeSeriesID,f=l.chart.get(b);g=f&&f.yData;var u=c?c.length:0,x=[],n=[],q=[];if(!(a.length<=e&&u&&4!==c[0].length)){if(f){for(;e<u;e++){l=x.length;b=c[e][1];f=c[e][2];var m=c[e][3],p=g[e];b=[a[e],m===b&&m===f||b===f?0:(2*m-f-b)/(b-f)*p];0<l&&(b[1]+=x[l-1][1]);x.push(b);n.push(b[0]);q.push(b[1])}return{values:x,xData:n,
yData:q}}k("Series "+b+" not found! Check `volumeSeriesID`.",!0,l.chart)}}});""});t(h,"Stock/Indicators/AOIndicator.js",[h["Core/Globals.js"],h["Core/Utilities.js"]],function(d,k){var l=k.correctFloat,g=k.isArray;k=k.seriesType;k("ao","sma",{greaterBarColor:"#06B535",lowerBarColor:"#F21313",threshold:0,groupPadding:.2,pointPadding:.2,crisp:!1,states:{hover:{halo:{size:0}}}},{nameBase:"AO",nameComponents:!1,markerAttribs:d.noop,getColumnMetrics:d.seriesTypes.column.prototype.getColumnMetrics,crispCol:d.seriesTypes.column.prototype.crispCol,
translate:d.seriesTypes.column.prototype.translate,drawPoints:d.seriesTypes.column.prototype.drawPoints,drawGraph:function(){var e=this.options,a=this.points,c=e.greaterBarColor;e=e.lowerBarColor;var b=a[0];if(!this.userOptions.color&&b)for(b.color=c,b=1;b<a.length;b++)a[b].color=a[b].y>a[b-1].y?c:a[b].y<a[b-1].y?e:a[b-1].color},getValues:function(e){var a=e.xData||[];e=e.yData||[];var c=e.length,b=[],f=[],u=[],x=0,n=0,q;if(!(34>=a.length)&&g(e[0])&&4===e[0].length){for(q=0;33>q;q++){var m=(e[q][1]+
e[q][2])/2;29<=q&&(x=l(x+m));n=l(n+m)}for(q=33;q<c;q++){m=(e[q][1]+e[q][2])/2;x=l(x+m);n=l(n+m);m=x/5;var p=n/34;m=l(m-p);b.push([a[q],m]);f.push(a[q]);u.push(m);m=q+1-5;p=q+1-34;x=l(x-(e[m][1]+e[m][2])/2);n=l(n-(e[p][1]+e[p][2])/2)}return{values:b,xData:f,yData:u}}}});""});t(h,"Mixins/MultipleLines.js",[h["Core/Globals.js"],h["Core/Utilities.js"]],function(d,k){var l=k.defined,g=k.error,e=k.merge,a=d.seriesTypes.sma;return{pointArrayMap:["top","bottom"],pointValKey:"top",linesApiNames:["bottomLine"],
getTranslatedLinesNames:function(c){var b=[];(this.pointArrayMap||[]).forEach(function(a){a!==c&&b.push("plot"+a.charAt(0).toUpperCase()+a.slice(1))});return b},toYData:function(c){var b=[];(this.pointArrayMap||[]).forEach(function(a){b.push(c[a])});return b},translate:function(){var c=this,b=c.pointArrayMap,f=[],e;f=c.getTranslatedLinesNames();a.prototype.translate.apply(c,arguments);c.points.forEach(function(a){b.forEach(function(b,u){e=a[b];null!==e&&(a[f[u]]=c.yAxis.toPixels(e,!0))})})},drawGraph:function(){var c=
this,b=c.linesApiNames,f=c.points,u=f.length,x=c.options,n=c.graph,q={options:{gapSize:x.gapSize}},m=[],p;c.getTranslatedLinesNames(c.pointValKey).forEach(function(b,c){for(m[c]=[];u--;)p=f[u],m[c].push({x:p.x,plotX:p.plotX,plotY:p[b],isNull:!l(p[b])});u=f.length});b.forEach(function(b,f){m[f]?(c.points=m[f],x[b]?c.options=e(x[b].styles,q):g('Error: "There is no '+b+' in DOCS options declared. Check if linesApiNames are consistent with your DOCS line names." at mixin/multiple-line.js:34'),c.graph=
c["graph"+b],a.prototype.drawGraph.call(c),c["graph"+b]=c.graph):g('Error: "'+b+" doesn't have equivalent in pointArrayMap. To many elements in linesApiNames relative to pointArrayMap.\"")});c.points=f;c.options=x;c.graph=n;a.prototype.drawGraph.call(c)}}});t(h,"Stock/Indicators/AroonIndicator.js",[h["Core/Utilities.js"],h["Mixins/MultipleLines.js"]],function(d,k){function l(a,c){var b=a[0],f=0,e;for(e=1;e<a.length;e++)if("max"===c&&a[e]>=b||"min"===c&&a[e]<=b)b=a[e],f=e;return f}var g=d.merge,e=
d.pick;d=d.seriesType;d("aroon","sma",{params:{period:25},marker:{enabled:!1},tooltip:{pointFormat:'<span style="color:{point.color}">\u25cf</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"}},g(k,{nameBase:"Aroon",pointArrayMap:["y","aroonDown"],pointValKey:"y",linesApiNames:["aroonDown"],getValues:function(a,c){c=c.period;var b=a.xData,f=(a=a.yData)?a.length:0,u=[],
g=[],n=[],q;for(q=c-1;q<f;q++){var m=a.slice(q-c+1,q+2);var p=l(m.map(function(b){return e(b[2],b)}),"min");m=l(m.map(function(b){return e(b[1],b)}),"max");m=m/c*100;p=p/c*100;b[q+1]&&(u.push([b[q+1],m,p]),g.push(b[q+1]),n.push([m,p]))}return{values:u,xData:g,yData:n}}}));""});t(h,"Stock/Indicators/AroonOscillatorIndicator.js",[h["Core/Globals.js"],h["Mixins/MultipleLines.js"],h["Mixins/IndicatorRequired.js"],h["Core/Utilities.js"]],function(d,k,l,g){var e=g.merge;g=g.seriesType;var a=d.seriesTypes.aroon;
g("aroonoscillator","aroon",{params:{period:25},tooltip:{pointFormat:'<span style="color:{point.color}">\u25cf</span><b> {series.name}</b>: {point.y}'}},e(k,{nameBase:"Aroon Oscillator",pointArrayMap:["y"],pointValKey:"y",linesApiNames:[],init:function(){var c=arguments,b=this;l.isParentLoaded(a,"aroon",b.type,function(a){a.prototype.init.apply(b,c)})},getValues:function(c,b){var f=[],e=[],g=[];c=a.prototype.getValues.call(this,c,b);for(b=0;b<c.yData.length;b++){var n=c.yData[b][0];var q=c.yData[b][1];
n-=q;f.push([c.xData[b],n]);e.push(c.xData[b]);g.push(n)}return{values:f,xData:e,yData:g}}}));""});t(h,"Stock/Indicators/ATRIndicator.js",[h["Core/Utilities.js"]],function(d){function k(e,a){return Math.max(e[1]-e[2],a===g?0:Math.abs(e[1]-a[3]),a===g?0:Math.abs(e[2]-a[3]))}var l=d.isArray;d=d.seriesType;var g;d("atr","sma",{params:{period:14}},{getValues:function(e,a){a=a.period;var c=e.xData,b=(e=e.yData)?e.length:0,f=1,g=0,x=0,n=[],q=[],m=[],p;var d=[[c[0],e[0]]];if(!(c.length<=a)&&l(e[0])&&4===
e[0].length){for(p=1;p<=b;p++)if(d.push([c[p],e[p]]),a<f){var w=a;var r=c[p-1],A=k(e[p-1],e[p-2]);w=[r,(g*(w-1)+A)/w];g=w[1];n.push(w);q.push(w[0]);m.push(w[1])}else a===f?(g=x/(p-1),n.push([c[p-1],g]),q.push(c[p-1]),m.push(g)):x+=k(e[p-1],e[p-2]),f++;return{values:n,xData:q,yData:m}}}});""});t(h,"Stock/Indicators/BBIndicator.js",[h["Core/Globals.js"],h["Core/Utilities.js"],h["Mixins/MultipleLines.js"]],function(d,k,l){var g=k.isArray,e=k.merge;k=k.seriesType;var a=d.seriesTypes.sma;k("bb","sma",
{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}">\u25cf</span><b> {series.name}</b><br/>Top: {point.top}<br/>Middle: {point.middle}<br/>Bottom: {point.bottom}<br/>'},marker:{enabled:!1},dataGrouping:{approximation:"averages"}},e(l,{pointArrayMap:["top","middle","bottom"],pointValKey:"middle",nameComponents:["period","standardDeviation"],linesApiNames:["topLine",
"bottomLine"],init:function(){a.prototype.init.apply(this,arguments);this.options=e({topLine:{styles:{lineColor:this.color}},bottomLine:{styles:{lineColor:this.color}}},this.options)},getValues:function(c,b){var f=b.period,e=b.standardDeviation,x=c.xData,n=(c=c.yData)?c.length:0,q=[],l=[],p=[],k;if(!(x.length<f)){var w=g(c[0]);for(k=f;k<=n;k++){var r=x.slice(k-f,k);var d=c.slice(k-f,k);var h=a.prototype.getValues.call(this,{xData:r,yData:d},b);r=h.xData[0];h=h.yData[0];for(var z=0,v=d.length,y=0;y<
v;y++){var E=(w?d[y][b.index]:d[y])-h;z+=E*E}E=Math.sqrt(z/(v-1));d=h+e*E;E=h-e*E;q.push([r,d,h,E]);l.push(r);p.push([d,h,E])}return{values:q,xData:l,yData:p}}}}));""});t(h,"Stock/Indicators/CCIIndicator.js",[h["Core/Utilities.js"]],function(d){function k(g){return g.reduce(function(e,a){return e+a},0)}var l=d.isArray;d=d.seriesType;d("cci","sma",{params:{period:14}},{getValues:function(g,e){e=e.period;var a=g.xData,c=(g=g.yData)?g.length:0,b=[],f=1,u=[],x=[],n=[];if(!(a.length<=e)&&l(g[0])&&4===
g[0].length){for(;f<e;){var q=g[f-1];b.push((q[1]+q[2]+q[3])/3);f++}for(f=e;f<=c;f++){q=g[f-1];q=(q[1]+q[2]+q[3])/3;var m=b.push(q);var p=b.slice(m-e);m=k(p)/e;var d,w=p.length,r=0;for(d=0;d<w;d++)r+=Math.abs(m-p[d]);p=r/e;q=(q-m)/(.015*p);u.push([a[f-1],q]);x.push(a[f-1]);n.push(q)}return{values:u,xData:x,yData:n}}}});""});t(h,"Stock/Indicators/CMFIndicator.js",[h["Core/Utilities.js"]],function(d){d=d.seriesType;d("cmf","sma",{params:{period:14,volumeSeriesID:"volume"}},{nameBase:"Chaikin Money Flow",
isValid:function(){var k=this.chart,l=this.options,g=this.linkedParent;k=this.volumeSeries||(this.volumeSeries=k.get(l.params.volumeSeriesID));var e=g&&g.yData&&4===g.yData[0].length;return!!(g&&k&&g.xData&&g.xData.length>=l.params.period&&k.xData&&k.xData.length>=l.params.period&&e)},getValues:function(k,l){if(this.isValid())return this.getMoneyFlow(k.xData,k.yData,this.volumeSeries.yData,l.period)},getMoneyFlow:function(k,l,g,e){function a(b,c){var a=b[1],f=b[2];b=b[3];return null!==c&&null!==a&&
null!==f&&null!==b&&a!==f?(b-f-(a-b))/(a-f)*c:(p=m,null)}var c=l.length,b=[],f=0,u=0,x=[],n=[],q=[],m,p=-1;if(0<e&&e<=c){for(m=0;m<e;m++)b[m]=a(l[m],g[m]),f+=g[m],u+=b[m];x.push(k[m-1]);n.push(m-p>=e&&0!==f?u/f:null);for(q.push([x[0],n[0]]);m<c;m++){b[m]=a(l[m],g[m]);f-=g[m-e];f+=g[m];u-=b[m-e];u+=b[m];var d=[k[m],m-p>=e?u/f:null];x.push(d[0]);n.push(d[1]);q.push([d[0],d[1]])}}return{values:q,xData:x,yData:n}}});""});t(h,"Stock/Indicators/DPOIndicator.js",[h["Core/Utilities.js"]],function(d){function k(e,
a,c,b,f){a=g(a[c][b],a[c]);return f?l(e-a):l(e+a)}var l=d.correctFloat,g=d.pick;d=d.seriesType;d("dpo","sma",{params:{period:21}},{nameBase:"DPO",getValues:function(e,a){var c=a.period;a=a.index;var b=c+Math.floor(c/2+1),f=e.xData||[];e=e.yData||[];var u=e.length,l=[],n=[],q=[],m=0,p,d;if(!(f.length<=b)){for(p=0;p<c-1;p++)m=k(m,e,p,a);for(d=0;d<=u-b;d++){var w=d+c-1;p=d+b-1;m=k(m,e,w,a);w=g(e[p][a],e[p]);w-=m/c;m=k(m,e,d,a,!0);l.push([f[p],w]);n.push(f[p]);q.push(w)}return{values:l,xData:n,yData:q}}}});
""});t(h,"Stock/Indicators/EMAIndicator.js",[h["Core/Utilities.js"]],function(d){var k=d.correctFloat,l=d.isArray;d=d.seriesType;d("ema","sma",{params:{index:3,period:9}},{accumulatePeriodPoints:function(g,e,a){for(var c=0,b=0,f;b<g;)f=0>e?a[b]:a[b][e],c+=f,b++;return c},calculateEma:function(g,e,a,c,b,f,u){g=g[a-1];e=0>f?e[a-1]:e[a-1][f];c="undefined"===typeof b?u:k(e*c+b*(1-c));return[g,c]},getValues:function(g,e){var a=e.period,c=g.xData,b=(g=g.yData)?g.length:0,f=2/(a+1),u=[],x=[],n=[],q=-1;if(!(b<
a)){l(g[0])&&(q=e.index?e.index:0);e=this.accumulatePeriodPoints(a,q,g);for(e/=a;a<b+1;a++){var m=this.calculateEma(c,g,a,f,m,q,e);u.push(m);x.push(m[0]);n.push(m[1]);m=m[1]}return{values:u,xData:x,yData:n}}}});""});t(h,"Stock/Indicators/ChaikinIndicator.js",[h["Core/Globals.js"],h["Core/Utilities.js"],h["Mixins/IndicatorRequired.js"]],function(d,k,l){var g=k.correctFloat,e=k.error;k=k.seriesType;var a=d.seriesTypes.ema,c=d.seriesTypes.ad;k("chaikin","ema",{params:{volumeSeriesID:"volume",periods:[3,
10]}},{nameBase:"Chaikin Osc",nameComponents:["periods"],init:function(){var b=arguments,c=this;l.isParentLoaded(a,"ema",c.type,function(a){a.prototype.init.apply(c,b)})},getValues:function(b,f){var u=f.periods,l=f.period,n=[],q=[],m=[],p;if(2!==u.length||u[1]<=u[0])e('Error: "Chaikin requires two periods. Notice, first period should be lower than the second one."');else if(f=c.prototype.getValues.call(this,b,{volumeSeriesID:f.volumeSeriesID,period:l}))if(b=a.prototype.getValues.call(this,f,{period:u[0]}),
f=a.prototype.getValues.call(this,f,{period:u[1]}),b&&f){u=u[1]-u[0];for(p=0;p<f.yData.length;p++)l=g(b.yData[p+u]-f.yData[p]),n.push([f.xData[p],l]),q.push(f.xData[p]),m.push(l);return{values:n,xData:q,yData:m}}}});""});t(h,"Stock/Indicators/DEMAIndicator.js",[h["Core/Globals.js"],h["Core/Utilities.js"],h["Mixins/IndicatorRequired.js"]],function(d,k,l){var g=k.correctFloat,e=k.isArray;k=k.seriesType;var a=d.seriesTypes.ema;k("dema","ema",{},{init:function(){var c=arguments,b=this;l.isParentLoaded(a,
"ema",b.type,function(a){a.prototype.init.apply(b,c)})},getEMA:function(c,b,f,e,g,n){return a.prototype.calculateEma(n||[],c,"undefined"===typeof g?1:g,this.chart.series[0].EMApercent,b,"undefined"===typeof e?-1:e,f)},getValues:function(c,b){var f=b.period,l=2*f,x=c.xData,n=c.yData,q=n?n.length:0,m=-1,p=[],k=[],w=[],r=0,d=[],h;c.EMApercent=2/(f+1);if(!(q<2*f-1)){e(n[0])&&(m=b.index?b.index:0);c=a.prototype.accumulatePeriodPoints(f,m,n);b=c/f;c=0;for(h=f;h<q+2;h++){h<q+1&&(r=this.getEMA(n,z,b,m,h)[1],
d.push(r));var z=r;if(h<l)c+=r;else{h===l&&(b=c/f);r=d[h-f-1];var v=this.getEMA([r],v,b)[1];var y=[x[h-2],g(2*r-v)];p.push(y);k.push(y[0]);w.push(y[1])}}return{values:p,xData:k,yData:w}}}});""});t(h,"Stock/Indicators/TEMAIndicator.js",[h["Core/Globals.js"],h["Core/Utilities.js"],h["Mixins/IndicatorRequired.js"]],function(d,k,l){var g=k.correctFloat,e=k.isArray;k=k.seriesType;var a=d.seriesTypes.ema;k("tema","ema",{},{init:function(){var c=arguments,b=this;l.isParentLoaded(a,"ema",b.type,function(a){a.prototype.init.apply(b,
c)})},getEMA:function(c,b,f,e,g,n){return a.prototype.calculateEma(n||[],c,"undefined"===typeof g?1:g,this.chart.series[0].EMApercent,b,"undefined"===typeof e?-1:e,f)},getTemaPoint:function(a,b,f,e){return[a[e-3],g(3*f.level1-3*f.level2+f.level3)]},getValues:function(c,b){var f=b.period,g=2*f,l=3*f,n=c.xData,q=c.yData,m=q?q.length:0,p=-1,k=[],w=[],r=[],d=[],h=[],z,v,y={};c.EMApercent=2/(f+1);if(!(m<3*f-2)){e(q[0])&&(p=b.index?b.index:0);c=a.prototype.accumulatePeriodPoints(f,p,q);b=c/f;c=0;for(z=
f;z<m+3;z++){z<m+1&&(y.level1=this.getEMA(q,E,b,p,z)[1],d.push(y.level1));var E=y.level1;if(z<g)c+=y.level1;else{z===g&&(b=c/f,c=0);y.level1=d[z-f-1];y.level2=this.getEMA([y.level1],L,b)[1];h.push(y.level2);var L=y.level2;if(z<l)c+=y.level2;else{z===l&&(b=c/f);z===m+1&&(y.level1=d[z-f-1],y.level2=this.getEMA([y.level1],L,b)[1],h.push(y.level2));y.level1=d[z-f-2];y.level2=h[z-2*f-1];y.level3=this.getEMA([y.level2],y.prevLevel3,b)[1];if(v=this.getTemaPoint(n,l,y,z))k.push(v),w.push(v[0]),r.push(v[1]);
y.prevLevel3=y.level3}}}return{values:k,xData:w,yData:r}}}});""});t(h,"Stock/Indicators/TRIXIndicator.js",[h["Core/Globals.js"],h["Core/Utilities.js"],h["Mixins/IndicatorRequired.js"]],function(d,k,l){var g=k.correctFloat;k=k.seriesType;var e=d.seriesTypes.tema;k("trix","tema",{},{init:function(){var a=arguments,c=this;l.isParentLoaded(e,"tema",c.type,function(b){b.prototype.init.apply(c,a)})},getTemaPoint:function(a,c,b,f){if(f>c)var e=[a[f-3],0!==b.prevLevel3?g(b.level3-b.prevLevel3)/b.prevLevel3*
100:null];return e}});""});t(h,"Stock/Indicators/APOIndicator.js",[h["Core/Globals.js"],h["Core/Utilities.js"],h["Mixins/IndicatorRequired.js"]],function(d,k,l){var g=k.error;k=k.seriesType;var e=d.seriesTypes.ema;k("apo","ema",{params:{periods:[10,20]}},{nameBase:"APO",nameComponents:["periods"],init:function(){var a=arguments,c=this;l.isParentLoaded(e,"ema",c.type,function(b){b.prototype.init.apply(c,a)})},getValues:function(a,c){var b=c.periods,f=c.index;c=[];var l=[],d=[],n;if(2!==b.length||b[1]<=
b[0])g('Error: "APO requires two periods. Notice, first period should be lower than the second one."');else{var q=e.prototype.getValues.call(this,a,{index:f,period:b[0]});a=e.prototype.getValues.call(this,a,{index:f,period:b[1]});if(q&&a){b=b[1]-b[0];for(n=0;n<a.yData.length;n++)f=q.yData[n+b]-a.yData[n],c.push([a.xData[n],f]),l.push(a.xData[n]),d.push(f);return{values:c,xData:l,yData:d}}}}});""});t(h,"Stock/Indicators/IKHIndicator.js",[h["Core/Globals.js"],h["Core/Color.js"],h["Core/Utilities.js"]],
function(d,k,l){function g(b){return b.reduce(function(b,a){return Math.max(b,a[1])},-Infinity)}function e(b){return b.reduce(function(b,a){return Math.min(b,a[2])},Infinity)}function a(b){return{high:g(b),low:e(b)}}function c(b){var a,c,f,e,g;b.series.forEach(function(b){if(b.xData)for(e=b.xData,g=c=b.xIncrement?1:e.length-1;0<g;g--)if(f=e[g]-e[g-1],a===p||f<a)a=f});return a}function b(b,a,c,f){if(b&&a&&c&&f){var e=a.plotX-b.plotX;a=a.plotY-b.plotY;var g=f.plotX-c.plotX;f=f.plotY-c.plotY;var n=b.plotX-
c.plotX,p=b.plotY-c.plotY;c=(-a*n+e*p)/(-g*a+e*f);g=(g*p-f*n)/(-g*a+e*f);if(0<=c&&1>=c&&0<=g&&1>=g)return{plotX:b.plotX+g*e,plotY:b.plotY+g*a}}return!1}function f(b){var a=b.indicator;a.points=b.points;a.nextPoints=b.nextPoints;a.color=b.color;a.options=q(b.options.senkouSpan.styles,b.gap);a.graph=b.graph;a.fillGraph=!0;h.prototype.drawGraph.call(a)}var u=k.parse,x=l.defined,n=l.isArray,q=l.merge,m=l.objectEach;k=l.seriesType;var p,h=d.seriesTypes.sma;d.approximations["ichimoku-averages"]=function(){var b=
[],a;[].forEach.call(arguments,function(c,f){b.push(d.approximations.average(c));a=!a&&"undefined"===typeof b[f]});return a?void 0:b};k("ikh","sma",{params:{period:26,periodTenkan:9,periodSenkouSpanB:52},marker:{enabled:!1},tooltip:{pointFormat:'<span style="color:{point.color}">\u25cf</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"}},{pointArrayMap:["tenkanSen","kijunSen","chikouSpan","senkouSpanA","senkouSpanB"],pointValKey:"tenkanSen",nameComponents:["periodSenkouSpanB","period",
"periodTenkan"],init:function(){h.prototype.init.apply(this,arguments);this.options=q({tenkanLine:{styles:{lineColor:this.color}},kijunLine:{styles:{lineColor:this.color}},chikouLine:{styles:{lineColor:this.color}},senkouSpanA:{styles:{lineColor:this.color,fill:u(this.color).setOpacity(.5).get()}},senkouSpanB:{styles:{lineColor:this.color,fill:u(this.color).setOpacity(.5).get()}},senkouSpan:{styles:{fill:u(this.color).setOpacity(.2).get()}}},this.options)},toYData:function(b){return[b.tenkanSen,b.kijunSen,
b.chikouSpan,b.senkouSpanA,b.senkouSpanB]},translate:function(){var b=this;h.prototype.translate.apply(b);b.points.forEach(function(a){b.pointArrayMap.forEach(function(c){x(a[c])&&(a["plot"+c]=b.yAxis.toPixels(a[c],!0),a.plotY=a["plot"+c],a.tooltipPos=[a.plotX,a["plot"+c]],a.isNull=!1)})})},drawGraph:function(){var a=this,c=a.points,e=c.length,g=a.options,n=a.graph,p=a.color,l={options:{gapSize:g.gapSize}},d=a.pointArrayMap.length,k=[[],[],[],[],[],[]],u={tenkanLine:k[0],kijunLine:k[1],chikouLine:k[2],
senkouSpanA:k[3],senkouSpanB:k[4],senkouSpan:k[5]},C=[],D=a.options.senkouSpan,t=D.color||D.styles.fill,N=D.negativeColor,J=[[],[]],M=[[],[]],P=0,K,Q,O;for(a.ikhMap=u;e--;){var F=c[e];for(K=0;K<d;K++)D=a.pointArrayMap[K],x(F[D])&&k[K].push({plotX:F.plotX,plotY:F["plot"+D],isNull:!1});N&&e!==c.length-1&&(D=u.senkouSpanB.length-1,F=b(u.senkouSpanA[D-1],u.senkouSpanA[D],u.senkouSpanB[D-1],u.senkouSpanB[D]),K={plotX:F.plotX,plotY:F.plotY,isNull:!1,intersectPoint:!0},F&&(u.senkouSpanA.splice(D,0,K),u.senkouSpanB.splice(D,
0,K),C.push(D)))}m(u,function(b,c){g[c]&&"senkouSpan"!==c&&(a.points=k[P],a.options=q(g[c].styles,l),a.graph=a["graph"+c],a.fillGraph=!1,a.color=p,h.prototype.drawGraph.call(a),a["graph"+c]=a.graph);P++});a.graphCollection&&a.graphCollection.forEach(function(b){a[b].destroy();delete a[b]});a.graphCollection=[];if(N&&u.senkouSpanA[0]&&u.senkouSpanB[0]){C.unshift(0);C.push(u.senkouSpanA.length-1);for(d=0;d<C.length-1;d++){D=C[d];F=C[d+1];e=u.senkouSpanB.slice(D,F+1);D=u.senkouSpanA.slice(D,F+1);if(1<=
Math.floor(e.length/2))if(F=Math.floor(e.length/2),e[F].plotY===D[F].plotY){for(O=K=F=0;O<e.length;O++)F+=e[O].plotY,K+=D[O].plotY;F=F>K?0:1}else F=e[F].plotY>D[F].plotY?0:1;else F=e[0].plotY>D[0].plotY?0:1;J[F]=J[F].concat(e);M[F]=M[F].concat(D)}["graphsenkouSpanColor","graphsenkouSpanNegativeColor"].forEach(function(b,c){J[c].length&&M[c].length&&(Q=0===c?t:N,f({indicator:a,points:J[c],nextPoints:M[c],color:Q,options:g,gap:l,graph:a[b]}),a[b]=a.graph,a.graphCollection.push(b))})}else f({indicator:a,
points:u.senkouSpanB,nextPoints:u.senkouSpanA,color:t,options:g,gap:l,graph:a.graphsenkouSpan}),a.graphsenkouSpan=a.graph;delete a.nextPoints;delete a.fillGraph;a.points=c;a.options=g;a.graph=n},getGraphPath:function(b){b=b||this.points;if(this.fillGraph&&this.nextPoints){var a=h.prototype.getGraphPath.call(this,this.nextPoints);a[0][0]="L";var c=h.prototype.getGraphPath.call(this,b);a=a.slice(0,c.length);for(var f=a.length-1;0<=f;f--)c.push(a[f])}else c=h.prototype.getGraphPath.apply(this,arguments);
return c},getValues:function(b,f){var e=f.period,g=f.periodTenkan;f=f.periodSenkouSpanB;var l=b.xData,q=b.yData,u=q&&q.length||0;b=c(b.xAxis);var d=[],k=[],m;if(!(l.length<=e)&&n(q[0])&&4===q[0].length){var x=l[0]-e*b;for(m=0;m<e;m++)k.push(x+m*b);for(m=0;m<u;m++){if(m>=g){var h=q.slice(m-g,m);h=a(h);h=(h.high+h.low)/2}if(m>=e){var r=q.slice(m-e,m);r=a(r);r=(r.high+r.low)/2;var C=(h+r)/2}if(m>=f){var w=q.slice(m-f,m);w=a(w);w=(w.high+w.low)/2}x=q[m][3];var t=l[m];d[m]===p&&(d[m]=[]);d[m+e]===p&&(d[m+
e]=[]);d[m+e][0]=h;d[m+e][1]=r;d[m+e][2]=p;d[m][2]=x;m<=e&&(d[m+e][3]=p,d[m+e][4]=p);d[m+2*e]===p&&(d[m+2*e]=[]);d[m+2*e][3]=C;d[m+2*e][4]=w;k.push(t)}for(m=1;m<=e;m++)k.push(t+m*b);return{values:d,xData:k,yData:d}}}});""});t(h,"Stock/Indicators/KeltnerChannelsIndicator.js",[h["Core/Globals.js"],h["Core/Utilities.js"],h["Mixins/MultipleLines.js"]],function(d,k,l){var g=k.correctFloat,e=k.merge;k=k.seriesType;var a=d.seriesTypes.sma,c=d.seriesTypes.ema,b=d.seriesTypes.atr;k("keltnerchannels","sma",
{params:{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}">\u25cf</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},e(l,{pointArrayMap:["top","middle","bottom"],pointValKey:"middle",
nameBase:"Keltner Channels",nameComponents:["period","periodATR","multiplierATR"],linesApiNames:["topLine","bottomLine"],requiredIndicators:["ema","atr"],init:function(){a.prototype.init.apply(this,arguments);this.options=e({topLine:{styles:{lineColor:this.color}},bottomLine:{styles:{lineColor:this.color}}},this.options)},getValues:function(a,e){var f=e.period,n=e.periodATR,l=e.multiplierATR,m=a.yData;m=m?m.length:0;var p=[];e=c.prototype.getValues(a,{period:f,index:e.index});var d=b.prototype.getValues(a,
{period:n}),k=[],u=[],h;if(!(m<f)){for(h=f;h<=m;h++){var B=e.values[h-f];var z=d.values[h-n];var v=B[0];a=g(B[1]+l*z[1]);z=g(B[1]-l*z[1]);B=B[1];p.push([v,a,B,z]);k.push(v);u.push([a,B,z])}return{values:p,xData:k,yData:u}}}}));""});t(h,"Stock/Indicators/MACDIndicator.js",[h["Core/Globals.js"],h["Core/Utilities.js"]],function(d,k){var l=k.correctFloat,g=k.defined,e=k.merge;k=k.seriesType;var a=d.seriesTypes.sma,c=d.seriesTypes.ema;k("macd","sma",{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}">\u25cf</span> <b> {series.name}</b><br/>Value: {point.MACD}<br/>Signal: {point.signal}<br/>Histogram: {point.y}<br/>'},dataGrouping:{approximation:"averages"},minPointLength:0},{nameComponents:["longPeriod","shortPeriod","signalPeriod"],
requiredIndicators:["ema"],pointArrayMap:["y","signal","MACD"],parallelArrays:["x","y","signal","MACD"],pointValKey:"y",markerAttribs:d.noop,getColumnMetrics:d.seriesTypes.column.prototype.getColumnMetrics,crispCol:d.seriesTypes.column.prototype.crispCol,init:function(){a.prototype.init.apply(this,arguments);this.options&&(this.options=e({signalLine:{styles:{lineColor:this.color}},macdLine:{styles:{color:this.color}}},this.options),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.resetZones=!0)},toYData:function(b){return[b.y,b.signal,b.MACD]},translate:function(){var b=this,a=["plotSignal","plotMACD"];d.seriesTypes.column.prototype.translate.apply(b);b.points.forEach(function(c){[c.signal,c.MACD].forEach(function(f,e){null!==f&&(c[a[e]]=b.yAxis.toPixels(f,!0))})})},destroy:function(){this.graph=null;this.graphmacd=this.graphmacd&&this.graphmacd.destroy();this.graphsignal=
this.graphsignal&&this.graphsignal.destroy();a.prototype.destroy.apply(this,arguments)},drawPoints:d.seriesTypes.column.prototype.drawPoints,drawGraph:function(){for(var b=this,c=b.points,l=c.length,d=b.options,n=b.zones,q={options:{gapSize:d.gapSize}},m=[[],[]],p;l--;)p=c[l],g(p.plotMACD)&&m[0].push({plotX:p.plotX,plotY:p.plotMACD,isNull:!g(p.plotMACD)}),g(p.plotSignal)&&m[1].push({plotX:p.plotX,plotY:p.plotSignal,isNull:!g(p.plotMACD)});["macd","signal"].forEach(function(c,f){b.points=m[f];b.options=
e(d[c+"Line"].styles,q);b.graph=b["graph"+c];b.currentLineZone=c+"Zones";b.zones=b[b.currentLineZone].zones;a.prototype.drawGraph.call(b);b["graph"+c]=b.graph});b.points=c;b.options=d;b.zones=n;b.currentLineZone=null},getZonesGraphs:function(b){var c=a.prototype.getZonesGraphs.call(this,b),e=c;this.currentLineZone&&(e=c.splice(this[this.currentLineZone].startIndex+1),e.length?e.splice(0,0,b[0]):e=[b[0]]);return e},applyZones:function(){var b=this.zones;this.zones=this.signalZones.zones;a.prototype.applyZones.call(this);
this.graphmacd&&this.options.macdLine.zones.length&&this.graphmacd.hide();this.zones=b},getValues:function(b,a){var e=0,f=[],n=[],d=[];if(!(b.xData.length<a.longPeriod+a.signalPeriod)){var m=c.prototype.getValues(b,{period:a.shortPeriod});var p=c.prototype.getValues(b,{period:a.longPeriod});m=m.values;p=p.values;for(b=1;b<=m.length;b++)g(p[b-1])&&g(p[b-1][1])&&g(m[b+a.shortPeriod+1])&&g(m[b+a.shortPeriod+1][0])&&f.push([m[b+a.shortPeriod+1][0],0,null,m[b+a.shortPeriod+1][1]-p[b-1][1]]);for(b=0;b<
f.length;b++)n.push(f[b][0]),d.push([0,null,f[b][3]]);a=c.prototype.getValues({xData:n,yData:d},{period:a.signalPeriod,index:2});a=a.values;for(b=0;b<f.length;b++)f[b][0]>=a[0][0]&&(f[b][2]=a[e][1],d[b]=[0,a[e][1],f[b][3]],null===f[b][3]?(f[b][1]=0,d[b][0]=0):(f[b][1]=l(f[b][3]-a[e][1]),d[b][0]=l(f[b][3]-a[e][1])),e++);return{values:f,xData:n,yData:d}}}});""});t(h,"Stock/Indicators/MFIIndicator.js",[h["Core/Utilities.js"]],function(d){function k(a){return a.reduce(function(a,b){return a+b})}function l(a){return(a[1]+
a[2]+a[3])/3}var g=d.error,e=d.isArray;d=d.seriesType;d("mfi","sma",{params:{period:14,volumeSeriesID:"volume",decimals:4}},{nameBase:"Money Flow Index",getValues:function(a,c){var b=c.period,f=a.xData,d=a.yData,h=d?d.length:0,n=c.decimals,q=1,m=a.chart.get(c.volumeSeriesID),p=m&&m.yData,C=[],w=[],r=[],A=[],B=[];if(!m)g("Series "+c.volumeSeriesID+" not found! Check `volumeSeriesID`.",!0,a.chart);else if(!(f.length<=b)&&e(d[0])&&4===d[0].length&&p){for(a=l(d[q]);q<b+1;)c=a,a=l(d[q]),c=a>=c,m=a*p[q],
A.push(c?m:0),B.push(c?0:m),q++;for(b=q-1;b<h;b++)b>q-1&&(A.shift(),B.shift(),c=a,a=l(d[b]),c=a>c,m=a*p[b],A.push(c?m:0),B.push(c?0:m)),c=k(B),m=k(A),c=m/c,c=parseFloat((100-100/(1+c)).toFixed(n)),C.push([f[b],c]),w.push(f[b]),r.push(c);return{values:C,xData:w,yData:r}}}});""});t(h,"Stock/Indicators/MomentumIndicator.js",[h["Core/Utilities.js"]],function(d){function k(g,e,a,c,b){a=a[c-1][3]-a[c-b-1][3];e=e[c-1];g.shift();return[e,a]}var l=d.isArray;d=d.seriesType;d("momentum","sma",{params:{period:14}},
{nameBase:"Momentum",getValues:function(g,e){e=e.period;var a=g.xData,c=(g=g.yData)?g.length:0,b=a[0],f=[],d=[],h=[];if(!(a.length<=e)&&l(g[0])){var n=g[0][3];n=[[b,n]];for(b=e+1;b<c;b++){var q=k(n,a,g,b,e,void 0);f.push(q);d.push(q[0]);h.push(q[1])}q=k(n,a,g,b,e,void 0);f.push(q);d.push(q[0]);h.push(q[1]);return{values:f,xData:d,yData:h}}}});""});t(h,"Stock/Indicators/NATRIndicator.js",[h["Core/Globals.js"],h["Core/Utilities.js"]],function(d,k){k=k.seriesType;var l=d.seriesTypes.atr;k("natr","sma",
{tooltip:{valueSuffix:"%"}},{requiredIndicators:["atr"],getValues:function(g,e){var a=l.prototype.getValues.apply(this,arguments),c=a.values.length,b=e.period-1,f=g.yData,d=0;if(a){for(;d<c;d++)a.yData[d]=a.values[d][1]/f[b][3]*100,a.values[d][1]=a.yData[d],b++;return a}}});""});t(h,"Stock/Indicators/PivotPointsIndicator.js",[h["Core/Globals.js"],h["Core/Utilities.js"]],function(d,k){function l(c,b){var e=c.series.pointArrayMap,g=e.length;for(a.prototype.pointClass.prototype[b].call(c);g--;)b="dataLabel"+
e[g],c[b]&&c[b].element&&c[b].destroy(),c[b]=null}var g=k.defined,e=k.isArray;k=k.seriesType;var a=d.seriesTypes.sma;k("pivotpoints","sma",{params:{period:28,algorithm:"standard"},marker:{enabled:!1},enableMouseTracking:!1,dataLabels:{enabled:!0,format:"{point.pivotLine}"},dataGrouping:{approximation:"averages"}},{nameBase:"Pivot Points",pointArrayMap:"R4 R3 R2 R1 P S1 S2 S3 S4".split(" "),pointValKey:"P",toYData:function(a){return[a.P]},translate:function(){var c=this;a.prototype.translate.apply(c);
c.points.forEach(function(b){c.pointArrayMap.forEach(function(a){g(b[a])&&(b["plot"+a]=c.yAxis.toPixels(b[a],!0))})});c.plotEndPoint=c.xAxis.toPixels(c.endPoint,!0)},getGraphPath:function(c){for(var b=this,e=c.length,d=[[],[],[],[],[],[],[],[],[]],l=[],n=b.plotEndPoint,k=b.pointArrayMap.length,m,p,h;e--;){p=c[e];for(h=0;h<k;h++)m=b.pointArrayMap[h],g(p[m])&&d[h].push({plotX:p.plotX,plotY:p["plot"+m],isNull:!1},{plotX:n,plotY:p["plot"+m],isNull:!1},{plotX:n,plotY:null,isNull:!0});n=p.plotX}d.forEach(function(c){l=
l.concat(a.prototype.getGraphPath.call(b,c))});return l},drawDataLabels:function(){var c=this,b=c.pointArrayMap,e,g,d;if(c.options.dataLabels.enabled){var l=c.points.length;b.concat([!1]).forEach(function(f,n){for(d=l;d--;)g=c.points[d],f?(g.y=g[f],g.pivotLine=f,g.plotY=g["plot"+f],e=g["dataLabel"+f],n&&(g["dataLabel"+b[n-1]]=g.dataLabel),g.dataLabels||(g.dataLabels=[]),g.dataLabels[0]=g.dataLabel=e=e&&e.element?e:null):g["dataLabel"+b[n-1]]=g.dataLabel;a.prototype.drawDataLabels.apply(c,arguments)})}},
getValues:function(a,b){var c=b.period,g=a.xData,d=(a=a.yData)?a.length:0;b=this[b.algorithm+"Placement"];var l=[],k=[],m=[],p;if(!(g.length<c)&&e(a[0])&&4===a[0].length){for(p=c+1;p<=d+c;p+=c){var h=g.slice(p-c-1,p);var w=a.slice(p-c-1,p);var r=h.length;var A=h[r-1];w=this.getPivotAndHLC(w);w=b(w);w=l.push([A].concat(w));k.push(A);m.push(l[w-1].slice(1))}this.endPoint=h[0]+(A-h[0])/r*c;return{values:l,xData:k,yData:m}}},getPivotAndHLC:function(a){var b=-Infinity,c=Infinity,e=a[a.length-1][3];a.forEach(function(a){b=
Math.max(b,a[1]);c=Math.min(c,a[2])});return[(b+c+e)/3,b,c,e]},standardPlacement:function(a){var b=a[1]-a[2];return[null,null,a[0]+b,2*a[0]-a[2],a[0],2*a[0]-a[1],a[0]-b,null,null]},camarillaPlacement:function(a){var b=a[1]-a[2];return[a[3]+1.5*b,a[3]+1.25*b,a[3]+1.1666*b,a[3]+1.0833*b,a[0],a[3]-1.0833*b,a[3]-1.1666*b,a[3]-1.25*b,a[3]-1.5*b]},fibonacciPlacement:function(a){var b=a[1]-a[2];return[null,a[0]+b,a[0]+.618*b,a[0]+.382*b,a[0],a[0]-.382*b,a[0]-.618*b,a[0]-b,null]}},{destroyElements:function(){l(this,
"destroyElements")},destroy:function(){l(this,"destroyElements")}});""});t(h,"Stock/Indicators/PPOIndicator.js",[h["Core/Globals.js"],h["Core/Utilities.js"],h["Mixins/IndicatorRequired.js"]],function(d,k,l){var g=k.correctFloat,e=k.error;k=k.seriesType;var a=d.seriesTypes.ema;k("ppo","ema",{params:{periods:[12,26]}},{nameBase:"PPO",nameComponents:["periods"],init:function(){var c=arguments,b=this;l.isParentLoaded(a,"ema",b.type,function(a){a.prototype.init.apply(b,c)})},getValues:function(c,b){var f=
b.periods,d=b.index;b=[];var l=[],n=[],k;if(2!==f.length||f[1]<=f[0])e('Error: "PPO requires two periods. Notice, first period should be lower than the second one."');else{var m=a.prototype.getValues.call(this,c,{index:d,period:f[0]});c=a.prototype.getValues.call(this,c,{index:d,period:f[1]});if(m&&c){f=f[1]-f[0];for(k=0;k<c.yData.length;k++)d=g((m.yData[k+f]-c.yData[k])/c.yData[k]*100),b.push([c.xData[k],d]),l.push(c.xData[k]),n.push(d);return{values:b,xData:l,yData:n}}}}});""});t(h,"Mixins/ReduceArray.js",
[],function(){return{minInArray:function(d,k){return d.reduce(function(d,g){return Math.min(d,g[k])},Number.MAX_VALUE)},maxInArray:function(d,k){return d.reduce(function(d,g){return Math.max(d,g[k])},-Number.MAX_VALUE)},getArrayExtremes:function(d,k,l){return d.reduce(function(g,e){return[Math.min(g[0],e[k]),Math.max(g[1],e[l])]},[Number.MAX_VALUE,-Number.MAX_VALUE])}}});t(h,"Stock/Indicators/PCIndicator.js",[h["Core/Utilities.js"],h["Mixins/ReduceArray.js"],h["Mixins/MultipleLines.js"]],function(d,
k,l){var g=d.merge;d=d.seriesType;var e=k.getArrayExtremes;d("pc","sma",{params:{period:20},lineWidth:1,topLine:{styles:{lineColor:"#90ed7d",lineWidth:1}},bottomLine:{styles:{lineColor:"#f45b5b",lineWidth:1}},dataGrouping:{approximation:"averages"}},g(l,{pointArrayMap:["top","middle","bottom"],pointValKey:"middle",nameBase:"Price Channel",nameComponents:["period"],linesApiNames:["topLine","bottomLine"],getValues:function(a,c){c=c.period;var b=a.xData,f=(a=a.yData)?a.length:0,g=[],d=[],l=[],k;if(!(f<
c)){for(k=c;k<=f;k++){var m=b[k-1];var p=a.slice(k-c,k);var h=e(p,2,1);p=h[1];var w=h[0];h=(p+w)/2;g.push([m,p,h,w]);d.push(m);l.push([p,h,w])}return{values:g,xData:d,yData:l}}}}));""});t(h,"Stock/Indicators/PriceEnvelopesIndicator.js",[h["Core/Globals.js"],h["Core/Utilities.js"]],function(d,k){var l=k.isArray,g=k.merge;k=k.seriesType;var e=d.seriesTypes.sma;k("priceenvelopes","sma",{marker:{enabled:!1},tooltip:{pointFormat:'<span style="color:{point.color}">\u25cf</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"}},{nameComponents:["period","topBand","bottomBand"],nameBase:"Price envelopes",pointArrayMap:["top","middle","bottom"],parallelArrays:["x","y","top","bottom"],pointValKey:"middle",init:function(){e.prototype.init.apply(this,arguments);this.options=g({topLine:{styles:{lineColor:this.color}},bottomLine:{styles:{lineColor:this.color}}},this.options)},
toYData:function(a){return[a.top,a.middle,a.bottom]},translate:function(){var a=this,c=["plotTop","plotMiddle","plotBottom"];e.prototype.translate.apply(a);a.points.forEach(function(b){[b.top,b.middle,b.bottom].forEach(function(e,g){null!==e&&(b[c[g]]=a.yAxis.toPixels(e,!0))})})},drawGraph:function(){for(var a=this,c=a.points,b=c.length,f=a.options,d=a.graph,l={options:{gapSize:f.gapSize}},n=[[],[]],k;b--;)k=c[b],n[0].push({plotX:k.plotX,plotY:k.plotTop,isNull:k.isNull}),n[1].push({plotX:k.plotX,
plotY:k.plotBottom,isNull:k.isNull});["topLine","bottomLine"].forEach(function(b,c){a.points=n[c];a.options=g(f[b].styles,l);a.graph=a["graph"+b];e.prototype.drawGraph.call(a);a["graph"+b]=a.graph});a.points=c;a.options=f;a.graph=d;e.prototype.drawGraph.call(a)},getValues:function(a,c){var b=c.period,f=c.topBand,g=c.bottomBand,d=a.xData,k=(a=a.yData)?a.length:0,h=[],m=[],p=[],C;if(!(d.length<b)&&l(a[0])&&4===a[0].length){for(C=b;C<=k;C++){var w=d.slice(C-b,C);var r=a.slice(C-b,C);r=e.prototype.getValues.call(this,
{xData:w,yData:r},c);w=r.xData[0];r=r.yData[0];var A=r*(1+f);var B=r*(1-g);h.push([w,A,r,B]);m.push(w);p.push([A,r,B])}return{values:h,xData:m,yData:p}}}});""});t(h,"Stock/Indicators/PSARIndicator.js",[h["Core/Utilities.js"]],function(d){d=d.seriesType;d("psar","sma",{lineWidth:0,marker:{enabled:!0},states:{hover:{lineWidthPlus:0}},params:{initialAccelerationFactor:.02,maxAccelerationFactor:.2,increment:.02,index:2,decimals:4}},{nameComponents:!1,getValues:function(d,l){var g=d.xData;d=d.yData;var e=
d[0][1],a=l.maxAccelerationFactor,c=l.increment,b=l.initialAccelerationFactor,f=d[0][2],k=l.decimals,h=l.index,n=[],q=[],m=[],p=1,C;if(!(h>=d.length)){for(C=0;C<h;C++)e=Math.max(d[C][1],e),f=Math.min(d[C][2],parseFloat(f.toFixed(k)));var w=d[C][1]>f?1:-1;l=l.initialAccelerationFactor;var r=l*(e-f);n.push([g[h],f]);q.push(g[h]);m.push(parseFloat(f.toFixed(k)));for(C=h+1;C<d.length;C++){h=d[C-1][2];var A=d[C-2][2];var B=d[C-1][1];var z=d[C-2][1];var v=d[C][1];var y=d[C][2];null!==A&&null!==z&&null!==
h&&null!==B&&null!==v&&null!==y&&(f=w===p?1===w?f+r<Math.min(A,h)?f+r:Math.min(A,h):f+r>Math.max(z,B)?f+r:Math.max(z,B):e,h=1===w?v>e?v:e:y<e?y:e,v=1===p&&y>f||-1===p&&v>f?1:-1,p=v,r=h,y=c,A=a,B=b,l=p===w?1===p&&r>e?l===A?A:parseFloat((l+y).toFixed(2)):-1===p&&r<e?l===A?A:parseFloat((l+y).toFixed(2)):l:B,e=h-f,r=l*e,n.push([g[C],parseFloat(f.toFixed(k))]),q.push(g[C]),m.push(parseFloat(f.toFixed(k))),p=w,w=v,e=h)}return{values:n,xData:q,yData:m}}}});""});t(h,"Stock/Indicators/ROCIndicator.js",[h["Core/Utilities.js"]],
function(d){var k=d.isArray;d=d.seriesType;d("roc","sma",{params:{index:3,period:9}},{nameBase:"Rate of Change",getValues:function(d,g){var e=g.period,a=d.xData,c=(d=d.yData)?d.length:0,b=[],f=[],l=[],h=-1;if(!(a.length<=e)){k(d[0])&&(h=g.index);for(g=e;g<c;g++){var n=0>h?(n=d[g-e])?(d[g]-n)/n*100:null:(n=d[g-e][h])?(d[g][h]-n)/n*100:null;n=[a[g],n];b.push(n);f.push(n[0]);l.push(n[1])}return{values:b,xData:f,yData:l}}}});""});t(h,"Stock/Indicators/RSIIndicator.js",[h["Core/Utilities.js"]],function(d){var k=
d.isArray;d=d.seriesType;d("rsi","sma",{params:{period:14,decimals:4}},{getValues:function(d,g){var e=g.period,a=d.xData,c=(d=d.yData)?d.length:0;g=g.decimals;var b=1,f=[],l=[],h=[],n=0,q=0,m;if(!(a.length<e)&&k(d[0])&&4===d[0].length){for(;b<e;){var p=parseFloat((d[b][3]-d[b-1][3]).toFixed(g));0<p?n+=p:q+=Math.abs(p);b++}var C=parseFloat((n/(e-1)).toFixed(g));for(m=parseFloat((q/(e-1)).toFixed(g));b<c;b++)p=parseFloat((d[b][3]-d[b-1][3]).toFixed(g)),0<p?(n=p,q=0):(n=0,q=Math.abs(p)),C=parseFloat(((C*
(e-1)+n)/e).toFixed(g)),m=parseFloat(((m*(e-1)+q)/e).toFixed(g)),n=0===m?100:0===C?0:parseFloat((100-100/(1+C/m)).toFixed(g)),f.push([a[b],n]),l.push(a[b]),h.push(n);return{values:f,xData:l,yData:h}}}});""});t(h,"Stock/Indicators/StochasticIndicator.js",[h["Core/Globals.js"],h["Core/Utilities.js"],h["Mixins/ReduceArray.js"],h["Mixins/MultipleLines.js"]],function(d,k,l,g){var e=k.isArray,a=k.merge;k=k.seriesType;var c=d.seriesTypes.sma,b=l.getArrayExtremes;k("stochastic","sma",{params:{periods:[14,
3]},marker:{enabled:!1},tooltip:{pointFormat:'<span style="color:{point.color}">\u25cf</span><b> {series.name}</b><br/>%K: {point.y}<br/>%D: {point.smoothed}<br/>'},smoothedLine:{styles:{lineWidth:1,lineColor:void 0}},dataGrouping:{approximation:"averages"}},a(g,{nameComponents:["periods"],nameBase:"Stochastic",pointArrayMap:["y","smoothed"],parallelArrays:["x","y","smoothed"],pointValKey:"y",linesApiNames:["smoothedLine"],init:function(){c.prototype.init.apply(this,arguments);this.options=a({smoothedLine:{styles:{lineColor:this.color}}},
this.options)},getValues:function(a,d){var f=d.periods[0];d=d.periods[1];var g=a.xData,l=(a=a.yData)?a.length:0,k=[],p=[],h=[],u=null,r;if(!(l<f)&&e(a[0])&&4===a[0].length){for(r=f-1;r<l;r++){var A=a.slice(r-f+1,r+1);var B=b(A,2,1);var z=B[0];A=a[r][3]-z;z=B[1]-z;A=A/z*100;p.push(g[r]);h.push([A,null]);r>=f-1+(d-1)&&(u=c.prototype.getValues.call(this,{xData:p.slice(-d),yData:h.slice(-d)},{period:d}),u=u.yData[0]);k.push([g[r],A,u]);h[h.length-1][1]=u}return{values:k,xData:p,yData:h}}}}));""});t(h,
"Stock/Indicators/SlowStochasticIndicator.js",[h["Core/Globals.js"],h["Core/Utilities.js"],h["Mixins/IndicatorRequired.js"]],function(d,k,l){k=k.seriesType;var g=d.seriesTypes;k("slowstochastic","stochastic",{params:{periods:[14,3,3]}},{nameBase:"Slow Stochastic",init:function(){var e=arguments,a=this;l.isParentLoaded(d.seriesTypes.stochastic,"stochastic",a.type,function(c){c.prototype.init.apply(a,e)})},getValues:function(e,a){var c=a.periods,b=g.stochastic.prototype.getValues.call(this,e,a);e={values:[],
xData:[],yData:[]};a=0;if(b){e.xData=b.xData.slice(c[1]-1);b=b.yData.slice(c[1]-1);var d=g.sma.prototype.getValues.call(this,{xData:e.xData,yData:b},{index:1,period:c[2]});if(d){for(var l=e.xData.length;a<l;a++)e.yData[a]=[b[a][1],d.yData[a-c[2]+1]||null],e.values[a]=[e.xData[a],b[a][1],d.yData[a-c[2]+1]||null];return e}}}});""});t(h,"Stock/Indicators/SupertrendIndicator.js",[h["Core/Globals.js"],h["Core/Utilities.js"]],function(d,k){function l(a,b,c){return{index:b,close:a.yData[b][c],x:a.xData[b]}}
var g=k.correctFloat,e=k.merge,a=k.seriesType,c=k.isArray,b=k.objectEach,f=d.seriesTypes.atr,h=d.seriesTypes.sma;a("supertrend","sma",{params:{multiplier:3,period:10},risingTrendColor:"#06B535",fallingTrendColor:"#F21313",changeTrendLine:{styles:{lineWidth:1,lineColor:"#333333",dashStyle:"LongDash"}}},{nameBase:"Supertrend",nameComponents:["multiplier","period"],requiredIndicators:["atr"],init:function(){h.prototype.init.apply(this,arguments);var a=this.options;a.cropThreshold=this.linkedParent.options.cropThreshold-
(a.params.period-1)},drawGraph:function(){var a=this,c=a.options,d=a.linkedParent,f=d?d.points:[],g=a.points,k=a.graph,u=g.length,r=f.length-u;r=0<r?r:0;for(var A={options:{gapSize:c.gapSize}},B={top:[],bottom:[],intersect:[]},z={top:{styles:{lineWidth:c.lineWidth,lineColor:c.fallingTrendColor||c.color,dashStyle:c.dashStyle}},bottom:{styles:{lineWidth:c.lineWidth,lineColor:c.risingTrendColor||c.color,dashStyle:c.dashStyle}},intersect:c.changeTrendLine},v,y,E,t,G,H,D,I;u--;)v=g[u],y=g[u-1],E=f[u-1+
r],t=f[u-2+r],G=f[u+r],H=f[u+r+1],D=v.options.color,I={x:v.x,plotX:v.plotX,plotY:v.plotY,isNull:!1},!t&&E&&d.yData[E.index-1]&&(t=l(d,E.index-1,3)),!H&&G&&d.yData[G.index+1]&&(H=l(d,G.index+1,3)),!E&&t&&d.yData[t.index+1]?E=l(d,t.index+1,3):!E&&G&&d.yData[G.index-1]&&(E=l(d,G.index-1,3)),v&&E&&G&&t&&v.x!==E.x&&(v.x===G.x?(t=E,E=G):v.x===t.x?(E=t,t={close:d.yData[E.index-1][3],x:d.xData[E.index-1]}):H&&v.x===H.x&&(E=H,t=G)),y&&t&&E?(G={x:y.x,plotX:y.plotX,plotY:y.plotY,isNull:!1},v.y>=E.close&&y.y>=
t.close?(v.color=D||c.fallingTrendColor||c.color,B.top.push(I)):v.y<E.close&&y.y<t.close?(v.color=D||c.risingTrendColor||c.color,B.bottom.push(I)):(B.intersect.push(I),B.intersect.push(G),B.intersect.push(e(G,{isNull:!0})),v.y>=E.close&&y.y<t.close?(v.color=D||c.fallingTrendColor||c.color,y.color=D||c.risingTrendColor||c.color,B.top.push(I),B.top.push(e(G,{isNull:!0}))):v.y<E.close&&y.y>=t.close&&(v.color=D||c.risingTrendColor||c.color,y.color=D||c.fallingTrendColor||c.color,B.bottom.push(I),B.bottom.push(e(G,
{isNull:!0}))))):E&&(v.y>=E.close?(v.color=D||c.fallingTrendColor||c.color,B.top.push(I)):(v.color=D||c.risingTrendColor||c.color,B.bottom.push(I)));b(B,function(b,c){a.points=b;a.options=e(z[c].styles,A);a.graph=a["graph"+c+"Line"];h.prototype.drawGraph.call(a);a["graph"+c+"Line"]=a.graph});a.points=g;a.options=c;a.graph=k},getValues:function(a,b){var e=b.period;b=b.multiplier;var d=a.xData,l=a.yData,k=[],h=[],n=[],u=0===e?0:e-1,x=[],z=[],v;if(!(d.length<=e||!c(l[0])||4!==l[0].length||0>e)){a=f.prototype.getValues.call(this,
a,{period:e}).yData;for(v=0;v<a.length;v++){var y=l[u+v];var t=l[u+v-1]||[];var L=x[v-1];var G=z[v-1];var H=n[v-1];0===v&&(L=G=H=0);e=g((y[1]+y[2])/2+b*a[v]);var D=g((y[1]+y[2])/2-b*a[v]);x[v]=e<L||t[3]>L?e:L;z[v]=D>G||t[3]<G?D:G;if(H===L&&y[3]<x[v]||H===G&&y[3]<z[v])var I=x[v];else if(H===L&&y[3]>x[v]||H===G&&y[3]>z[v])I=z[v];k.push([d[u+v],I]);h.push(d[u+v]);n.push(I)}return{values:k,xData:h,yData:n}}}});""});t(h,"Stock/Indicators/VBPIndicator.js",[h["Core/Globals.js"],h["Core/Series/Point.js"],
h["Core/Utilities.js"]],function(d,k,l){var g=l.addEvent,e=l.animObject,a=l.arrayMax,c=l.arrayMin,b=l.correctFloat,f=l.error,h=l.extend,x=l.isArray;l=l.seriesType;var n=Math.abs,q=d.noop,m=d.seriesTypes.column.prototype;l("vbp","sma",{params:{ranges:12,volumeSeriesID:"volume"},zoneLines:{enabled:!0,styles:{color:"#0A9AC9",dashStyle:"LongDash",lineWidth:1}},volumeDivision:{enabled:!0,styles:{positiveColor:"rgba(144, 237, 125, 0.8)",negativeColor:"rgba(244, 91, 91, 0.8)"}},animationLimit:1E3,enableMouseTracking:!1,
pointPadding:0,zIndex:-1,crisp:!0,dataGrouping:{enabled:!1},dataLabels:{allowOverlap:!0,enabled:!0,format:"P: {point.volumePos:.2f} | N: {point.volumeNeg:.2f}",padding:0,style:{fontSize:"7px"},verticalAlign:"top"}},{nameBase:"Volume by Price",bindTo:{series:!1,eventName:"afterSetExtremes"},calculateOn:"render",markerAttribs:q,drawGraph:q,getColumnMetrics:m.getColumnMetrics,crispCol:m.crispCol,init:function(a){d.seriesTypes.sma.prototype.init.apply(this,arguments);var b=this.options.params;var c=this.linkedParent;
b=a.get(b.volumeSeriesID);this.addCustomEvents(c,b);return this},addCustomEvents:function(a,b){function c(){e.chart.redraw();e.setData([]);e.zoneStarts=[];e.zoneLinesSVG&&(e.zoneLinesSVG.destroy(),delete e.zoneLinesSVG)}var e=this;e.dataEventsToUnbind.push(g(a,"remove",function(){c()}));b&&e.dataEventsToUnbind.push(g(b,"remove",function(){c()}));return e},animate:function(a){var b=this,c=b.chart.inverted,d=b.group,f={};!a&&d&&(a=c?"translateY":"translateX",c=c?b.yAxis.top:b.xAxis.left,d["forceAnimate:"+
a]=!0,f[a]=c,d.animate(f,h(e(b.options.animation),{step:function(a,c){b.group.attr({scaleX:Math.max(.001,c.pos)})}})))},drawPoints:function(){this.options.volumeDivision.enabled&&(this.posNegVolume(!0,!0),m.drawPoints.apply(this,arguments),this.posNegVolume(!1,!1));m.drawPoints.apply(this,arguments)},posNegVolume:function(a,b){var c=b?["positive","negative"]:["negative","positive"],e=this.options.volumeDivision,d=this.points.length,f=[],g=[],l=0,k;a?(this.posWidths=f,this.negWidths=g):(f=this.posWidths,
g=this.negWidths);for(;l<d;l++){var h=this.points[l];h[c[0]+"Graphic"]=h.graphic;h.graphic=h[c[1]+"Graphic"];if(a){var m=h.shapeArgs.width;var p=this.priceZones[l];(k=p.wholeVolumeData)?(f.push(m/k*p.positiveVolumeData),g.push(m/k*p.negativeVolumeData)):(f.push(0),g.push(0))}h.color=b?e.styles.positiveColor:e.styles.negativeColor;h.shapeArgs.width=b?this.posWidths[l]:this.negWidths[l];h.shapeArgs.x=b?h.shapeArgs.x:this.posWidths[l]}},translate:function(){var c=this,e=c.options,d=c.chart,f=c.yAxis,
g=f.min,l=c.options.zoneLines,k=c.priceZones,h=0,q,u,x;m.translate.apply(c);var t=c.points;if(t.length){var H=.5>e.pointPadding?e.pointPadding:.1;e=c.volumeDataArray;var D=a(e);var I=d.plotWidth/2;var N=d.plotTop;var J=n(f.toPixels(g)-f.toPixels(g+c.rangeStep));var M=n(f.toPixels(g)-f.toPixels(g+c.rangeStep));H&&(g=n(J*(1-2*H)),h=n((J-g)/2),J=n(g));t.forEach(function(a,e){u=a.barX=a.plotX=0;x=a.plotY=f.toPixels(k[e].start)-N-(f.reversed?J-M:J)-h;q=b(I*k[e].wholeVolumeData/D);a.pointWidth=q;a.shapeArgs=
c.crispCol.apply(c,[u,x,q,J]);a.volumeNeg=k[e].negativeVolumeData;a.volumePos=k[e].positiveVolumeData;a.volumeAll=k[e].wholeVolumeData});l.enabled&&c.drawZones(d,f,c.zoneStarts,l.styles)}},getValues:function(a,b){var c=a.processedXData,e=a.processedYData,d=this.chart,g=b.ranges,l=[],k=[],h=[],m;if(a.chart)if(m=d.get(b.volumeSeriesID))if((b=x(e[0]))&&4!==e[0].length)f("Type of "+a.name+" series is different than line, OHLC or candlestick.",!0,d);else return(this.priceZones=this.specifyZones(b,c,e,
g,m)).forEach(function(a,b){l.push([a.x,a.end]);k.push(l[b][0]);h.push(l[b][1])}),{values:l,xData:k,yData:h};else f("Series "+b.volumeSeriesID+" not found! Check `volumeSeriesID`.",!0,d);else f("Base series not found! In case it has been removed, add a new one.",!0,d)},specifyZones:function(e,d,f,g,l){if(e){var k=f.length;for(var h=f[0][3],m=h,n=1,p;n<k;n++)p=f[n][3],p<h&&(h=p),p>m&&(m=p);k={min:h,max:m}}else k=!1;k=(h=k)?h.min:c(f);p=h?h.max:a(f);h=this.zoneStarts=[];m=[];var q=0;n=1;if(!k||!p)return this.points.length&&
(this.setData([]),this.zoneStarts=[],this.zoneLinesSVG.destroy()),[];var u=this.rangeStep=b(p-k)/g;for(h.push(k);q<g-1;q++)h.push(b(h[q]+u));h.push(p);for(g=h.length;n<g;n++)m.push({index:n-1,x:d[0],start:h[n-1],end:h[n]});return this.volumePerZone(e,m,l,d,f)},volumePerZone:function(a,b,c,e,d){var f=this,g=c.processedXData,l=c.processedYData,h=b.length-1,k=d.length;c=l.length;var m,p,q,u,r;n(k-c)&&(e[0]!==g[0]&&l.unshift(0),e[k-1]!==g[c-1]&&l.push(0));f.volumeDataArray=[];b.forEach(function(b){b.wholeVolumeData=
0;b.positiveVolumeData=0;for(r=b.negativeVolumeData=0;r<k;r++)q=p=!1,u=a?d[r][3]:d[r],m=r?a?d[r-1][3]:d[r-1]:u,u<=b.start&&0===b.index&&(p=!0),u>=b.end&&b.index===h&&(q=!0),(u>b.start||p)&&(u<b.end||q)&&(b.wholeVolumeData+=l[r],m>u?b.negativeVolumeData+=l[r]:b.positiveVolumeData+=l[r]);f.volumeDataArray.push(b.wholeVolumeData)});return b},drawZones:function(a,b,c,e){var d=a.renderer,f=this.zoneLinesSVG,g=[],l=a.plotWidth,h=a.plotTop,k;c.forEach(function(c){k=b.toPixels(c)-h;g=g.concat(a.renderer.crispLine([["M",
0,k],["L",l,k]],e.lineWidth))});f?f.animate({d:g}):f=this.zoneLinesSVG=d.path(g).attr({"stroke-width":e.lineWidth,stroke:e.color,dashstyle:e.dashStyle,zIndex:this.group.zIndex+.1}).add(this.group)}},{destroy:function(){this.negativeGraphic&&(this.negativeGraphic=this.negativeGraphic.destroy());return k.prototype.destroy.apply(this,arguments)}});""});t(h,"Stock/Indicators/VWAPIndicator.js",[h["Core/Utilities.js"]],function(d){var h=d.error,l=d.isArray;d=d.seriesType;d("vwap","sma",{params:{period:30,
volumeSeriesID:"volume"}},{getValues:function(d,e){var a=d.chart,c=d.xData;d=d.yData;var b=e.period,f=!0,g;if(g=a.get(e.volumeSeriesID))return l(d[0])||(f=!1),this.calculateVWAPValues(f,c,d,g,b);h("Series "+e.volumeSeriesID+" not found! Check `volumeSeriesID`.",!0,a)},calculateVWAPValues:function(d,e,a,c,b){var f=c.yData,g=c.xData.length,l=e.length;c=[];var h=[],k=[],m=[],p=[],t;g=l<=g?l:g;for(t=l=0;l<g;l++){var w=d?(a[l][1]+a[l][2]+a[l][3])/3:a[l];w*=f[l];w=t?c[l-1]+w:w;var r=t?h[l-1]+f[l]:f[l];
c.push(w);h.push(r);p.push([e[l],w/r]);k.push(p[l][0]);m.push(p[l][1]);t++;t===b&&(t=0)}return{values:p,xData:k,yData:m}}});""});t(h,"Stock/Indicators/WilliamsRIndicator.js",[h["Core/Utilities.js"],h["Mixins/ReduceArray.js"]],function(d,h){var l=d.isArray;d=d.seriesType;var g=h.getArrayExtremes;d("williamsr","sma",{params:{period:14}},{nameBase:"Williams %R",getValues:function(e,a){a=a.period;var c=e.xData,b=(e=e.yData)?e.length:0,d=[],h=[],k=[],n;if(!(c.length<a)&&l(e[0])&&4===e[0].length){for(n=
a-1;n<b;n++){var q=e.slice(n-a+1,n+1);var m=g(q,2,1);q=m[0];m=m[1];var p=e[n][3];q=(m-p)/(m-q)*-100;c[n]&&(d.push([c[n],q]),h.push(c[n]),k.push(q))}return{values:d,xData:h,yData:k}}}});""});t(h,"Stock/Indicators/WMAIndicator.js",[h["Core/Utilities.js"]],function(d){function h(e,a){a*=(a+1)/2;return e.reduce(function(a,b,e){return[null,a[1]+b[1]*(e+1)]})[1]/a}function l(e,a,c,b){c=h(e,e.length);a=a[b-1];e.shift();return[a,c]}var g=d.isArray;d=d.seriesType;d("wma","sma",{params:{index:3,period:9}},
{getValues:function(e,a){var c=a.period,b=e.xData,d=(e=e.yData)?e.length:0,h=1,k=b[0],n=e[0],q=[],m=[],p=[],t=-1;if(!(b.length<c)){g(e[0])&&(t=a.index,n=e[0][t]);for(a=[[k,n]];h!==c;)a.push([b[h],0>t?e[h]:e[h][t]]),h++;for(c=h;c<d;c++)h=l(a,b,e,c),q.push(h),m.push(h[0]),p.push(h[1]),a.push([b[c],0>t?e[c]:e[c][t]]);h=l(a,b,e,c);q.push(h);m.push(h[0]);p.push(h[1]);return{values:q,xData:m,yData:p}}}});""});t(h,"Stock/Indicators/ZigzagIndicator.js",[h["Core/Utilities.js"]],function(d){d=d.seriesType;
d("zigzag","sma",{params:{lowIndex:2,highIndex:1,deviation:1}},{nameComponents:["deviation"],nameSuffixes:["%"],nameBase:"Zig Zag",getValues:function(d,h){var g=h.lowIndex,e=h.highIndex,a=h.deviation/100;h=1+a;var c=1-a;a=d.xData;var b=d.yData;d=b?b.length:0;var f=[],l=[],k=[],n,q,m=!1,p=!1;if(!(!a||1>=a.length||d&&(void 0===b[0][g]||void 0===b[0][e]))){var t=b[0][g];var w=b[0][e];for(n=1;n<d;n++){if(b[n][g]<=w*c){f.push([a[0],w]);var r=[a[n],b[n][g]];m=q=!0}else b[n][e]>=t*h&&(f.push([a[0],t]),r=
[a[n],b[n][e]],q=!1,m=!0);if(m){l.push(f[0][0]);k.push(f[0][1]);var A=n++;n=d}}for(n=A;n<d;n++)q?(b[n][g]<=r[1]&&(r=[a[n],b[n][g]]),b[n][e]>=r[1]*h&&(p=e)):(b[n][e]>=r[1]&&(r=[a[n],b[n][e]]),b[n][g]<=r[1]*c&&(p=g)),!1!==p&&(f.push(r),l.push(r[0]),k.push(r[1]),r=[a[n],b[n][p]],q=!q,p=!1);g=f.length;0!==g&&f[g-1][0]<a[d-1]&&(f.push(r),l.push(r[0]),k.push(r[1]));return{values:f,xData:l,yData:k}}}});""});t(h,"Stock/Indicators/RegressionIndicators.js",[h["Core/Utilities.js"]],function(d){var h=d.isArray;
d=d.seriesType;d("linearRegression","sma",{params:{xAxisUnit:void 0},tooltip:{valueDecimals:4}},{nameBase:"Linear Regression Indicator",getRegressionLineParameters:function(d,g){var e=this.options.params.index,a=function(a,b){return h(a)?a[b]:a},c=d.reduce(function(a,b){return b+a},0),b=g.reduce(function(b,c){return a(c,e)+b},0);c/=d.length;b/=g.length;var f=0,l=0,k;for(k=0;k<d.length;k++){var n=d[k]-c;var q=a(g[k],e)-b;f+=n*q;l+=Math.pow(n,2)}d=l?f/l:0;return{slope:d,intercept:b-d*c}},getEndPointY:function(d,
g){return d.slope*g+d.intercept},transformXData:function(d,g){var e=d[0];return d.map(function(a){return(a-e)/g})},findClosestDistance:function(d){var g,e;for(e=1;e<d.length-1;e++){var a=d[e]-d[e-1];0<a&&("undefined"===typeof g||a<g)&&(g=a)}return g},getValues:function(d,g){var e=d.xData;d=d.yData;g=g.period;var a,c={xData:[],yData:[],values:[]},b=this.options.params.xAxisUnit||this.findClosestDistance(e);for(a=g-1;a<=e.length-1;a++){var f=a-g+1;var h=a+1;var l=e[a];var k=e.slice(f,h);f=d.slice(f,
h);h=this.transformXData(k,b);k=this.getRegressionLineParameters(h,f);f=this.getEndPointY(k,h[h.length-1]);c.values.push({regressionLineParameters:k,x:l,y:f});c.xData.push(l);c.yData.push(f)}return c}});d("linearRegressionSlope","linearRegression",{},{nameBase:"Linear Regression Slope Indicator",getEndPointY:function(d){return d.slope}});d("linearRegressionIntercept","linearRegression",{},{nameBase:"Linear Regression Intercept Indicator",getEndPointY:function(d){return d.intercept}});d("linearRegressionAngle",
"linearRegression",{tooltip:{pointFormat:'<span style="color:{point.color}">\u25cf</span>{series.name}: <b>{point.y}\u00b0</b><br/>'}},{nameBase:"Linear Regression Angle Indicator",slopeToAngle:function(d){return 180/Math.PI*Math.atan(d)},getEndPointY:function(d){return this.slopeToAngle(d.slope)}});""});t(h,"Stock/Indicators/ABIndicator.js",[h["Core/Globals.js"],h["Core/Utilities.js"],h["Mixins/MultipleLines.js"]],function(d,h,l){var g=h.correctFloat,e=h.merge;h=h.seriesType;var a=d.seriesTypes.sma;
h("abands","sma",{params:{period:20,factor:.001,index:3},lineWidth:1,topLine:{styles:{lineWidth:1}},bottomLine:{styles:{lineWidth:1}},dataGrouping:{approximation:"averages"}},e(l,{pointArrayMap:["top","middle","bottom"],pointValKey:"middle",nameBase:"Acceleration Bands",nameComponents:["period","factor"],linesApiNames:["topLine","bottomLine"],getValues:function(c,b){var d=b.period,e=b.factor;b=b.index;var h=c.xData,k=(c=c.yData)?c.length:0,l=[],m=[],p=[],t=[],w=[],r;if(!(k<d)){for(r=0;r<=k;r++){if(r<
k){var A=c[r][2];var B=c[r][1];var z=e;A=g(B-A)/(g(B+A)/2)*1E3*z;l.push(c[r][1]*g(1+2*A));m.push(c[r][2]*g(1-2*A))}if(r>=d){A=h.slice(r-d,r);var v=c.slice(r-d,r);z=a.prototype.getValues.call(this,{xData:A,yData:l.slice(r-d,r)},{period:d});B=a.prototype.getValues.call(this,{xData:A,yData:m.slice(r-d,r)},{period:d});v=a.prototype.getValues.call(this,{xData:A,yData:v},{period:d,index:b});A=v.xData[0];z=z.yData[0];B=B.yData[0];v=v.yData[0];p.push([A,z,v,B]);t.push(A);w.push([z,v,B])}}return{values:p,
xData:t,yData:w}}}}));""});t(h,"Stock/Indicators/TrendLineIndicator.js",[h["Core/Utilities.js"]],function(d){var h=d.isArray;d=d.seriesType;d("trendline","sma",{params:{index:3}},{nameBase:"Trendline",nameComponents:!1,getValues:function(d,g){var e=d.xData,a=d.yData;d=[];var c=[],b=[],f=0,k=0,l=0,n=0,q=e.length,m=g.index;for(g=0;g<q;g++){var p=e[g];var t=h(a[g])?a[g][m]:a[g];f+=p;k+=t;l+=p*t;n+=p*p}a=(q*l-f*k)/(q*n-f*f);isNaN(a)&&(a=0);f=(k-a*f)/q;for(g=0;g<q;g++)p=e[g],t=a*p+f,d[g]=[p,t],c[g]=p,
b[g]=t;return{xData:c,yData:b,values:d}}});""});t(h,"masters/indicators/indicators-all.src.js",[],function(){})});
//# sourceMappingURL=indicators-all.js.map