Icard/angular-clarity-master(work.../node_modules/highcharts/indicators/mfi.js

9 lines
1.9 KiB
JavaScript

!/**
* Highstock JS v11.4.1 (2024-04-04)
*
* Money Flow Index indicator for Highcharts Stock
*
* (c) 2010-2024 Grzegorz Blachliński
*
* License: www.highcharts.com/license
*/function(e){"object"==typeof module&&module.exports?(e.default=e,module.exports=e):"function"==typeof define&&define.amd?define("highcharts/indicators/mfi",["highcharts","highcharts/modules/stock"],function(t){return e(t),e.Highcharts=t,e}):e("undefined"!=typeof Highcharts?Highcharts:void 0)}(function(e){"use strict";var t=e?e._modules:{};function s(e,t,s,i){e.hasOwnProperty(t)||(e[t]=i.apply(null,s),"function"==typeof CustomEvent&&window.dispatchEvent(new CustomEvent("HighchartsModuleLoaded",{detail:{path:t,module:e[t]}})))}s(t,"Stock/Indicators/MFI/MFIIndicator.js",[t["Core/Series/SeriesRegistry.js"],t["Core/Utilities.js"]],function(e,t){let{sma:s}=e.seriesTypes,{extend:i,merge:o,error:r,isArray:n}=t;function u(e){return e.reduce(function(e,t){return e+t})}function a(e){return(e[1]+e[2]+e[3])/3}class d extends s{getValues(e,t){let s=t.period,i=e.xData,o=e.yData,d=o?o.length:0,c=t.decimals,h=e.chart.get(t.volumeSeriesID),l=h&&h.yData,f=[],p=[],m=[],g=[],y=[],v,D,I,S,x,j,C=!1,w=1;if(!h){r("Series "+t.volumeSeriesID+" not found! Check `volumeSeriesID`.",!0,e.chart);return}if(!(i.length<=s)&&n(o[0])&&4===o[0].length&&l){for(v=a(o[w]);w<s+1;)D=v,C=(v=a(o[w]))>=D,I=v*l[w],g.push(C?I:0),y.push(C?0:I),w++;for(j=w-1;j<d;j++)j>w-1&&(g.shift(),y.shift(),D=v,C=(v=a(o[j]))>D,I=v*l[j],g.push(C?I:0),y.push(C?0:I)),S=u(y),x=parseFloat((100-100/(1+u(g)/S)).toFixed(c)),f.push([i[j],x]),p.push(i[j]),m.push(x);return{values:f,xData:p,yData:m}}}}return d.defaultOptions=o(s.defaultOptions,{params:{index:void 0,volumeSeriesID:"volume",decimals:4}}),i(d.prototype,{nameBase:"Money Flow Index"}),e.registerSeriesType("mfi",d),d}),s(t,"masters/indicators/mfi.src.js",[t["Core/Globals.js"]],function(e){return e})});