UNPKG

highcharts

Version:
14 lines 5.24 kB
!/** * Highstock JS v12.6.0 (2026-04-13) * @module highcharts/indicators/price-channel * @requires highcharts * @requires highcharts/modules/stock * * Indicator series type for Highcharts Stock * * (c) 2010-2026 Highsoft AS * Author: Daniel Studencki * * A commercial license may be required depending on use. * See www.highcharts.com/license */function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(t._Highcharts,t._Highcharts.SeriesRegistry):"function"==typeof define&&define.amd?define("highcharts/indicators/price-channel",["highcharts/highcharts"],function(t){return e(t,t.SeriesRegistry)}):"object"==typeof exports?exports["highcharts/indicators/price-channel"]=e(t._Highcharts,t._Highcharts.SeriesRegistry):t.Highcharts=e(t.Highcharts,t.Highcharts.SeriesRegistry)}("u"<typeof window?this:window,(t,e)=>(()=>{"use strict";var r,o={512:t=>{t.exports=e},944:e=>{e.exports=t}},i={};function n(t){var e=i[t];if(void 0!==e)return e.exports;var r=i[t]={exports:{}};return o[t](r,r.exports,n),r.exports}n.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return n.d(e,{a:e}),e},n.d=(t,e)=>{for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);var a={};n.d(a,{default:()=>v});var s=n(944),p=n.n(s);let l=function(t,e,r){return t.reduce((t,o)=>[Math.min(t[0],o[e]),Math.max(t[1],o[r])],[Number.MAX_VALUE,-Number.MAX_VALUE])};var h=n(512),c=n.n(h);let{doc:u,win:f}=p();function y(t){return d(t)&&"number"==typeof t.nodeType}function d(t,e){let r;return!!t&&"object"==typeof t&&(!e||"[object Array]"!==(r=Object.prototype.toString.call(t))&&"[object Array Iterator]"!==r)}function g(t,...e){let r,o=[t,...e],i={},n=function(t,e){return"object"!=typeof t&&(t={}),function(t,e,r){for(let r in t)Object.hasOwnProperty.call(t,r)&&e.call((0,t[r]),t[r],r,t)}(e,function(r,o){if("__proto__"!==o&&"constructor"!==o){let i;!d(r,!0)||(i=r?.constructor,d(r,!0)&&!y(r)&&i?.name&&"Object"!==i.name)||y(r)?t[o]=e[o]:t[o]=n(t[o]||{},r)}}),t};!0===t&&(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}Array.prototype.find;let{sma:{prototype:m}}=c().seriesTypes;!function(t){let e=["bottomLine"],r=["top","bottom"],o=["top"];function i(t){return"plot"+t.charAt(0).toUpperCase()+t.slice(1)}function n(t,e){let r=[];return(t.pointArrayMap||[]).forEach(t=>{t!==e&&r.push(i(t))}),r}function a(){let t=this,e=t.pointValKey,r=t.linesApiNames,o=t.areaLinesNames,a=t.points,p=t.options,l=t.graph,h={options:{gapSize:p.gapSize}},c=[],u=n(t,e),f=a.length,y;if(u.forEach((t,e)=>{for(c[e]=[];f--;)y=a[f],c[e].push({x:y.x,plotX:y.plotX,plotY:y[t],isNull:null==y[t]});f=a.length}),t.userOptions.fillColor&&o.length){let e=c[u.indexOf(i(o[0]))],r=1===o.length?a:c[u.indexOf(i(o[1]))],n=t.color;t.points=r,t.nextPoints=e,t.color=t.userOptions.fillColor,t.options=g(a,h),t.graph=t.area,t.fillGraph=!0,m.drawGraph.call(t),t.area=t.graph,delete t.nextPoints,delete t.fillGraph,t.color=n}r.forEach((e,r)=>{c[r]?(t.points=c[r],p[e]?t.options=g(p[e].styles,h):(0,s.error)('Error: "There is no '+e+' in DOCS options declared. Check if linesApiNames are consistent with your DOCS line names."'),t.graph=t["graph"+e],m.drawGraph.call(t),t["graph"+e]=t.graph):(0,s.error)('Error: "'+e+" doesn't have equivalent in pointArrayMap. To many elements in linesApiNames relative to pointArrayMap.\"")}),t.points=a,t.options=p,t.graph=l,m.drawGraph.call(t)}function p(t){let e,r=[],o=[];if(t=t||this.points,this.fillGraph&&this.nextPoints){if((e=m.getGraphPath.call(this,this.nextPoints))&&e.length){e[0][0]="L",r=m.getGraphPath.call(this,t),o=e.slice(0,r.length);for(let t=o.length-1;t>=0;t--)r.push(o[t])}}else r=m.getGraphPath.apply(this,arguments);return r}function l(t){let e=[];return(this.pointArrayMap||[]).forEach(r=>{e.push(t[r])}),e}function h(){let t=this.pointArrayMap,e=[],r;e=n(this),m.translate.apply(this,arguments),this.points.forEach(o=>{t.forEach((t,i)=>{r=o[t],this.dataModify&&(r=this.dataModify.modifyValue(r)),null!==r&&(o[e[i]]=this.yAxis.toPixels(r,!0))})})}t.compose=function(t){let i=t.prototype;return i.linesApiNames=i.linesApiNames||e.slice(),i.pointArrayMap=i.pointArrayMap||r.slice(),i.pointValKey=i.pointValKey||"top",i.areaLinesNames=i.areaLinesNames||o.slice(),i.drawGraph=a,i.getGraphPath=p,i.toYData=l,i.translate=h,t}}(r||(r={}));let x=r,{sma:A}=c().seriesTypes;class b extends A{getValues(t,e){let r,o,i,n,a,s,p=e.period,h=t.xData,c=t.yData,u=c?c.length:0,f=[],y=[],d=[];if(!(u<p)){for(s=p;s<=u;s++)n=h[s-1],r=((o=(a=l(c.slice(s-p,s),2,1))[1])+(i=a[0]))/2,f.push([n,o,r,i]),y.push(n),d.push([o,r,i]);return{values:f,xData:y,yData:d}}}}b.defaultOptions=g(A.defaultOptions,{params:{index:void 0,period:20},lineWidth:1,topLine:{styles:{lineColor:"#00e272",lineWidth:1}},bottomLine:{styles:{lineColor:"#feb56a",lineWidth:1}},dataGrouping:{approximation:"averages"}}),function(t,e){let r;for(r in t||(t={}),e)t[r]=e[r]}(b.prototype,{areaLinesNames:["top","bottom"],nameBase:"Price Channel",nameComponents:["period"],linesApiNames:["topLine","bottomLine"],pointArrayMap:["top","middle","bottom"],pointValKey:"middle"}),x.compose(b),c().registerSeriesType("pc",b);let v=p();return a.default})());