9 lines
2.1 KiB
JavaScript
9 lines
2.1 KiB
JavaScript
!/**
|
|
* Highstock JS v11.4.1 (2024-04-04)
|
|
*
|
|
* Indicator series type for Highcharts Stock
|
|
*
|
|
* (c) 2010-2024 Wojciech Chmiel
|
|
*
|
|
* License: www.highcharts.com/license
|
|
*/function(o){"object"==typeof module&&module.exports?(o.default=o,module.exports=o):"function"==typeof define&&define.amd?define("highcharts/indicators/ao",["highcharts","highcharts/modules/stock"],function(t){return o(t),o.Highcharts=t,o}):o("undefined"!=typeof Highcharts?Highcharts:void 0)}(function(o){"use strict";var t=o?o._modules:{};function e(o,t,e,r){o.hasOwnProperty(t)||(o[t]=r.apply(null,e),"function"==typeof CustomEvent&&window.dispatchEvent(new CustomEvent("HighchartsModuleLoaded",{detail:{path:t,module:o[t]}})))}e(t,"Stock/Indicators/AO/AOIndicator.js",[t["Core/Globals.js"],t["Core/Series/SeriesRegistry.js"],t["Core/Utilities.js"]],function(o,t,e){let{noop:r}=o,{column:{prototype:s},sma:i}=t.seriesTypes,{extend:a,merge:n,correctFloat:l,isArray:d}=e;class c extends i{drawGraph(){let o;let t=this.options,e=this.points,r=this.userOptions.color,s=t.greaterBarColor,i=t.lowerBarColor,a=e[0];if(!r&&a)for(o=1,a.color=s;o<e.length;o++)e[o].y>e[o-1].y?e[o].color=s:e[o].y<e[o-1].y?e[o].color=i:e[o].color=e[o-1].color}getValues(o){let t=o.xData||[],e=o.yData||[],r=e.length,s=[],i=[],a=[],n,c,u,h,p,f,g=0,m=0;if(!(t.length<=34)&&d(e[0])&&4===e[0].length){for(p=0;p<33;p++)h=(e[p][1]+e[p][2])/2,p>=29&&(m=l(m+h)),g=l(g+h);for(f=33;f<r;f++)m=l(m+(h=(e[f][1]+e[f][2])/2)),g=l(g+h),n=l(m/5-g/34),s.push([t[f],n]),i.push(t[f]),a.push(n),c=f+1-5,u=f+1-34,m=l(m-(e[c][1]+e[c][2])/2),g=l(g-(e[u][1]+e[u][2])/2);return{values:s,xData:i,yData:a}}}}return c.defaultOptions=n(i.defaultOptions,{params:{index:void 0,period:void 0},greaterBarColor:"#06b535",lowerBarColor:"#f21313",threshold:0,groupPadding:.2,pointPadding:.2,crisp:!1,states:{hover:{halo:{size:0}}}}),a(c.prototype,{nameBase:"AO",nameComponents:void 0,markerAttribs:r,getColumnMetrics:s.getColumnMetrics,crispCol:s.crispCol,translate:s.translate,drawPoints:s.drawPoints}),t.registerSeriesType("ao",c),c}),e(t,"masters/indicators/ao.src.js",[t["Core/Globals.js"]],function(o){return o})}); |