highcharts
Version:
JavaScript charting framework
14 lines • 2.79 kB
JavaScript
!/**
* Highstock JS v12.6.0 (2026-04-13)
* @module highcharts/indicators/apo
* @requires highcharts
* @requires highcharts/modules/stock
*
* Indicator series type for Highcharts Stock
*
* (c) 2010-2026 Highsoft AS
* Author: Wojciech Chmiel
*
* A commercial license may be required depending on use.
* See www.highcharts.com/license
*/function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(e._Highcharts,e._Highcharts.SeriesRegistry):"function"==typeof define&&define.amd?define("highcharts/indicators/apo",["highcharts/highcharts"],function(e){return t(e,e.SeriesRegistry)}):"object"==typeof exports?exports["highcharts/indicators/apo"]=t(e._Highcharts,e._Highcharts.SeriesRegistry):e.Highcharts=t(e.Highcharts,e.Highcharts.SeriesRegistry)}("u"<typeof window?this:window,(e,t)=>(()=>{"use strict";var r={512:e=>{e.exports=t},944:t=>{t.exports=e}},o={};function i(e){var t=o[e];if(void 0!==t)return t.exports;var n=o[e]={exports:{}};return r[e](n,n.exports,i),n.exports}i.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return i.d(t,{a:t}),t},i.d=(e,t)=>{for(var r in t)i.o(t,r)&&!i.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},i.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var n={};i.d(n,{default:()=>g});var a=i(944),s=i.n(a),p=i(512),c=i.n(p);let{doc:u,win:l}=s();function h(e){return d(e)&&"number"==typeof e.nodeType}function d(e,t){let r;return!!e&&"object"==typeof e&&(!t||"[object Array]"!==(r=Object.prototype.toString.call(e))&&"[object Array Iterator]"!==r)}Array.prototype.find;let{ema:f}=c().seriesTypes;class y extends f{getValues(e,t){let r,o,i=t.periods,n=t.index,s=[],p=[],c=[];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:n,period:i[0]}),l=super.getValues.call(this,e,{index:n,period:i[1]});if(!u||!l)return;let h=i[1]-i[0];for(o=0;o<l.yData.length;o++)r=u.yData[o+h]-l.yData[o],s.push([l.xData[o],r]),p.push(l.xData[o]),c.push(r);return{values:s,xData:p,yData:c}}}y.defaultOptions=function(e,...t){let r,o=[e,...t],i={},n=function(e,t){return"object"!=typeof e&&(e={}),function(e,t,r){for(let r in e)Object.hasOwnProperty.call(e,r)&&t.call((0,e[r]),e[r],r,e)}(t,function(r,o){if("__proto__"!==o&&"constructor"!==o){let i;!d(r,!0)||(i=r?.constructor,d(r,!0)&&!h(r)&&i?.name&&"Object"!==i.name)||h(r)?e[o]=t[o]:e[o]=n(e[o]||{},r)}}),e};!0===e&&(i=o[1],o=Array.prototype.slice.call(o,2));let a=o.length;for(r=0;r<a;r++)i=n(i,o[r]);return i}(f.defaultOptions,{params:{period:void 0,periods:[10,20]}}),function(e,t){let r;for(r in e||(e={}),t)e[r]=t[r]}(y.prototype,{nameBase:"APO",nameComponents:["periods"]}),c().registerSeriesType("apo",y);let g=s();return n.default})());