=f&&(c=g.slice(d-f,d),u=x.slice(d-f,d),p=super.getValues.call(this,{xData:c,yData:D.slice(d-f,d)},{period:f}),h=super.getValues.call(this,{xData:c,yData:C.slice(d-f,d)},{period:f}),n=(l=super.getValues.call(this,{xData:c,yData:u},{period:f,index:m})).xData[0],a=p.yData[0],s=h.yData[0],i=l.yData[0],G.push([n,a,i,s]),L.push(n),M.push([a,i,s]))}return{values:G,xData:L,yData:M}}}}return r.defaultOptions=n(a.defaultOptions,{params:{period:20,factor:.001,index:3},lineWidth:1,topLine:{styles:{lineWidth:1}},bottomLine:{styles:{lineWidth:1}},dataGrouping:{approximation:"averages"}}),s(r.prototype,{areaLinesNames:["top","bottom"],linesApiNames:["topLine","bottomLine"],nameBase:"Acceleration Bands",nameComponents:["period","factor"],pointArrayMap:["top","middle","bottom"],pointValKey:"middle"}),t.compose(r),e.registerSeriesType("abands",r),r}),i(e,"masters/indicators/acceleration-bands.src.js",[e["Core/Globals.js"]],function(t){return t})});
--------------------------------------------------------------------------------
/h2-highchart/stock-tools/accumulation-distribution.js:
--------------------------------------------------------------------------------
1 | !/**
2 | * Highstock JS v11.4.0 (2024-03-04)
3 | *
4 | * Indicator series type for Highcharts Stock
5 | *
6 | * (c) 2010-2024 Sebastian Bochan
7 | *
8 | * License: www.highcharts.com/license
9 | */function(e){"object"==typeof module&&module.exports?(e.default=e,module.exports=e):"function"==typeof define&&define.amd?define("highcharts/indicators/accumulation-distribution",["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 i(e,t,i,o){e.hasOwnProperty(t)||(e[t]=o.apply(null,i),"function"==typeof CustomEvent&&window.dispatchEvent(new CustomEvent("HighchartsModuleLoaded",{detail:{path:t,module:e[t]}})))}i(t,"Stock/Indicators/AD/ADIndicator.js",[t["Core/Series/SeriesRegistry.js"],t["Core/Utilities.js"]],function(e,t){let{sma:i}=e.seriesTypes,{error:o,extend:s,merge:n}=t;class a extends i{static populateAverage(e,t,i,o,s){let n=t[o][1],a=t[o][2],r=t[o][3],u=i[o];return[e[o],r===n&&r===a||n===a?0:(2*r-a-n)/(n-a)*u]}getValues(e,t){let i,s,n;let r=t.period,u=e.xData,l=e.yData,c=t.volumeSeriesID,d=e.chart.get(c),h=d&&d.yData,p=l?l.length:0,f=[],m=[],g=[];if(!(u.length<=r)||!p||4===l[0].length){if(!d){o("Series "+c+" not found! Check `volumeSeriesID`.",!0,e.chart);return}for(s=r;s0&&(n[1]+=f[i-1][1]),f.push(n),m.push(n[0]),g.push(n[1]);return{values:f,xData:m,yData:g}}}}return a.defaultOptions=n(i.defaultOptions,{params:{index:void 0,volumeSeriesID:"volume"}}),s(a.prototype,{nameComponents:!1,nameBase:"Accumulation/Distribution"}),e.registerSeriesType("ad",a),a}),i(t,"masters/indicators/accumulation-distribution.src.js",[t["Core/Globals.js"]],function(e){return e})});
--------------------------------------------------------------------------------
/h2-highchart/stock-tools/accumulation-distribution.js.map:
--------------------------------------------------------------------------------
1 | {"version":3,"sources":[""],"sourcesContent":["/**\n * @license Highstock JS v11.4.0 (2024-03-04)\n *\n * Indicator series type for Highcharts Stock\n *\n * (c) 2010-2024 Sebastian Bochan\n *\n * License: www.highcharts.com/license\n */\n(function (factory) {\n if (typeof module === 'object' && module.exports) {\n factory['default'] = factory;\n module.exports = factory;\n } else if (typeof define === 'function' && define.amd) {\n define('highcharts/indicators/accumulation-distribution', ['highcharts', 'highcharts/modules/stock'], function (Highcharts) {\n factory(Highcharts);\n factory.Highcharts = Highcharts;\n return factory;\n });\n } else {\n factory(typeof Highcharts !== 'undefined' ? Highcharts : undefined);\n }\n}(function (Highcharts) {\n 'use strict';\n var _modules = Highcharts ? Highcharts._modules : {};\n function _registerModule(obj, path, args, fn) {\n if (!obj.hasOwnProperty(path)) {\n obj[path] = fn.apply(null, args);\n\n if (typeof CustomEvent === 'function') {\n window.dispatchEvent(new CustomEvent(\n 'HighchartsModuleLoaded',\n { detail: { path: path, module: obj[path] } }\n ));\n }\n }\n }\n _registerModule(_modules, 'Stock/Indicators/AD/ADIndicator.js', [_modules['Core/Series/SeriesRegistry.js'], _modules['Core/Utilities.js']], function (SeriesRegistry, U) {\n /* *\n *\n * License: www.highcharts.com/license\n *\n * !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!!\n * */\n const { sma: SMAIndicator } = SeriesRegistry.seriesTypes;\n const { error, extend, merge } = U;\n /* *\n *\n * Class\n *\n * */\n /**\n * The AD series type.\n *\n * @private\n * @class\n * @name Highcharts.seriesTypes.ad\n *\n * @augments Highcharts.Series\n */\n class ADIndicator extends SMAIndicator {\n /* *\n *\n * Static Functions\n *\n * */\n static populateAverage(xVal, yVal, yValVolume, i, \n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n _period) {\n const high = yVal[i][1], low = yVal[i][2], close = yVal[i][3], volume = yValVolume[i], adY = close === high && close === low || high === low ?\n 0 :\n ((2 * close - low - high) / (high - low)) * volume, adX = xVal[i];\n return [adX, adY];\n }\n /* *\n *\n * Functions\n *\n * */\n getValues(series, params) {\n const period = params.period, xVal = series.xData, yVal = series.yData, volumeSeriesID = params.volumeSeriesID, volumeSeries = series.chart.get(volumeSeriesID), yValVolume = volumeSeries && volumeSeries.yData, yValLen = yVal ? yVal.length : 0, AD = [], xData = [], yData = [];\n let len, i, ADPoint;\n if (xVal.length <= period &&\n yValLen &&\n yVal[0].length !== 4) {\n return;\n }\n if (!volumeSeries) {\n error('Series ' +\n volumeSeriesID +\n ' not found! Check `volumeSeriesID`.', true, series.chart);\n return;\n }\n // i = period <-- skip first N-points\n // Calculate value one-by-one for each period in visible data\n for (i = period; i < yValLen; i++) {\n len = AD.length;\n ADPoint = ADIndicator.populateAverage(xVal, yVal, yValVolume, i, period);\n if (len > 0) {\n ADPoint[1] += AD[len - 1][1];\n }\n AD.push(ADPoint);\n xData.push(ADPoint[0]);\n yData.push(ADPoint[1]);\n }\n return {\n values: AD,\n xData: xData,\n yData: yData\n };\n }\n }\n /* *\n *\n * Static Properties\n *\n * */\n /**\n * Accumulation Distribution (AD). This series requires `linkedTo` option to\n * be set.\n *\n * @sample stock/indicators/accumulation-distribution\n * Accumulation/Distribution indicator\n *\n * @extends plotOptions.sma\n * @since 6.0.0\n * @product highstock\n * @requires stock/indicators/indicators\n * @requires stock/indicators/accumulation-distribution\n * @optionparent plotOptions.ad\n */\n ADIndicator.defaultOptions = merge(SMAIndicator.defaultOptions, {\n /**\n * @excluding index\n */\n params: {\n index: void 0,\n /**\n * The id of volume series which is mandatory.\n * For example using OHLC data, volumeSeriesID='volume' means\n * the indicator will be calculated using OHLC and volume values.\n *\n * @since 6.0.0\n */\n volumeSeriesID: 'volume'\n }\n });\n extend(ADIndicator.prototype, {\n nameComponents: false,\n nameBase: 'Accumulation/Distribution'\n });\n SeriesRegistry.registerSeriesType('ad', ADIndicator);\n /* *\n *\n * Default Export\n *\n * */\n /* *\n *\n * API Options\n *\n * */\n /**\n * A `AD` series. If the [type](#series.ad.type) option is not\n * specified, it is inherited from [chart.type](#chart.type).\n *\n * @extends series,plotOptions.ad\n * @since 6.0.0\n * @excluding dataParser, dataURL\n * @product highstock\n * @requires stock/indicators/indicators\n * @requires stock/indicators/accumulation-distribution\n * @apioption series.ad\n */\n ''; // add doclet above to transpiled file\n\n return ADIndicator;\n });\n _registerModule(_modules, 'masters/indicators/accumulation-distribution.src.js', [_modules['Core/Globals.js']], function (Highcharts) {\n\n\n return Highcharts;\n });\n}));"],"names":["factory","module","exports","define","amd","Highcharts","undefined","_modules","_registerModule","obj","path","args","fn","hasOwnProperty","apply","CustomEvent","window","dispatchEvent","detail","SeriesRegistry","U","sma","SMAIndicator","seriesTypes","error","extend","merge","ADIndicator","populateAverage","xVal","yVal","yValVolume","i","_period","high","low","close","volume","getValues","series","params","len","ADPoint","period","xData","yData","volumeSeriesID","volumeSeries","chart","get","yValLen","length","AD","push","values","defaultOptions","index","prototype","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ACRR,MAAOA,EACPC,MAAOA,CACX,EACJ,CACJ,CAiEA,OA7CAlB,EAAY4B,cAAc,CAAG7B,EAAMJ,EAAaiC,cAAc,CAAE,CAI5Df,OAAQ,CACJgB,MAAO,KAAK,EAQZV,eAAgB,QACpB,CACJ,GACArB,EAAOE,EAAY8B,SAAS,CAAE,CAC1BC,eAAgB,CAAA,EAChBC,SAAU,2BACd,GACAxC,EAAeyC,kBAAkB,CAAC,KAAMjC,GAyBjCA,CACX,GACAnB,EAAgBD,EAAU,sDAAuD,CAACA,CAAQ,CAAC,kBAAkB,CAAC,CAAE,SAAUF,CAAU,EAGhI,OAAOA,CACX,EACJ"}
--------------------------------------------------------------------------------
/h2-highchart/stock-tools/accumulation-distribution.src.js:
--------------------------------------------------------------------------------
1 | /**
2 | * @license Highstock JS v11.4.0 (2024-03-04)
3 | *
4 | * Indicator series type for Highcharts Stock
5 | *
6 | * (c) 2010-2024 Sebastian Bochan
7 | *
8 | * License: www.highcharts.com/license
9 | */
10 | (function (factory) {
11 | if (typeof module === 'object' && module.exports) {
12 | factory['default'] = factory;
13 | module.exports = factory;
14 | } else if (typeof define === 'function' && define.amd) {
15 | define('highcharts/indicators/accumulation-distribution', ['highcharts', 'highcharts/modules/stock'], function (Highcharts) {
16 | factory(Highcharts);
17 | factory.Highcharts = Highcharts;
18 | return factory;
19 | });
20 | } else {
21 | factory(typeof Highcharts !== 'undefined' ? Highcharts : undefined);
22 | }
23 | }(function (Highcharts) {
24 | 'use strict';
25 | var _modules = Highcharts ? Highcharts._modules : {};
26 | function _registerModule(obj, path, args, fn) {
27 | if (!obj.hasOwnProperty(path)) {
28 | obj[path] = fn.apply(null, args);
29 |
30 | if (typeof CustomEvent === 'function') {
31 | window.dispatchEvent(new CustomEvent(
32 | 'HighchartsModuleLoaded',
33 | { detail: { path: path, module: obj[path] } }
34 | ));
35 | }
36 | }
37 | }
38 | _registerModule(_modules, 'Stock/Indicators/AD/ADIndicator.js', [_modules['Core/Series/SeriesRegistry.js'], _modules['Core/Utilities.js']], function (SeriesRegistry, U) {
39 | /* *
40 | *
41 | * License: www.highcharts.com/license
42 | *
43 | * !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!!
44 | * */
45 | const { sma: SMAIndicator } = SeriesRegistry.seriesTypes;
46 | const { error, extend, merge } = U;
47 | /* *
48 | *
49 | * Class
50 | *
51 | * */
52 | /**
53 | * The AD series type.
54 | *
55 | * @private
56 | * @class
57 | * @name Highcharts.seriesTypes.ad
58 | *
59 | * @augments Highcharts.Series
60 | */
61 | class ADIndicator extends SMAIndicator {
62 | /* *
63 | *
64 | * Static Functions
65 | *
66 | * */
67 | static populateAverage(xVal, yVal, yValVolume, i,
68 | // eslint-disable-next-line @typescript-eslint/no-unused-vars
69 | _period) {
70 | const high = yVal[i][1], low = yVal[i][2], close = yVal[i][3], volume = yValVolume[i], adY = close === high && close === low || high === low ?
71 | 0 :
72 | ((2 * close - low - high) / (high - low)) * volume, adX = xVal[i];
73 | return [adX, adY];
74 | }
75 | /* *
76 | *
77 | * Functions
78 | *
79 | * */
80 | getValues(series, params) {
81 | const period = params.period, xVal = series.xData, yVal = series.yData, volumeSeriesID = params.volumeSeriesID, volumeSeries = series.chart.get(volumeSeriesID), yValVolume = volumeSeries && volumeSeries.yData, yValLen = yVal ? yVal.length : 0, AD = [], xData = [], yData = [];
82 | let len, i, ADPoint;
83 | if (xVal.length <= period &&
84 | yValLen &&
85 | yVal[0].length !== 4) {
86 | return;
87 | }
88 | if (!volumeSeries) {
89 | error('Series ' +
90 | volumeSeriesID +
91 | ' not found! Check `volumeSeriesID`.', true, series.chart);
92 | return;
93 | }
94 | // i = period <-- skip first N-points
95 | // Calculate value one-by-one for each period in visible data
96 | for (i = period; i < yValLen; i++) {
97 | len = AD.length;
98 | ADPoint = ADIndicator.populateAverage(xVal, yVal, yValVolume, i, period);
99 | if (len > 0) {
100 | ADPoint[1] += AD[len - 1][1];
101 | }
102 | AD.push(ADPoint);
103 | xData.push(ADPoint[0]);
104 | yData.push(ADPoint[1]);
105 | }
106 | return {
107 | values: AD,
108 | xData: xData,
109 | yData: yData
110 | };
111 | }
112 | }
113 | /* *
114 | *
115 | * Static Properties
116 | *
117 | * */
118 | /**
119 | * Accumulation Distribution (AD). This series requires `linkedTo` option to
120 | * be set.
121 | *
122 | * @sample stock/indicators/accumulation-distribution
123 | * Accumulation/Distribution indicator
124 | *
125 | * @extends plotOptions.sma
126 | * @since 6.0.0
127 | * @product highstock
128 | * @requires stock/indicators/indicators
129 | * @requires stock/indicators/accumulation-distribution
130 | * @optionparent plotOptions.ad
131 | */
132 | ADIndicator.defaultOptions = merge(SMAIndicator.defaultOptions, {
133 | /**
134 | * @excluding index
135 | */
136 | params: {
137 | index: void 0,
138 | /**
139 | * The id of volume series which is mandatory.
140 | * For example using OHLC data, volumeSeriesID='volume' means
141 | * the indicator will be calculated using OHLC and volume values.
142 | *
143 | * @since 6.0.0
144 | */
145 | volumeSeriesID: 'volume'
146 | }
147 | });
148 | extend(ADIndicator.prototype, {
149 | nameComponents: false,
150 | nameBase: 'Accumulation/Distribution'
151 | });
152 | SeriesRegistry.registerSeriesType('ad', ADIndicator);
153 | /* *
154 | *
155 | * Default Export
156 | *
157 | * */
158 | /* *
159 | *
160 | * API Options
161 | *
162 | * */
163 | /**
164 | * A `AD` series. If the [type](#series.ad.type) option is not
165 | * specified, it is inherited from [chart.type](#chart.type).
166 | *
167 | * @extends series,plotOptions.ad
168 | * @since 6.0.0
169 | * @excluding dataParser, dataURL
170 | * @product highstock
171 | * @requires stock/indicators/indicators
172 | * @requires stock/indicators/accumulation-distribution
173 | * @apioption series.ad
174 | */
175 | ''; // add doclet above to transpiled file
176 |
177 | return ADIndicator;
178 | });
179 | _registerModule(_modules, 'masters/indicators/accumulation-distribution.src.js', [_modules['Core/Globals.js']], function (Highcharts) {
180 |
181 |
182 | return Highcharts;
183 | });
184 | }));
--------------------------------------------------------------------------------
/h2-highchart/stock-tools/bollinger-bands.js:
--------------------------------------------------------------------------------
1 | !/**
2 | * Highstock JS v11.4.0 (2024-03-04)
3 | *
4 | * Indicator series type for Highcharts Stock
5 | *
6 | * (c) 2010-2024 Paweł Fus
7 | *
8 | * License: www.highcharts.com/license
9 | */function(t){"object"==typeof module&&module.exports?(t.default=t,module.exports=t):"function"==typeof define&&define.amd?define("highcharts/indicators/bollinger-bands",["highcharts","highcharts/modules/stock"],function(e){return t(e),t.Highcharts=e,t}):t("undefined"!=typeof Highcharts?Highcharts:void 0)}(function(t){"use strict";var e=t?t._modules:{};function i(t,e,i,o){t.hasOwnProperty(e)||(t[e]=o.apply(null,i),"function"==typeof CustomEvent&&window.dispatchEvent(new CustomEvent("HighchartsModuleLoaded",{detail:{path:e,module:t[e]}})))}i(e,"Stock/Indicators/MultipleLinesComposition.js",[e["Core/Series/SeriesRegistry.js"],e["Core/Utilities.js"]],function(t,e){var i;let{sma:{prototype:o}}=t.seriesTypes,{defined:s,error:n,merge:a}=e;return function(t){let e=["bottomLine"],i=["top","bottom"],r=["top"];function l(t){return"plot"+t.charAt(0).toUpperCase()+t.slice(1)}function p(t,e){let i=[];return(t.pointArrayMap||[]).forEach(t=>{t!==e&&i.push(l(t))}),i}function h(){let t=this,e=t.pointValKey,i=t.linesApiNames,r=t.areaLinesNames,h=t.points,c=t.options,d=t.graph,u={options:{gapSize:c.gapSize}},f=[],m=p(t,e),y=h.length,g;if(m.forEach((t,e)=>{for(f[e]=[];y--;)g=h[y],f[e].push({x:g.x,plotX:g.plotX,plotY:g[t],isNull:!s(g[t])});y=h.length}),t.userOptions.fillColor&&r.length){let e=f[m.indexOf(l(r[0]))],i=1===r.length?h:f[m.indexOf(l(r[1]))],s=t.color;t.points=i,t.nextPoints=e,t.color=t.userOptions.fillColor,t.options=a(h,u),t.graph=t.area,t.fillGraph=!0,o.drawGraph.call(t),t.area=t.graph,delete t.nextPoints,delete t.fillGraph,t.color=s}i.forEach((e,i)=>{f[i]?(t.points=f[i],c[e]?t.options=a(c[e].styles,u):n('Error: "There is no '+e+' in DOCS options declared. Check if linesApiNames are consistent with your DOCS line names."'),t.graph=t["graph"+e],o.drawGraph.call(t),t["graph"+e]=t.graph):n('Error: "'+e+" doesn't have equivalent in pointArrayMap. To many elements in linesApiNames relative to pointArrayMap.\"")}),t.points=h,t.options=c,t.graph=d,o.drawGraph.call(t)}function c(t){let e,i=[],s=[];if(t=t||this.points,this.fillGraph&&this.nextPoints){if((e=o.getGraphPath.call(this,this.nextPoints))&&e.length){e[0][0]="L",i=o.getGraphPath.call(this,t),s=e.slice(0,i.length);for(let t=s.length-1;t>=0;t--)i.push(s[t])}}else i=o.getGraphPath.apply(this,arguments);return i}function d(t){let e=[];return(this.pointArrayMap||[]).forEach(i=>{e.push(t[i])}),e}function u(){let t=this.pointArrayMap,e=[],i;e=p(this),o.translate.apply(this,arguments),this.points.forEach(o=>{t.forEach((t,s)=>{i=o[t],this.dataModify&&(i=this.dataModify.modifyValue(i)),null!==i&&(o[e[s]]=this.yAxis.toPixels(i,!0))})})}t.compose=function(t){let o=t.prototype;return o.linesApiNames=o.linesApiNames||e.slice(),o.pointArrayMap=o.pointArrayMap||i.slice(),o.pointValKey=o.pointValKey||"top",o.areaLinesNames=o.areaLinesNames||r.slice(),o.drawGraph=h,o.getGraphPath=c,o.toYData=d,o.translate=u,t}}(i||(i={})),i}),i(e,"Stock/Indicators/BB/BBIndicator.js",[e["Stock/Indicators/MultipleLinesComposition.js"],e["Core/Series/SeriesRegistry.js"],e["Core/Utilities.js"]],function(t,e,i){let{sma:o}=e.seriesTypes,{extend:s,isArray:n,merge:a}=i;class r extends o{init(){e.seriesTypes.sma.prototype.init.apply(this,arguments),this.options=a({topLine:{styles:{lineColor:this.color}},bottomLine:{styles:{lineColor:this.color}}},this.options)}getValues(t,i){let o,s,a,r,l,p,h,c,d;let u=i.period,f=i.standardDeviation,m=[],y=[],g=t.xData,b=t.yData,x=b?b.length:0,C=[];if(g.length● {series.name}
Top: {point.top}
Middle: {point.middle}
Bottom: {point.bottom}
'},marker:{enabled:!1},dataGrouping:{approximation:"averages"}}),s(r.prototype,{areaLinesNames:["top","bottom"],linesApiNames:["topLine","bottomLine"],nameComponents:["period","standardDeviation"],pointArrayMap:["top","middle","bottom"],pointValKey:"middle"}),t.compose(r),e.registerSeriesType("bb",r),r}),i(e,"masters/indicators/bollinger-bands.src.js",[e["Core/Globals.js"]],function(t){return t})});
--------------------------------------------------------------------------------
/h2-highchart/stock-tools/dema.js:
--------------------------------------------------------------------------------
1 | !/**
2 | * Highstock JS v11.4.0 (2024-03-04)
3 | *
4 | * Indicator series type for Highcharts Stock
5 | *
6 | * (c) 2010-2024 Rafał Sebestjański
7 | *
8 | * License: www.highcharts.com/license
9 | */function(e){"object"==typeof module&&module.exports?(e.default=e,module.exports=e):"function"==typeof define&&define.amd?define("highcharts/indicators/dema",["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/DEMA/DEMAIndicator.js",[t["Core/Series/SeriesRegistry.js"],t["Core/Utilities.js"]],function(e,t){let{ema:s}=e.seriesTypes,{correctFloat:i,isArray:n,merge:o}=t;class r extends s{getEMA(e,t,s,i,n,o){return super.calculateEma(o||[],e,void 0===n?1:n,this.EMApercent,t,void 0===i?-1:i,s)}getValues(e,t){let s=t.period,o=[],r=2*s,a=e.xData,u=e.yData,d=u?u.length:0,c=[],h=[],l=[],p=0,f=0,m,g,y,E,v=-1,M,x=0;if(this.EMApercent=2/(s+1),!(d<2*s-1)){for(n(u[0])&&(v=t.index?t.index:0),x=(p=super.accumulatePeriodPoints(s,v,u))/s,p=0,E=s;E"],"sourcesContent":["/**\n * @license Highstock JS v11.4.0 (2024-03-04)\n *\n * Indicator series type for Highcharts Stock\n *\n * (c) 2010-2024 Rafał Sebestjański\n *\n * License: www.highcharts.com/license\n */\n(function (factory) {\n if (typeof module === 'object' && module.exports) {\n factory['default'] = factory;\n module.exports = factory;\n } else if (typeof define === 'function' && define.amd) {\n define('highcharts/indicators/dema', ['highcharts', 'highcharts/modules/stock'], function (Highcharts) {\n factory(Highcharts);\n factory.Highcharts = Highcharts;\n return factory;\n });\n } else {\n factory(typeof Highcharts !== 'undefined' ? Highcharts : undefined);\n }\n}(function (Highcharts) {\n 'use strict';\n var _modules = Highcharts ? Highcharts._modules : {};\n function _registerModule(obj, path, args, fn) {\n if (!obj.hasOwnProperty(path)) {\n obj[path] = fn.apply(null, args);\n\n if (typeof CustomEvent === 'function') {\n window.dispatchEvent(new CustomEvent(\n 'HighchartsModuleLoaded',\n { detail: { path: path, module: obj[path] } }\n ));\n }\n }\n }\n _registerModule(_modules, 'Stock/Indicators/DEMA/DEMAIndicator.js', [_modules['Core/Series/SeriesRegistry.js'], _modules['Core/Utilities.js']], function (SeriesRegistry, U) {\n /* *\n *\n * License: www.highcharts.com/license\n *\n * !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!!\n *\n * */\n const { ema: EMAIndicator } = SeriesRegistry.seriesTypes;\n const { correctFloat, isArray, merge } = U;\n /* *\n *\n * Class\n *\n * */\n /**\n * The DEMA series Type\n *\n * @private\n * @class\n * @name Highcharts.seriesTypes.dema\n *\n * @augments Highcharts.Series\n */\n class DEMAIndicator extends EMAIndicator {\n /* *\n *\n * Functions\n *\n * */\n getEMA(yVal, prevEMA, SMA, index, i, xVal) {\n return super.calculateEma(xVal || [], yVal, typeof i === 'undefined' ? 1 : i, this.EMApercent, prevEMA, typeof index === 'undefined' ? -1 : index, SMA);\n }\n getValues(series, params) {\n const period = params.period, EMAvalues = [], doubledPeriod = 2 * period, xVal = series.xData, yVal = series.yData, yValLen = yVal ? yVal.length : 0, DEMA = [], xDataDema = [], yDataDema = [];\n let accumulatePeriodPoints = 0, EMA = 0, \n // EMA(EMA)\n EMAlevel2, \n // EMA of previous point\n prevEMA, prevEMAlevel2, \n // EMA values array\n i, index = -1, DEMAPoint, SMA = 0;\n this.EMApercent = (2 / (period + 1));\n // Check period, if bigger than EMA points length, skip\n if (yValLen < 2 * period - 1) {\n return;\n }\n // Switch index for OHLC / Candlestick / Arearange\n if (isArray(yVal[0])) {\n index = params.index ? params.index : 0;\n }\n // Accumulate first N-points\n accumulatePeriodPoints =\n super.accumulatePeriodPoints(period, index, yVal);\n // first point\n SMA = accumulatePeriodPoints / period;\n accumulatePeriodPoints = 0;\n // Calculate value one-by-one for each period in visible data\n for (i = period; i < yValLen + 2; i++) {\n if (i < yValLen + 1) {\n EMA = this.getEMA(yVal, prevEMA, SMA, index, i)[1];\n EMAvalues.push(EMA);\n }\n prevEMA = EMA;\n // Summing first period points for EMA(EMA)\n if (i < doubledPeriod) {\n accumulatePeriodPoints += EMA;\n }\n else {\n // Calculate DEMA\n // First DEMA point\n if (i === doubledPeriod) {\n SMA = accumulatePeriodPoints / period;\n }\n EMA = EMAvalues[i - period - 1];\n EMAlevel2 = this.getEMA([EMA], prevEMAlevel2, SMA)[1];\n DEMAPoint = [\n xVal[i - 2],\n correctFloat(2 * EMA - EMAlevel2)\n ];\n DEMA.push(DEMAPoint);\n xDataDema.push(DEMAPoint[0]);\n yDataDema.push(DEMAPoint[1]);\n prevEMAlevel2 = EMAlevel2;\n }\n }\n return {\n values: DEMA,\n xData: xDataDema,\n yData: yDataDema\n };\n }\n }\n /* *\n *\n * Static Properties\n *\n * */\n /**\n * Double exponential moving average (DEMA) indicator. This series requires\n * `linkedTo` option to be set and should be loaded after the\n * `stock/indicators/indicators.js`.\n *\n * @sample {highstock} stock/indicators/dema\n * DEMA indicator\n *\n * @extends plotOptions.ema\n * @since 7.0.0\n * @product highstock\n * @excluding allAreas, colorAxis, compare, compareBase, joinBy, keys,\n * navigatorOptions, pointInterval, pointIntervalUnit,\n * pointPlacement, pointRange, pointStart, showInNavigator,\n * stacking\n * @requires stock/indicators/indicators\n * @requires stock/indicators/dema\n * @optionparent plotOptions.dema\n */\n DEMAIndicator.defaultOptions = merge(EMAIndicator.defaultOptions);\n SeriesRegistry.registerSeriesType('dema', DEMAIndicator);\n /* *\n *\n * Default Export\n *\n * */\n /* *\n *\n * API Options\n *\n * */\n /**\n * A `DEMA` series. If the [type](#series.dema.type) option is not\n * specified, it is inherited from [chart.type](#chart.type).\n *\n * @extends series,plotOptions.dema\n * @since 7.0.0\n * @product highstock\n * @excluding allAreas, colorAxis, compare, compareBase, dataParser, dataURL,\n * joinBy, keys, navigatorOptions, pointInterval, pointIntervalUnit,\n * pointPlacement, pointRange, pointStart, showInNavigator, stacking\n * @requires stock/indicators/indicators\n * @requires stock/indicators/dema\n * @apioption series.dema\n */\n ''; // adds doclet above to the transpiled file\n\n return DEMAIndicator;\n });\n _registerModule(_modules, 'masters/indicators/dema.src.js', [_modules['Core/Globals.js']], function (Highcharts) {\n\n\n return Highcharts;\n });\n}));"],"names":["factory","module","exports","define","amd","Highcharts","undefined","_modules","_registerModule","obj","path","args","fn","hasOwnProperty","apply","CustomEvent","window","dispatchEvent","detail","SeriesRegistry","U","ema","EMAIndicator","seriesTypes","correctFloat","isArray","merge","DEMAIndicator","getEMA","yVal","prevEMA","SMA","index","i","xVal","calculateEma","EMApercent","getValues","series","params","period","EMAvalues","doubledPeriod","xData","yData","yValLen","length","DEMA","xDataDema","yDataDema","accumulatePeriodPoints","EMA","EMAlevel2","prevEMAlevel2","DEMAPoint","push","values","defaultOptions","registerSeriesType"],"mappings":"CAAA;;;;;;;;CAQC,EACA,SAAUA,CAAO,EACV,AAAkB,UAAlB,OAAOC,QAAuBA,OAAOC,OAAO,EAC5CF,EAAQ,OAAU,CAAGA,EACrBC,OAAOC,OAAO,CAAGF,GACV,AAAkB,YAAlB,OAAOG,QAAyBA,OAAOC,GAAG,CACjDD,OAAO,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X,EACJ,CACJ,CAqDA,OA5BAtB,EAAc8B,cAAc,CAAG/B,EAAMJ,EAAamC,cAAc,EAChEtC,EAAeuC,kBAAkB,CAAC,OAAQ/B,GA2BnCA,CACX,GACAnB,EAAgBD,EAAU,iCAAkC,CAACA,CAAQ,CAAC,kBAAkB,CAAC,CAAE,SAAUF,CAAU,EAG3G,OAAOA,CACX,EACJ"}
--------------------------------------------------------------------------------
/h2-highchart/stock-tools/dema.src.js:
--------------------------------------------------------------------------------
1 | /**
2 | * @license Highstock JS v11.4.0 (2024-03-04)
3 | *
4 | * Indicator series type for Highcharts Stock
5 | *
6 | * (c) 2010-2024 Rafał Sebestjański
7 | *
8 | * License: www.highcharts.com/license
9 | */
10 | (function (factory) {
11 | if (typeof module === 'object' && module.exports) {
12 | factory['default'] = factory;
13 | module.exports = factory;
14 | } else if (typeof define === 'function' && define.amd) {
15 | define('highcharts/indicators/dema', ['highcharts', 'highcharts/modules/stock'], function (Highcharts) {
16 | factory(Highcharts);
17 | factory.Highcharts = Highcharts;
18 | return factory;
19 | });
20 | } else {
21 | factory(typeof Highcharts !== 'undefined' ? Highcharts : undefined);
22 | }
23 | }(function (Highcharts) {
24 | 'use strict';
25 | var _modules = Highcharts ? Highcharts._modules : {};
26 | function _registerModule(obj, path, args, fn) {
27 | if (!obj.hasOwnProperty(path)) {
28 | obj[path] = fn.apply(null, args);
29 |
30 | if (typeof CustomEvent === 'function') {
31 | window.dispatchEvent(new CustomEvent(
32 | 'HighchartsModuleLoaded',
33 | { detail: { path: path, module: obj[path] } }
34 | ));
35 | }
36 | }
37 | }
38 | _registerModule(_modules, 'Stock/Indicators/DEMA/DEMAIndicator.js', [_modules['Core/Series/SeriesRegistry.js'], _modules['Core/Utilities.js']], function (SeriesRegistry, U) {
39 | /* *
40 | *
41 | * License: www.highcharts.com/license
42 | *
43 | * !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!!
44 | *
45 | * */
46 | const { ema: EMAIndicator } = SeriesRegistry.seriesTypes;
47 | const { correctFloat, isArray, merge } = U;
48 | /* *
49 | *
50 | * Class
51 | *
52 | * */
53 | /**
54 | * The DEMA series Type
55 | *
56 | * @private
57 | * @class
58 | * @name Highcharts.seriesTypes.dema
59 | *
60 | * @augments Highcharts.Series
61 | */
62 | class DEMAIndicator extends EMAIndicator {
63 | /* *
64 | *
65 | * Functions
66 | *
67 | * */
68 | getEMA(yVal, prevEMA, SMA, index, i, xVal) {
69 | return super.calculateEma(xVal || [], yVal, typeof i === 'undefined' ? 1 : i, this.EMApercent, prevEMA, typeof index === 'undefined' ? -1 : index, SMA);
70 | }
71 | getValues(series, params) {
72 | const period = params.period, EMAvalues = [], doubledPeriod = 2 * period, xVal = series.xData, yVal = series.yData, yValLen = yVal ? yVal.length : 0, DEMA = [], xDataDema = [], yDataDema = [];
73 | let accumulatePeriodPoints = 0, EMA = 0,
74 | // EMA(EMA)
75 | EMAlevel2,
76 | // EMA of previous point
77 | prevEMA, prevEMAlevel2,
78 | // EMA values array
79 | i, index = -1, DEMAPoint, SMA = 0;
80 | this.EMApercent = (2 / (period + 1));
81 | // Check period, if bigger than EMA points length, skip
82 | if (yValLen < 2 * period - 1) {
83 | return;
84 | }
85 | // Switch index for OHLC / Candlestick / Arearange
86 | if (isArray(yVal[0])) {
87 | index = params.index ? params.index : 0;
88 | }
89 | // Accumulate first N-points
90 | accumulatePeriodPoints =
91 | super.accumulatePeriodPoints(period, index, yVal);
92 | // first point
93 | SMA = accumulatePeriodPoints / period;
94 | accumulatePeriodPoints = 0;
95 | // Calculate value one-by-one for each period in visible data
96 | for (i = period; i < yValLen + 2; i++) {
97 | if (i < yValLen + 1) {
98 | EMA = this.getEMA(yVal, prevEMA, SMA, index, i)[1];
99 | EMAvalues.push(EMA);
100 | }
101 | prevEMA = EMA;
102 | // Summing first period points for EMA(EMA)
103 | if (i < doubledPeriod) {
104 | accumulatePeriodPoints += EMA;
105 | }
106 | else {
107 | // Calculate DEMA
108 | // First DEMA point
109 | if (i === doubledPeriod) {
110 | SMA = accumulatePeriodPoints / period;
111 | }
112 | EMA = EMAvalues[i - period - 1];
113 | EMAlevel2 = this.getEMA([EMA], prevEMAlevel2, SMA)[1];
114 | DEMAPoint = [
115 | xVal[i - 2],
116 | correctFloat(2 * EMA - EMAlevel2)
117 | ];
118 | DEMA.push(DEMAPoint);
119 | xDataDema.push(DEMAPoint[0]);
120 | yDataDema.push(DEMAPoint[1]);
121 | prevEMAlevel2 = EMAlevel2;
122 | }
123 | }
124 | return {
125 | values: DEMA,
126 | xData: xDataDema,
127 | yData: yDataDema
128 | };
129 | }
130 | }
131 | /* *
132 | *
133 | * Static Properties
134 | *
135 | * */
136 | /**
137 | * Double exponential moving average (DEMA) indicator. This series requires
138 | * `linkedTo` option to be set and should be loaded after the
139 | * `stock/indicators/indicators.js`.
140 | *
141 | * @sample {highstock} stock/indicators/dema
142 | * DEMA indicator
143 | *
144 | * @extends plotOptions.ema
145 | * @since 7.0.0
146 | * @product highstock
147 | * @excluding allAreas, colorAxis, compare, compareBase, joinBy, keys,
148 | * navigatorOptions, pointInterval, pointIntervalUnit,
149 | * pointPlacement, pointRange, pointStart, showInNavigator,
150 | * stacking
151 | * @requires stock/indicators/indicators
152 | * @requires stock/indicators/dema
153 | * @optionparent plotOptions.dema
154 | */
155 | DEMAIndicator.defaultOptions = merge(EMAIndicator.defaultOptions);
156 | SeriesRegistry.registerSeriesType('dema', DEMAIndicator);
157 | /* *
158 | *
159 | * Default Export
160 | *
161 | * */
162 | /* *
163 | *
164 | * API Options
165 | *
166 | * */
167 | /**
168 | * A `DEMA` series. If the [type](#series.dema.type) option is not
169 | * specified, it is inherited from [chart.type](#chart.type).
170 | *
171 | * @extends series,plotOptions.dema
172 | * @since 7.0.0
173 | * @product highstock
174 | * @excluding allAreas, colorAxis, compare, compareBase, dataParser, dataURL,
175 | * joinBy, keys, navigatorOptions, pointInterval, pointIntervalUnit,
176 | * pointPlacement, pointRange, pointStart, showInNavigator, stacking
177 | * @requires stock/indicators/indicators
178 | * @requires stock/indicators/dema
179 | * @apioption series.dema
180 | */
181 | ''; // adds doclet above to the transpiled file
182 |
183 | return DEMAIndicator;
184 | });
185 | _registerModule(_modules, 'masters/indicators/dema.src.js', [_modules['Core/Globals.js']], function (Highcharts) {
186 |
187 |
188 | return Highcharts;
189 | });
190 | }));
--------------------------------------------------------------------------------
/h2-highchart/stock-tools/drag-panes.js:
--------------------------------------------------------------------------------
1 | !/**
2 | * Highstock JS v11.4.0 (2024-03-04)
3 | *
4 | * Drag-panes module
5 | *
6 | * (c) 2010-2024 Highsoft AS
7 | * Author: Kacper Madej
8 | *
9 | * License: www.highcharts.com/license
10 | */function(e){"object"==typeof module&&module.exports?(e.default=e,module.exports=e):"function"==typeof define&&define.amd?define("highcharts/modules/drag-panes",["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,"Extensions/DragPanes/AxisResizerDefaults.js",[],function(){return{minLength:"10%",maxLength:"100%",resize:{controlledAxis:{next:[],prev:[]},enabled:!1,cursor:"ns-resize",lineColor:"#cccccc",lineDashStyle:"Solid",lineWidth:4,x:0,y:0}}}),s(t,"Extensions/DragPanes/AxisResizer.js",[t["Extensions/DragPanes/AxisResizerDefaults.js"],t["Core/Utilities.js"]],function(e,t){let{addEvent:s,clamp:i,isNumber:o,relativeLength:n}=t;class r{constructor(e){this.init(e)}init(e,t){this.axis=e,this.options=e.options.resize||{},this.render(),t||this.addMouseEvents()}render(){let e=this.axis,t=e.chart,s=this.options,o=s.x||0,n=s.y,r=i(e.top+e.height+n,t.plotTop,t.plotTop+t.plotHeight),a={};t.styledMode||(a={cursor:s.cursor,stroke:s.lineColor,"stroke-width":s.lineWidth,dashstyle:s.lineDashStyle}),this.lastPos=r-n,this.controlLine||(this.controlLine=t.renderer.path().addClass("highcharts-axis-resizer")),this.controlLine.add(e.axisGroup);let h=t.styledMode?this.controlLine.strokeWidth():s.lineWidth;a.d=t.renderer.crispLine([["M",e.left+o,r],["L",e.left+e.width+o,r]],h),this.controlLine.attr(a)}addMouseEvents(){let e,t,i;let o=this,n=o.controlLine.element,r=o.axis.chart.container,a=[];o.mouseMoveHandler=e=e=>o.onMouseMove(e),o.mouseUpHandler=t=e=>o.onMouseUp(e),o.mouseDownHandler=i=()=>o.onMouseDown(),a.push(s(r,"mousemove",e),s(r.ownerDocument,"mouseup",t),s(n,"mousedown",i),s(r,"touchmove",e),s(r.ownerDocument,"touchend",t),s(n,"touchstart",i)),o.eventsToUnbind=a}onMouseMove(e){if(!e.touches||0!==e.touches[0].pageX){let t=this.axis.chart.pointer;this.grabbed&&t&&(this.hasDragged=!0,this.updateAxes(t.normalize(e).chartY-(this.options.y||0)))}}onMouseUp(e){let t=this.axis.chart.pointer;this.hasDragged&&t&&this.updateAxes(t.normalize(e).chartY-(this.options.y||0)),this.grabbed=this.hasDragged=this.axis.chart.activeResizer=void 0}onMouseDown(){this.axis.chart.pointer?.reset(!1,0),this.grabbed=this.axis.chart.activeResizer=!0}updateAxes(e){let t=this.axis.chart,s=this.options.controlledAxis,r=0===s.next.length?[t.yAxis.indexOf(this.axis)+1]:s.next,a=[this.axis].concat(s.prev),h=[],l=t.plotTop,c=t.plotHeight,d=l+c,u=e=>100*e/c+"%",p=(e,t,s)=>Math.round(i(e,t,s));e=i(e,l,d);let x=!1,f=e-this.lastPos;if(f*f<1)return;let g=!0;for(let s of[a,r])for(let i of s){let s,r;let a=o(i)?t.yAxis[i]:g?i:t.get(i),m=a&&a.options,y={};if(!m||"navigator-y-axis"===m.id){g=!1;continue}r=a.top;let z=Math.round(n(m.minLength||NaN,c)),v=Math.round(n(m.maxLength||NaN,c));if(g)(s=p(e-r,z,v))===v&&(x=!0),e=r+s,h.push({axis:a,options:{height:u(s)}});else{if(f=e-this.lastPos,s=p(a.len-f,z,v),(r=a.top+f)+s>d){let t=d-s-r;e+=t,r+=t}rd&&(s=c),s===z&&(x=!0),h.push({axis:a,options:{top:u(r-l),height:u(s)}})}g=!1,y.height=s}if(!x){for(let e of h)e.axis.update(e.options,!1);t.redraw(!1)}}destroy(){let e=this.axis;for(let t of(delete e.resizer,this.eventsToUnbind&&this.eventsToUnbind.forEach(e=>e()),this.controlLine.destroy(),Object.keys(this)))this[t]=null}}return r.resizerOptions=e,r}),s(t,"Extensions/DragPanes/DragPanes.js",[t["Extensions/DragPanes/AxisResizer.js"],t["Core/Defaults.js"],t["Core/Utilities.js"]],function(e,t,s){let{defaultOptions:i}=t,{addEvent:o,merge:n,wrap:r}=s;function a(){let t=this.resizer,s=this.options.resize;if(s){let i=!1!==s.enabled;t?i?t.init(this,!0):t.destroy():i&&(this.resizer=new e(this))}}function h(e){!e.keepEvents&&this.resizer&&this.resizer.destroy()}function l(e){this.chart.activeResizer||e.apply(this,[].slice.call(arguments,1))}function c(e){this.chart.activeResizer||e.apply(this,[].slice.call(arguments,1))}return{compose:function(t,s){t.keepProps.includes("resizer")||(n(!0,i.yAxis,e.resizerOptions),t.keepProps.push("resizer"),o(t,"afterRender",a),o(t,"destroy",h),r(s.prototype,"runPointActions",c),r(s.prototype,"drag",l))}}}),s(t,"masters/modules/drag-panes.src.js",[t["Core/Globals.js"],t["Extensions/DragPanes/AxisResizer.js"],t["Extensions/DragPanes/DragPanes.js"]],function(e,t,s){return e.AxisResizer=t,s.compose(e.Axis,e.Pointer),e})});
--------------------------------------------------------------------------------
/h2-highchart/stock-tools/full-screen.js:
--------------------------------------------------------------------------------
1 | !/**
2 | * Highstock JS v11.4.0 (2024-03-04)
3 | *
4 | * Advanced Highcharts Stock tools
5 | *
6 | * (c) 2010-2024 Highsoft AS
7 | * Author: Torstein Honsi
8 | *
9 | * License: www.highcharts.com/license
10 | */function(e){"object"==typeof module&&module.exports?(e.default=e,module.exports=e):"function"==typeof define&&define.amd?define("highcharts/modules/full-screen",["highcharts"],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 n(e,t,n,s){e.hasOwnProperty(t)||(e[t]=s.apply(null,n),"function"==typeof CustomEvent&&window.dispatchEvent(new CustomEvent("HighchartsModuleLoaded",{detail:{path:t,module:e[t]}})))}n(t,"Extensions/Exporting/Fullscreen.js",[t["Core/Renderer/HTML/AST.js"],t["Core/Globals.js"],t["Core/Utilities.js"]],function(e,t,n){let{composed:s}=t,{addEvent:r,fireEvent:l,pushUnique:i}=n;function o(){this.fullscreen=new u(this)}class u{static compose(e){i(s,"Fullscreen")&&r(e,"beforeRender",o)}constructor(e){this.chart=e,this.isOpen=!1;let t=e.renderTo;!this.browserProps&&("function"==typeof t.requestFullscreen?this.browserProps={fullscreenChange:"fullscreenchange",requestFullscreen:"requestFullscreen",exitFullscreen:"exitFullscreen"}:t.mozRequestFullScreen?this.browserProps={fullscreenChange:"mozfullscreenchange",requestFullscreen:"mozRequestFullScreen",exitFullscreen:"mozCancelFullScreen"}:t.webkitRequestFullScreen?this.browserProps={fullscreenChange:"webkitfullscreenchange",requestFullscreen:"webkitRequestFullScreen",exitFullscreen:"webkitExitFullscreen"}:t.msRequestFullscreen&&(this.browserProps={fullscreenChange:"MSFullscreenChange",requestFullscreen:"msRequestFullscreen",exitFullscreen:"msExitFullscreen"}))}close(){let e=this,t=e.chart,n=t.options.chart;l(t,"fullscreenClose",null,function(){e.isOpen&&e.browserProps&&t.container.ownerDocument instanceof Document&&t.container.ownerDocument[e.browserProps.exitFullscreen](),e.unbindFullscreenEvent&&(e.unbindFullscreenEvent=e.unbindFullscreenEvent()),t.setSize(e.origWidth,e.origHeight,!1),e.origWidth=void 0,e.origHeight=void 0,n.width=e.origWidthOption,n.height=e.origHeightOption,e.origWidthOption=void 0,e.origHeightOption=void 0,e.isOpen=!1,e.setButtonText()})}open(){let e=this,t=e.chart,n=t.options.chart;l(t,"fullscreenOpen",null,function(){if(n&&(e.origWidthOption=n.width,e.origHeightOption=n.height),e.origWidth=t.chartWidth,e.origHeight=t.chartHeight,e.browserProps){let n=r(t.container.ownerDocument,e.browserProps.fullscreenChange,function(){e.isOpen?(e.isOpen=!1,e.close()):(t.setSize(null,null,!1),e.isOpen=!0,e.setButtonText())}),s=r(t,"destroy",n);e.unbindFullscreenEvent=()=>{n(),s()};let l=t.renderTo[e.browserProps.requestFullscreen]();l&&l.catch(function(){alert("Full screen is not supported inside a frame.")})}})}setButtonText(){let t=this.chart,n=t.exportDivElements,s=t.options.exporting,r=s&&s.buttons&&s.buttons.contextButton.menuItems,l=t.options.lang;if(s&&s.menuItemDefinitions&&l&&l.exitFullscreen&&l.viewFullscreen&&r&&n){let t=n[r.indexOf("viewFullscreen")];t&&e.setElementHTML(t,this.isOpen?l.exitFullscreen:s.menuItemDefinitions.viewFullscreen.text||l.viewFullscreen)}}toggle(){this.isOpen?this.close():this.open()}}return u}),n(t,"masters/modules/full-screen.src.js",[t["Core/Globals.js"],t["Extensions/Exporting/Fullscreen.js"]],function(e,t){return e.Fullscreen=e.Fullscreen||t,e.Fullscreen.compose(e.Chart),e})});
--------------------------------------------------------------------------------
/h2-highchart/stock-tools/gui.css:
--------------------------------------------------------------------------------
1 | /* Colors for buttons. */
2 | .chart:-webkit-full-screen {
3 | width: 100%;
4 | height: 100%;
5 | }
6 |
7 | .chart:-moz-full-screen {
8 | width: 100%;
9 | height: 100%;
10 | }
11 |
12 | .chart:-ms-fullscreen {
13 | width: 100%;
14 | height: 100%;
15 | }
16 |
17 | .chart:fullscreen {
18 | width: 100%;
19 | height: 100%;
20 | }
21 |
22 | .chart {
23 | width: 100%;
24 | float: left;
25 | height: 400px;
26 | position: relative;
27 | }
28 |
29 | .highcharts-draw-mode { cursor: crosshair; }
30 |
31 | .highcharts-bindings-wrapper * {
32 | box-sizing: content-box;
33 | }
34 |
35 | .highcharts-bindings-wrapper {
36 | display: block;
37 | width: 40px;
38 | height: 100%;
39 | position: absolute;
40 | z-index: 10;
41 | top: 0;
42 | }
43 |
44 | .highcharts-button {
45 | fill: var(--highcharts-neutral-color-3);
46 | }
47 |
48 | .highcharts-stocktools-popup {
49 | width: 100%;
50 | }
51 |
52 | .highcharts-menu-wrapper {
53 | float: left;
54 | width: 40px;
55 | height: calc(100% - 50px);
56 | overflow: hidden;
57 | position: absolute;
58 | left: 0;
59 | top: 0;
60 | padding: 10px;
61 | }
62 |
63 | .highcharts-bindings-wrapper .highcharts-submenu-wrapper {
64 | display: none;
65 | position: absolute;
66 | z-index: 10;
67 | left: 0;
68 | top: 0;
69 | background: #ffffff;
70 | width: 40px;
71 | }
72 |
73 | .highcharts-bindings-wrapper .highcharts-arrow-wrapper {
74 | text-align: center;
75 | width: 40px;
76 | position: absolute;
77 | left: 10px;
78 | bottom: 10px;
79 | font-size: 1.5em;
80 | }
81 |
82 | .highcharts-bindings-wrapper .highcharts-arrow-wrapper > div {
83 | cursor: pointer;
84 | }
85 |
86 | .highcharts-bindings-wrapper .highcharts-arrow-down {
87 | background-size: cover;
88 |
89 | /* Safari */
90 | -webkit-transform: rotate(90deg);
91 |
92 | /* Firefox */
93 | -moz-transform: rotate(90deg);
94 |
95 | /* IE */
96 | -ms-transform: rotate(90deg);
97 |
98 | /* Opera */
99 | -o-transform: rotate(90deg);
100 | }
101 |
102 | .highcharts-bindings-wrapper .highcharts-arrow-up {
103 | background-size: cover;
104 | outline: none;
105 | display: inline-block;
106 | width: 25px;
107 | cursor: pointer;
108 | -webkit-user-select: none;
109 |
110 | /* Chrome/Safari */
111 | -moz-user-select: none;
112 |
113 | /* Firefox */
114 | -ms-user-select: none;
115 |
116 | /* IE10+ */
117 |
118 | /* Rules below not implemented in browsers yet */
119 | -o-user-select: none;
120 | user-select: none;
121 |
122 | /* Safari */
123 | -webkit-transform: rotate(-90deg);
124 |
125 | /* Firefox */
126 | -moz-transform: rotate(-90deg);
127 |
128 | /* IE */
129 | -ms-transform: rotate(-90deg);
130 |
131 | /* Opera */
132 | -o-transform: rotate(-90deg);
133 | }
134 |
135 | .highcharts-bindings-wrapper .highcharts-arrow-right {
136 | background-repeat: no-repeat;
137 | background-position: right bottom;
138 | background-size: contain;
139 | }
140 |
141 | .highcharts-bindings-wrapper .highcharts-arrow-left.highcharts-arrow-right {
142 | /* Safari */
143 | -webkit-transform: rotate(0deg);
144 |
145 | /* Firefox */
146 | -moz-transform: rotate(0deg);
147 |
148 | /* IE */
149 | -ms-transform: rotate(0deg);
150 |
151 | /* Opera */
152 | -o-transform: rotate(0deg);
153 | }
154 |
155 | .highcharts-bindings-wrapper .highcharts-arrow-left {
156 | /* Safari */
157 | -webkit-transform: rotate(180deg);
158 |
159 | /* Firefox */
160 | -moz-transform: rotate(180deg);
161 |
162 | /* IE */
163 | -ms-transform: rotate(180deg);
164 |
165 | /* Opera */
166 | -o-transform: rotate(180deg);
167 | }
168 |
169 | .highcharts-bindings-wrapper ul {
170 | width: 40px;
171 |
172 | /* 30px spacing for arrows to scroll */
173 | margin: 0;
174 | padding: 0;
175 | float: left;
176 | transition: margin 250ms;
177 | }
178 |
179 | .highcharts-bindings-wrapper > ul {
180 | width: 40px;
181 | position: relative;
182 | }
183 |
184 | .highcharts-bindings-wrapper .highcharts-stocktools-toolbar li {
185 | list-style: none;
186 | margin-bottom: 3px;
187 | padding: 0;
188 | clear: both;
189 | width: 100%;
190 | height: 40px;
191 | cursor: pointer;
192 | position: relative;
193 | background-color: var(--highcharts-neutral-color-3);
194 | }
195 |
196 | .highcharts-bindings-wrapper .highcharts-stocktools-toolbar li.highcharts-disabled-btn {
197 | cursor: default;
198 | }
199 |
200 | .highcharts-bindings-wrapper .highcharts-stocktools-toolbar li.highcharts-disabled-btn > .highcharts-menu-item-btn {
201 | opacity: 0.5;
202 | }
203 |
204 | .highcharts-bindings-wrapper .highcharts-stocktools-toolbar li.highcharts-disabled-btn.highcharts-active {
205 | background: var(--highcharts-neutral-color-3);
206 | }
207 |
208 | .highcharts-bindings-wrapper .highcharts-stocktools-toolbar li.highcharts-disabled-btn .highcharts-menu-item-btn:hover {
209 | background-color: transparent;
210 | }
211 |
212 | .highcharts-bindings-wrapper li > button.highcharts-menu-item-btn {
213 | display: block;
214 | border: none;
215 | float: left;
216 | padding: 0;
217 | background: none;
218 | color: inherit;
219 | font: inherit;
220 | cursor: pointer;
221 | width: 100%;
222 | height: 100%;
223 | background-repeat: no-repeat;
224 | background-position: 50% 50%;
225 | background-size: 32px 32px;
226 | }
227 |
228 | .highcharts-submenu-wrapper li > button.highcharts-menu-item-btn {
229 | width: 40px;
230 | }
231 |
232 | .highcharts-bindings-wrapper li > button.highcharts-submenu-item-arrow {
233 | float: left;
234 | background-repeat: no-repeat;
235 | color: inherit;
236 | border: none;
237 | padding: 0;
238 | font: inherit;
239 | cursor: pointer;
240 | background-color: transparent;
241 | width: 10px;
242 | height: 100%;
243 | position: absolute;
244 | bottom: 0;
245 | right: 0;
246 | }
247 |
248 | .highcharts-bindings-wrapper li.highcharts-separator {
249 | height: 15px;
250 | background-color: transparent;
251 | width: 36px;
252 | pointer-events: none;
253 | }
254 |
255 | .highcharts-bindings-wrapper li.highcharts-separator > button.highcharts-menu-item-btn {
256 | width: 100%;
257 | }
258 |
259 | .highcharts-bindings-wrapper li.highcharts-active > button.highcharts-menu-item-btn,
260 | .highcharts-bindings-wrapper li > button.highcharts-menu-item-btn:hover,
261 | .highcharts-bindings-wrapper .highcharts-arrow-wrapper > div:hover,
262 | .highcharts-bindings-wrapper li.highcharts-active,
263 | .highcharts-toggle-toolbar:hover {
264 | background-color: var(--highcharts-neutral-color-10);
265 | transition: background-color 100ms;
266 | }
267 |
268 | .highcharts-toggle-toolbar {
269 | position: absolute;
270 | cursor: pointer;
271 | width: 10px;
272 | height: 10px;
273 | background-color: var(--highcharts-neutral-color-3);
274 | background-size: cover;
275 | }
276 |
277 | .highcharts-hide {
278 | display: none;
279 | }
280 |
281 | .highcharts-bindings-wrapper li:hover,
282 | .highcharts-submenu-item-arrow:hover {
283 | background-color: var(--highcharts-button-hover-color);
284 | }
285 |
286 | .highcharts-bindings-wrapper .highcharts-arrow-down,
287 | .highcharts-bindings-wrapper .highcharts-arrow-up {
288 | width: 50%;
289 | height: 20px;
290 | float: left;
291 | }
292 |
293 | li.highcharts-disabled-btn:hover,
294 | .highcharts-disabled-btn .highcharts-submenu-item-arrow:hover {
295 | background-color: var(--highcharts-neutral-color-3);
296 | }
297 |
--------------------------------------------------------------------------------
/h2-highchart/stock-tools/indicators.js:
--------------------------------------------------------------------------------
1 | !/**
2 | * Highstock JS v11.4.0 (2024-03-04)
3 | *
4 | * Indicator series type for Highcharts Stock
5 | *
6 | * (c) 2010-2024 Pawel Fus, Sebastian Bochan
7 | *
8 | * License: www.highcharts.com/license
9 | */function(t){"object"==typeof module&&module.exports?(t.default=t,module.exports=t):"function"==typeof define&&define.amd?define("highcharts/indicators/indicators",["highcharts","highcharts/modules/stock"],function(e){return t(e),t.Highcharts=e,t}):t("undefined"!=typeof Highcharts?Highcharts:void 0)}(function(t){"use strict";var e=t?t._modules:{};function a(t,e,a,i){t.hasOwnProperty(e)||(t[e]=i.apply(null,a),"function"==typeof CustomEvent&&window.dispatchEvent(new CustomEvent("HighchartsModuleLoaded",{detail:{path:e,module:t[e]}})))}a(e,"Stock/Indicators/SMA/SMAIndicator.js",[e["Core/Chart/Chart.js"],e["Core/Series/SeriesRegistry.js"],e["Core/Utilities.js"]],function(t,e,a){let{line:i}=e.seriesTypes,{addEvent:s,fireEvent:n,error:o,extend:r,isArray:l,merge:p,pick:h,splat:u}=a;class c extends i{destroy(){this.dataEventsToUnbind.forEach(function(t){t()}),super.destroy.apply(this,arguments)}getName(){let t=[],e=this.name;return e||((this.nameComponents||[]).forEach(function(e,a){t.push(this.options.params[e]+h(this.nameSuffixes[a],""))},this),e=(this.nameBase||this.type.toUpperCase())+(this.nameComponents?" ("+t.join(", ")+")":"")),e}getValues(t,e){let a=e.period,i=t.xData,s=t.yData,n=s.length,o=[],r=[],p=[],h,u=-1,c=0,d,f=0;if(!(i.length{t!==e&&a.push(l(t))}),a}function h(){let t=this,e=t.pointValKey,a=t.linesApiNames,r=t.areaLinesNames,h=t.points,u=t.options,c=t.graph,d={options:{gapSize:u.gapSize}},f=[],m=p(t,e),x=h.length,y;if(m.forEach((t,e)=>{for(f[e]=[];x--;)y=h[x],f[e].push({x:y.x,plotX:y.plotX,plotY:y[t],isNull:!s(y[t])});x=h.length}),t.userOptions.fillColor&&r.length){let e=f[m.indexOf(l(r[0]))],a=1===r.length?h:f[m.indexOf(l(r[1]))],s=t.color;t.points=a,t.nextPoints=e,t.color=t.userOptions.fillColor,t.options=o(h,d),t.graph=t.area,t.fillGraph=!0,i.drawGraph.call(t),t.area=t.graph,delete t.nextPoints,delete t.fillGraph,t.color=s}a.forEach((e,a)=>{f[a]?(t.points=f[a],u[e]?t.options=o(u[e].styles,d):n('Error: "There is no '+e+' in DOCS options declared. Check if linesApiNames are consistent with your DOCS line names."'),t.graph=t["graph"+e],i.drawGraph.call(t),t["graph"+e]=t.graph):n('Error: "'+e+" doesn't have equivalent in pointArrayMap. To many elements in linesApiNames relative to pointArrayMap.\"")}),t.points=h,t.options=u,t.graph=c,i.drawGraph.call(t)}function u(t){let e,a=[],s=[];if(t=t||this.points,this.fillGraph&&this.nextPoints){if((e=i.getGraphPath.call(this,this.nextPoints))&&e.length){e[0][0]="L",a=i.getGraphPath.call(this,t),s=e.slice(0,a.length);for(let t=s.length-1;t>=0;t--)a.push(s[t])}}else a=i.getGraphPath.apply(this,arguments);return a}function c(t){let e=[];return(this.pointArrayMap||[]).forEach(a=>{e.push(t[a])}),e}function d(){let t=this.pointArrayMap,e=[],a;e=p(this),i.translate.apply(this,arguments),this.points.forEach(i=>{t.forEach((t,s)=>{a=i[t],this.dataModify&&(a=this.dataModify.modifyValue(a)),null!==a&&(i[e[s]]=this.yAxis.toPixels(a,!0))})})}t.compose=function(t){let i=t.prototype;return i.linesApiNames=i.linesApiNames||e.slice(),i.pointArrayMap=i.pointArrayMap||a.slice(),i.pointValKey=i.pointValKey||"top",i.areaLinesNames=i.areaLinesNames||r.slice(),i.drawGraph=h,i.getGraphPath=u,i.toYData=c,i.translate=d,t}}(a||(a={})),a}),a(e,"masters/indicators/indicators.src.js",[e["Core/Globals.js"],e["Stock/Indicators/MultipleLinesComposition.js"]],function(t,e){return t.MultipleLinesComposition=t.MultipleLinesComposition||e,t})});
--------------------------------------------------------------------------------
/h2-highchart/stock-tools/popup.css:
--------------------------------------------------------------------------------
1 | /* Colors, using same names and values as in highcharts.css */
2 | :root {
3 | --highcharts-background-color: #ffffff;
4 | --highcharts-neutral-color-100: #000000;
5 | --highcharts-neutral-color-80: #333333;
6 | --highcharts-neutral-color-60: #666666;
7 | --highcharts-neutral-color-20: #cccccc;
8 | --highcharts-neutral-color-10: #e6e6e6;
9 | --highcharts-neutral-color-3: #f7f7f7;
10 | --highcharts-highlight-color-80: #335cad;
11 | }
12 |
13 | .highcharts-popup.highcharts-annotation-toolbar {
14 | right: 10%;
15 | left: auto;
16 | height: 40px;
17 | overflow: hidden;
18 | padding-right: 40px;
19 | width: auto;
20 | min-width: 0;
21 | }
22 |
23 | .highcharts-annotation-toolbar button {
24 | margin-top: 0;
25 | cursor: pointer;
26 | background-color: var(--highcharts-neutral-color-3);
27 | }
28 |
29 | .highcharts-popup.highcharts-annotation-toolbar > p {
30 | margin: 0;
31 | display: block;
32 | float: left;
33 | padding: 12px;
34 | }
35 |
36 | .highcharts-popup {
37 | font-family: Helvetica, Arial, sans-serif;
38 | background-color: var(--highcharts-background-color);
39 | color: var(--highcharts-neutral-color-60);
40 | display: none;
41 | font-size: 0.9em;
42 | max-height: 90%;
43 | top: 5%;
44 | left: 15%;
45 | overflow-x: hidden;
46 | overflow-y: hidden;
47 | width: 75%;
48 | min-width: 300px;
49 | max-width: 600px;
50 | position: absolute;
51 | z-index: 100;
52 | -webkit-box-shadow: 0 0 8px 0 rgba(61, 61, 61, 0.3);
53 | -moz-box-shadow: 0 0 8px 0 rgba(61, 61, 61, 0.3);
54 | box-shadow: 0 0 8px 0 rgba(61, 61, 61, 0.3);
55 | }
56 |
57 | .highcharts-popup div,
58 | .highcharts-popup span {
59 | box-sizing: border-box;
60 | }
61 |
62 | .highcharts-popup input,
63 | .highcharts-popup label,
64 | .highcharts-popup select {
65 | clear: both;
66 | float: left;
67 | width: 100%;
68 | margin-bottom: 10px;
69 | box-sizing: border-box;
70 | }
71 |
72 | .highcharts-popup input {
73 | border: 1px solid var(--highcharts-neutral-color-10);
74 | border-radius: 0.3rem;
75 | padding: 5px;
76 | width: 100%;
77 | }
78 |
79 | .highcharts-popup-lhs-col,
80 | .highcharts-popup-rhs-col {
81 | height: 100%;
82 | float: left;
83 | overflow-y: auto;
84 | }
85 |
86 | .highcharts-popup-lhs-col.highcharts-popup-lhs-full {
87 | width: 100%;
88 | overflow-x: hidden;
89 | height: calc(100% - 104px);
90 | border: none;
91 | padding: 20px;
92 | padding-bottom: 10px;
93 | }
94 |
95 | .highcharts-popup-lhs-col.highcharts-popup-lhs-full + .highcharts-popup-bottom-row {
96 | width: 100%;
97 | }
98 |
99 | .highcharts-popup-lhs-col {
100 | clear: both;
101 | width: 30%;
102 | border-right: 1px solid var(--highcharts-neutral-color-10);
103 | }
104 |
105 | .highcharts-popup-bottom-row {
106 | float: left;
107 | padding: 0 20px;
108 | padding-bottom: 12px;
109 | width: 100%;
110 | border-top: 1px solid var(--highcharts-neutral-color-10);
111 | }
112 |
113 | .highcharts-popup-rhs-col {
114 | width: 70%;
115 | height: calc(100% - 40px);
116 | padding: 20px;
117 | }
118 |
119 | .highcharts-popup-rhs-col-wrapper {
120 | width: 100%;
121 | overflow-x: hidden;
122 | }
123 |
124 | .highcharts-popup-rhs-col-wrapper h3 {
125 | margin-top: 0;
126 | padding-bottom: 0;
127 | }
128 |
129 | .highcharts-bindings-wrapper ul.highcharts-indicator-list,
130 | .highcharts-indicator-list {
131 | float: left;
132 | color: var(--highcharts-neutral-color-60);
133 | height: calc(100% - 150px);
134 | width: 100%;
135 | overflow-x: hidden;
136 | margin: 0;
137 | padding: 15px 0;
138 | }
139 |
140 | button.highcharts-indicator-list-item {
141 | cursor: pointer;
142 | padding: 5px 20px;
143 | width: 100%;
144 | height: auto;
145 | overflow: hidden;
146 | word-break: break-all;
147 | box-sizing: border-box;
148 | background-color: var(--highcharts-background-color);
149 | text-align: left;
150 | }
151 |
152 | .highcharts-indicator-list li {
153 | width: 100%;
154 | padding: 0;
155 | height: auto;
156 | }
157 |
158 | .highcharts-popup > button.highcharts-tab-item {
159 | margin: 0;
160 | background-color: var(--highcharts-neutral-color-3);
161 | cursor: pointer;
162 | display: block;
163 | float: left;
164 | padding: 0 10px;
165 | height: 40px;
166 | line-height: 40px;
167 | }
168 |
169 | button.highcharts-tab-item.highcharts-tab-item-active {
170 | background-color: var(--highcharts-neutral-color-10);
171 | }
172 |
173 | .highcharts-tab-item-content {
174 | display: none;
175 | float: left;
176 | height: 100%;
177 | overflow: hidden;
178 | width: 100%;
179 | border-top: 1px solid var(--highcharts-neutral-color-10);
180 | }
181 |
182 | .highcharts-tab-item-show {
183 | display: block;
184 | }
185 |
186 | .highcharts-popup > .highcharts-popup-close {
187 | margin: 0;
188 | background-repeat: no-repeat;
189 | background-position: 50% 50%;
190 | background-color: var(--highcharts-background-color);
191 | width: 40px;
192 | height: 40px;
193 | cursor: pointer;
194 | position: absolute;
195 | padding: 10px;
196 | top: 0%;
197 | right: 0%;
198 | color: var(--highcharts-neutral-color-80);
199 | }
200 |
201 | .highcharts-popup-close:hover,
202 | .highcharts-popup button:hover,
203 | .highcharts-popup button.highcharts-annotation-edit-button:hover,
204 | .highcharts-popup button.highcharts-annotation-remove-button:hover {
205 | background-color: var(--highcharts-neutral-color-10);
206 | }
207 |
208 | div.highcharts-popup-rhs-col > button {
209 | float: right;
210 | }
211 |
212 | .highcharts-popup button {
213 | border: none;
214 | margin: 0 5px 0 0;
215 | }
216 |
217 | button.highcharts-tab-item.highcharts-tab-disabled {
218 | color: var(--highcharts-neutral-color-20);
219 | }
220 |
221 | button.highcharts-tab-item.highcharts-tab-disabled:hover {
222 | background-color: var(--highcharts-neutral-color-3);
223 | }
224 |
225 | /* annotation edit small popup */
226 | .highcharts-popup button.highcharts-annotation-edit-button,
227 | .highcharts-popup button.highcharts-annotation-remove-button {
228 | width: 20px;
229 | height: 40px;
230 | padding: 20px;
231 | }
232 |
233 | .highcharts-popup button.highcharts-annotation-edit-button {
234 | background-repeat: no-repeat;
235 | background-position: 50% 50%;
236 | text-indent: -9999px;
237 | }
238 |
239 | .highcharts-popup button.highcharts-annotation-remove-button {
240 | background-repeat: no-repeat;
241 | background-position: 50% 50%;
242 | text-indent: -9999px;
243 | }
244 |
245 | .highcharts-popup .highcharts-annotation-title {
246 | display: block;
247 | float: left;
248 | font-size: 1.2em;
249 | font-weight: bold;
250 | margin-bottom: 15px;
251 | width: 100%;
252 | }
253 |
254 | .highcharts-popup .highcharts-popup-main-title {
255 | border-bottom: 1px solid var(--highcharts-neutral-color-10);
256 | margin: 0;
257 | padding: 8px 0 6px 20px;
258 | }
259 |
260 | .highcharts-indicator-title {
261 | float: left;
262 | padding-bottom: 15px;
263 | }
264 |
265 | .highcharts-input-wrapper {
266 | display: flex;
267 | justify-content: center;
268 | align-items: center;
269 | flex-direction: column;
270 | flex-wrap: wrap;
271 | }
272 |
273 | .highcharts-input-search-indicators-label {
274 | text-align: center;
275 | font-weight: bold;
276 | color: var(--highcharts-neutral-color-100);
277 | margin-top: 0.5rem;
278 | }
279 |
280 | input.highcharts-input-search-indicators {
281 | width: 80%;
282 | margin: 0 auto;
283 | float: none;
284 | border-color: #949494;
285 | }
286 |
287 | .highcharts-popup a.clear-filter-button {
288 | margin: 0 auto;
289 | display: none;
290 | color: var(--highcharts-highlight-color-80);
291 | background-color: var(--highcharts-background-color);
292 | border: 1px solid var(--highcharts-highlight-color-80);
293 | margin-top: 10px;
294 | }
295 |
296 | .highcharts-popup a.clear-filter-button:hover {
297 | color: var(--highcharts-background-color);
298 | background-color: var(--highcharts-highlight-color-80);
299 | cursor: pointer;
300 | }
301 |
--------------------------------------------------------------------------------
/h2-highchart/stock-tools/price-indicator.js:
--------------------------------------------------------------------------------
1 | !/**
2 | * Highstock JS v11.4.0 (2024-03-04)
3 | *
4 | * Advanced Highcharts Stock tools
5 | *
6 | * (c) 2010-2024 Highsoft AS
7 | * Author: Torstein Honsi
8 | *
9 | * License: www.highcharts.com/license
10 | */function(s){"object"==typeof module&&module.exports?(s.default=s,module.exports=s):"function"==typeof define&&define.amd?define("highcharts/modules/price-indicator",["highcharts","highcharts/modules/stock"],function(i){return s(i),s.Highcharts=i,s}):s("undefined"!=typeof Highcharts?Highcharts:void 0)}(function(s){"use strict";var i=s?s._modules:{};function t(s,i,t,e){s.hasOwnProperty(i)||(s[i]=e.apply(null,t),"function"==typeof CustomEvent&&window.dispatchEvent(new CustomEvent("HighchartsModuleLoaded",{detail:{path:i,module:s[i]}})))}t(i,"Extensions/PriceIndication.js",[i["Core/Globals.js"],i["Core/Utilities.js"]],function(s,i){let{composed:t}=s,{addEvent:e,isArray:o,merge:r,pushUnique:a}=i;function c(){let s=this.options,i=s.lastVisiblePrice,t=s.lastPrice;if((i||t)&&"highcharts-navigator-series"!==s.id){let e;let a=this.xAxis,c=this.yAxis,l=c.crosshair,h=c.cross,n=c.crossLabel,d=this.points,u=this.yData.length,b=d.length,p=this.xData[this.xData.length-1],P=this.yData[u-1];if(t&&t.enabled&&(c.crosshair=c.options.crosshair=s.lastPrice,!this.chart.styledMode&&c.crosshair&&c.options.crosshair&&s.lastPrice&&(c.crosshair.color=c.options.crosshair.color=s.lastPrice.color||this.color),c.cross=this.lastPrice,e=o(P)?P[3]:P,this.lastPriceLabel&&this.lastPriceLabel.destroy(),delete c.crossLabel,c.drawCrosshair(null,{x:p,y:e,plotX:a.toPixels(p,!0),plotY:c.toPixels(e,!0)}),this.yAxis.cross&&(this.lastPrice=this.yAxis.cross,this.lastPrice.addClass("highcharts-color-"+this.colorIndex),this.lastPrice.y=e),this.lastPriceLabel=c.crossLabel),i&&i.enabled&&b>0){c.crosshair=c.options.crosshair=r({color:"transparent"},s.lastVisiblePrice),c.cross=this.lastVisiblePrice;let i=d[b-1].isInside?d[b-1]:d[b-2];this.lastVisiblePriceLabel&&this.lastVisiblePriceLabel.destroy(),delete c.crossLabel,c.drawCrosshair(null,i),c.cross&&(this.lastVisiblePrice=c.cross,i&&"number"==typeof i.y&&(this.lastVisiblePrice.y=i.y)),this.lastVisiblePriceLabel=c.crossLabel}c.crosshair=c.options.crosshair=l,c.cross=h,c.crossLabel=n}}return{compose:function(s){a(t,"PriceIndication")&&e(s,"afterRender",c)}}}),t(i,"masters/modules/price-indicator.src.js",[i["Core/Globals.js"],i["Extensions/PriceIndication.js"]],function(s,i){return i.compose(s.Series),s})});
--------------------------------------------------------------------------------
/h2-highchart/stock-tools/regressions.js:
--------------------------------------------------------------------------------
1 | !/**
2 | * Highstock JS v11.4.0 (2024-03-04)
3 | *
4 | * Indicator series type for Highcharts Stock
5 | *
6 | * (c) 2010-2024 Kamil Kulig
7 | *
8 | * License: www.highcharts.com/license
9 | */function(e){"object"==typeof module&&module.exports?(e.default=e,module.exports=e):"function"==typeof define&&define.amd?define("highcharts/indicators/regressions",["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,n){e.hasOwnProperty(t)||(e[t]=n.apply(null,s),"function"==typeof CustomEvent&&window.dispatchEvent(new CustomEvent("HighchartsModuleLoaded",{detail:{path:t,module:e[t]}})))}s(t,"Stock/Indicators/LinearRegression/LinearRegressionIndicator.js",[t["Core/Series/SeriesRegistry.js"],t["Core/Utilities.js"]],function(e,t){let{sma:s}=e.seriesTypes,{isArray:n,extend:r,merge:i}=t;class o extends s{getRegressionLineParameters(e,t){let s=this.options.params.index,r=function(e,t){return n(e)?e[t]:e},i=e.reduce(function(e,t){return t+e},0),o=t.reduce(function(e,t){return r(t,s)+e},0),a=i/e.length,l=o/t.length,p,c,u=0,g=0;for(c=0;c0&&(void 0===s||t●{series.name}: {point.y}\xb0
'}}),n(i.prototype,{nameBase:"Linear Regression Angle Indicator"}),e.registerSeriesType("linearRegressionAngle",i),i}),s(t,"masters/indicators/regressions.src.js",[t["Core/Globals.js"]],function(e){return e})});
--------------------------------------------------------------------------------
/h2-highchart/stock-tools/stock-icons/annotations-hidden.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
20 |
--------------------------------------------------------------------------------
/h2-highchart/stock-tools/stock-icons/annotations-visible.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
21 |
--------------------------------------------------------------------------------
/h2-highchart/stock-tools/stock-icons/arrow-bottom.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
10 |
--------------------------------------------------------------------------------
/h2-highchart/stock-tools/stock-icons/arrow-left.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
10 |
--------------------------------------------------------------------------------
/h2-highchart/stock-tools/stock-icons/arrow-line.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
12 |
--------------------------------------------------------------------------------
/h2-highchart/stock-tools/stock-icons/arrow-ray.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
11 |
--------------------------------------------------------------------------------
/h2-highchart/stock-tools/stock-icons/arrow-right.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
10 |
--------------------------------------------------------------------------------
/h2-highchart/stock-tools/stock-icons/arrow-segment.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
12 |
--------------------------------------------------------------------------------
/h2-highchart/stock-tools/stock-icons/arrow.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
14 |
--------------------------------------------------------------------------------
/h2-highchart/stock-tools/stock-icons/circle.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
14 |
--------------------------------------------------------------------------------
/h2-highchart/stock-tools/stock-icons/close.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
9 |
--------------------------------------------------------------------------------
/h2-highchart/stock-tools/stock-icons/crooked-3.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
14 |
--------------------------------------------------------------------------------
/h2-highchart/stock-tools/stock-icons/crooked-5.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
12 |
--------------------------------------------------------------------------------
/h2-highchart/stock-tools/stock-icons/current-price-hide.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
41 |
--------------------------------------------------------------------------------
/h2-highchart/stock-tools/stock-icons/current-price-show.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
42 |
--------------------------------------------------------------------------------
/h2-highchart/stock-tools/stock-icons/destroy.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
15 |
--------------------------------------------------------------------------------
/h2-highchart/stock-tools/stock-icons/drawing.svg:
--------------------------------------------------------------------------------
1 |
19 |
--------------------------------------------------------------------------------
/h2-highchart/stock-tools/stock-icons/edit.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
11 |
--------------------------------------------------------------------------------
/h2-highchart/stock-tools/stock-icons/elliott-3.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
60 |
--------------------------------------------------------------------------------
/h2-highchart/stock-tools/stock-icons/elliott-5.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
42 |
--------------------------------------------------------------------------------
/h2-highchart/stock-tools/stock-icons/ellipse.svg:
--------------------------------------------------------------------------------
1 |
12 |
--------------------------------------------------------------------------------
/h2-highchart/stock-tools/stock-icons/fibonacci-timezone.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
17 |
--------------------------------------------------------------------------------
/h2-highchart/stock-tools/stock-icons/fibonacci.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
26 |
--------------------------------------------------------------------------------
/h2-highchart/stock-tools/stock-icons/flag-basic.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
11 |
--------------------------------------------------------------------------------
/h2-highchart/stock-tools/stock-icons/flag-diamond.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
13 |
--------------------------------------------------------------------------------
/h2-highchart/stock-tools/stock-icons/flag-elipse.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
14 |
--------------------------------------------------------------------------------
/h2-highchart/stock-tools/stock-icons/flag-trapeze.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
15 |
--------------------------------------------------------------------------------
/h2-highchart/stock-tools/stock-icons/fullscreen.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
16 |
--------------------------------------------------------------------------------
/h2-highchart/stock-tools/stock-icons/horizontal-line.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
9 |
--------------------------------------------------------------------------------
/h2-highchart/stock-tools/stock-icons/indicators.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
28 |
--------------------------------------------------------------------------------
/h2-highchart/stock-tools/stock-icons/label.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
17 |
--------------------------------------------------------------------------------
/h2-highchart/stock-tools/stock-icons/line.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
12 |
--------------------------------------------------------------------------------
/h2-highchart/stock-tools/stock-icons/linear.svg:
--------------------------------------------------------------------------------
1 |
12 |
--------------------------------------------------------------------------------
/h2-highchart/stock-tools/stock-icons/logarithmic.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/h2-highchart/stock-tools/stock-icons/measure-x.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
24 |
--------------------------------------------------------------------------------
/h2-highchart/stock-tools/stock-icons/measure-xy.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
29 |
--------------------------------------------------------------------------------
/h2-highchart/stock-tools/stock-icons/measure-y.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
25 |
--------------------------------------------------------------------------------
/h2-highchart/stock-tools/stock-icons/panning.svg:
--------------------------------------------------------------------------------
1 |
18 |
--------------------------------------------------------------------------------
/h2-highchart/stock-tools/stock-icons/parallel-channel.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
16 |
--------------------------------------------------------------------------------
/h2-highchart/stock-tools/stock-icons/pitchfork.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
14 |
--------------------------------------------------------------------------------
/h2-highchart/stock-tools/stock-icons/ray.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
11 |
--------------------------------------------------------------------------------
/h2-highchart/stock-tools/stock-icons/rectangle.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
9 |
--------------------------------------------------------------------------------
/h2-highchart/stock-tools/stock-icons/remove-annotations.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
16 |
--------------------------------------------------------------------------------
/h2-highchart/stock-tools/stock-icons/save-chart.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
13 |
--------------------------------------------------------------------------------
/h2-highchart/stock-tools/stock-icons/segment.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
11 |
--------------------------------------------------------------------------------
/h2-highchart/stock-tools/stock-icons/separator.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
11 |
--------------------------------------------------------------------------------
/h2-highchart/stock-tools/stock-icons/series-candlestick.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
13 |
--------------------------------------------------------------------------------
/h2-highchart/stock-tools/stock-icons/series-heikin-ashi.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/h2-highchart/stock-tools/stock-icons/series-hlc.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/h2-highchart/stock-tools/stock-icons/series-hollow-candlestick.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/h2-highchart/stock-tools/stock-icons/series-line.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
12 |
--------------------------------------------------------------------------------
/h2-highchart/stock-tools/stock-icons/series-ohlc.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
15 |
--------------------------------------------------------------------------------
/h2-highchart/stock-tools/stock-icons/text.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
14 |
--------------------------------------------------------------------------------
/h2-highchart/stock-tools/stock-icons/time-cycles.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
36 |
--------------------------------------------------------------------------------
/h2-highchart/stock-tools/stock-icons/vertical-arrow.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
8 |
--------------------------------------------------------------------------------
/h2-highchart/stock-tools/stock-icons/vertical-counter.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
24 |
--------------------------------------------------------------------------------
/h2-highchart/stock-tools/stock-icons/vertical-double-arrow.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
11 |
--------------------------------------------------------------------------------
/h2-highchart/stock-tools/stock-icons/vertical-label.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
15 |
--------------------------------------------------------------------------------
/h2-highchart/stock-tools/stock-icons/vertical-line.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
9 |
--------------------------------------------------------------------------------
/h2-highchart/stock-tools/stock-icons/zoom-x.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
18 |
--------------------------------------------------------------------------------
/h2-highchart/stock-tools/stock-icons/zoom-xy.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
14 |
--------------------------------------------------------------------------------
/h2-highchart/stock-tools/stock-icons/zoom-y.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
18 |
--------------------------------------------------------------------------------
/h2-highchart/stock-tools/tema.js:
--------------------------------------------------------------------------------
1 | !/**
2 | * Highstock JS v11.4.0 (2024-03-04)
3 | *
4 | * Indicator series type for Highcharts Stock
5 | *
6 | * (c) 2010-2024 Rafal Sebestjanski
7 | *
8 | * License: www.highcharts.com/license
9 | */function(e){"object"==typeof module&&module.exports?(e.default=e,module.exports=e):"function"==typeof define&&define.amd?define("highcharts/indicators/tema",["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 l(e,t,l,s){e.hasOwnProperty(t)||(e[t]=s.apply(null,l),"function"==typeof CustomEvent&&window.dispatchEvent(new CustomEvent("HighchartsModuleLoaded",{detail:{path:t,module:e[t]}})))}l(t,"Stock/Indicators/TEMA/TEMAIndicator.js",[t["Core/Series/SeriesRegistry.js"],t["Core/Utilities.js"]],function(e,t){let{ema:l}=e.seriesTypes,{correctFloat:s,isArray:i,merge:r}=t;class n extends l{getEMA(e,t,l,s,i,r){return super.calculateEma(r||[],e,void 0===i?1:i,this.EMApercent,t,void 0===s?-1:s,l)}getTemaPoint(e,t,l,i){return[e[i-3],s(3*l.level1-3*l.level2+l.level3)]}getValues(e,t){let l=t.period,s=2*l,r=3*l,n=e.xData,o=e.yData,a=o?o.length:0,u=[],h=[],v=[],d=[],c=[],p={},f=-1,g=0,m=0,E,y,M,A;if(this.EMApercent=2/(l+1),!(a<3*l-2)){for(i(o[0])&&(f=t.index?t.index:0),m=(g=super.accumulatePeriodPoints(l,f,o))/l,g=0,M=l;M"],"sourcesContent":["/**\n * @license Highstock JS v11.4.0 (2024-03-04)\n *\n * Indicator series type for Highcharts Stock\n *\n * (c) 2010-2024 Sebastian Bochan\n *\n * License: www.highcharts.com/license\n */\n(function (factory) {\n if (typeof module === 'object' && module.exports) {\n factory['default'] = factory;\n module.exports = factory;\n } else if (typeof define === 'function' && define.amd) {\n define('highcharts/indicators/trendline', ['highcharts', 'highcharts/modules/stock'], function (Highcharts) {\n factory(Highcharts);\n factory.Highcharts = Highcharts;\n return factory;\n });\n } else {\n factory(typeof Highcharts !== 'undefined' ? Highcharts : undefined);\n }\n}(function (Highcharts) {\n 'use strict';\n var _modules = Highcharts ? Highcharts._modules : {};\n function _registerModule(obj, path, args, fn) {\n if (!obj.hasOwnProperty(path)) {\n obj[path] = fn.apply(null, args);\n\n if (typeof CustomEvent === 'function') {\n window.dispatchEvent(new CustomEvent(\n 'HighchartsModuleLoaded',\n { detail: { path: path, module: obj[path] } }\n ));\n }\n }\n }\n _registerModule(_modules, 'Stock/Indicators/TrendLine/TrendLineIndicator.js', [_modules['Core/Series/SeriesRegistry.js'], _modules['Core/Utilities.js']], function (SeriesRegistry, U) {\n /* *\n *\n * License: www.highcharts.com/license\n *\n * !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!!\n *\n * */\n const { sma: SMAIndicator } = SeriesRegistry.seriesTypes;\n const { extend, merge, isArray } = U;\n /* *\n *\n * Class\n *\n * */\n /**\n * The Trend line series type.\n *\n * @private\n * @class\n * @name Highcharts.seriesTypes.trendline\n *\n * @augments Highcharts.Series\n */\n class TrendLineIndicator extends SMAIndicator {\n constructor() {\n /* *\n *\n * Static Properties\n *\n * */\n super(...arguments);\n this.updateAllPoints = true;\n }\n /* *\n *\n * Functions\n *\n * */\n getValues(series, params) {\n const orgXVal = series.xData, yVal = series.yData, xVal = [], LR = [], xData = [], yData = [], index = params.index;\n let numerator = 0, denominator = 0, xValSum = 0, yValSum = 0, counter = 0;\n // Create an array of consecutive xValues, (don't remove duplicates)\n for (let i = 0; i < orgXVal.length; i++) {\n if (i === 0 || orgXVal[i] !== orgXVal[i - 1]) {\n counter++;\n }\n xVal.push(counter);\n }\n for (let i = 0; i < xVal.length; i++) {\n xValSum += xVal[i];\n yValSum += isArray(yVal[i]) ? yVal[i][index] : yVal[i];\n }\n const meanX = xValSum / xVal.length, meanY = yValSum / yVal.length;\n for (let i = 0; i < xVal.length; i++) {\n const y = isArray(yVal[i]) ? yVal[i][index] : yVal[i];\n numerator += (xVal[i] - meanX) * (y - meanY);\n denominator += Math.pow(xVal[i] - meanX, 2);\n }\n // Calculate linear regression:\n for (let i = 0; i < xVal.length; i++) {\n // Check if the xVal is already used\n if (orgXVal[i] === xData[xData.length - 1]) {\n continue;\n }\n const x = orgXVal[i], y = meanY + (numerator / denominator) * (xVal[i] - meanX);\n LR.push([x, y]);\n xData.push(x);\n yData.push(y);\n }\n return {\n xData: xData,\n yData: yData,\n values: LR\n };\n }\n }\n /**\n * Trendline (linear regression) fits a straight line to the selected data\n * using a method called the Sum Of Least Squares. This series requires the\n * `linkedTo` option to be set.\n *\n * @sample stock/indicators/trendline\n * Trendline indicator\n *\n * @extends plotOptions.sma\n * @since 7.1.3\n * @product highstock\n * @requires stock/indicators/indicators\n * @requires stock/indicators/trendline\n * @optionparent plotOptions.trendline\n */\n TrendLineIndicator.defaultOptions = merge(SMAIndicator.defaultOptions, {\n /**\n * @excluding period\n */\n params: {\n period: void 0,\n /**\n * The point index which indicator calculations will base. For\n * example using OHLC data, index=2 means the indicator will be\n * calculated using Low values.\n *\n * @default 3\n */\n index: 3\n }\n });\n extend(TrendLineIndicator.prototype, {\n nameBase: 'Trendline',\n nameComponents: void 0\n });\n SeriesRegistry.registerSeriesType('trendline', TrendLineIndicator);\n /* *\n *\n * Default Export\n *\n * */\n /* *\n *\n * API Options\n *\n * */\n /**\n * A `TrendLine` series. If the [type](#series.trendline.type) option is not\n * specified, it is inherited from [chart.type](#chart.type).\n *\n * @extends series,plotOptions.trendline\n * @since 7.1.3\n * @product highstock\n * @excluding dataParser, dataURL\n * @requires stock/indicators/indicators\n * @requires stock/indicators/trendline\n * @apioption series.trendline\n */\n ''; // to include the above in the js output\n\n return TrendLineIndicator;\n });\n _registerModule(_modules, 'masters/indicators/trendline.src.js', [_modules['Core/Globals.js']], function (Highcharts) {\n\n\n return Highcharts;\n });\n}));"],"names":["factory","module","exports","define","amd","Highcharts","undefined","_modules","_registerModule","obj","path","args","fn","hasOwnProperty","apply","CustomEvent","window","dispatchEvent","detail","SeriesRegistry","U","sma","SMAIndicator","seriesTypes","extend","merge","isArray","TrendLineIndicator","constructor","arguments","updateAllPoints","getValues","series","params","orgXVal","xData","yVal","yData","xVal","LR","index","numerator","denominator","xValSum","yValSum","counter","i","length","push","meanX","meanY","y","Math","pow","x","values","defaultOptions","period","prototype","nameBase","nameComponents","registerSeriesType"],"mappings":"CAAA;;;;;;;;CAQC,EACA,SAAUA,CAAO,EACV,AAAkB,UAAlB,OAAOC,QAAuBA,OAAOC,OAAO,EAC5CF,EAAQ,OAAU,CAAGA,EACrBC,OAAOC,OAAO,CAAGF,GACV,AAAkB,YAAlB,OAAOG,QAAyBA,OAAOC,GAAG,CACjDD,OAAO,kCAAmC,CAAC,aAAc,2BAA2B,CAAE,SAAUE,CAAU,EAGtG,OAFAL,EAAQK,GACRL,EAAQK,UAAU,CAAGA,EACdL,CACX,GAEAA,EAAQ,AAAsB,aAAtB,OAAOK,WAA6BA,WAAaC,KAAAA,EAEjE,EAAE,SAAUD,CAAU,EAClB,aACA,IAAIE,EAAWF,EAAaA,EAAWE,QAAQ,CAAG,CAAC,EACnD,SAASC,EAAgBC,CAAG,CAAEC,CAAI,CAAEC,CAAI,CAAEC,CAAE,EACnCH,EAAII,cAAc,CAACH,KACpBD,CAAG,CAACC,EAAK,CAAGE,EAAGE,KAAK,CAAC,KAAMH,GAEA,YAAvB,OAAOI,aACPC,OAAOC,aAAa,CAAC,IAAIF,YACrB,yBACA,CAAEG,OAAQ,CAAER,KAAMA,EAAMT,OAAQQ,CAAG,CAACC,EAAK,AAAC,CAAE,IAI5D,CACAF,EAAgBD,EAAU,mDAAoD,CAACA,CAAQ,CAAC,gCAAgC,CAAEA,CAAQ,CAAC,oBAAoB,CAAC,CAAE,SAAUY,CAAc,CAAEC,CAAC,EAQjL,GAAM,CAAEC,IAAKC,CAAY,CAAE,CAAGH,EAAeI,WAAW,CAClD,CAAEC,OAAAA,CAAM,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AAK,IAAIH,EAAI,EAAGA,EAAIR,EAAKS,MAAM,CAAED,IAAK,CAElC,GAAIZ,CAAO,CAACY,EAAE,GAAKX,CAAK,CAACA,EAAMY,MAAM,CAAG,EAAE,CACtC,SAEJ,IAAMO,EAAIpB,CAAO,CAACY,EAAE,CAAEK,EAAID,EAAQ,AAACT,EAAYC,EAAgBJ,CAAAA,CAAI,CAACQ,EAAE,CAAGG,CAAI,EAC7EV,EAAGS,IAAI,CAAC,CAACM,EAAGH,EAAE,EACdhB,EAAMa,IAAI,CAACM,GACXjB,EAAMW,IAAI,CAACG,EACf,CACA,MAAO,CACHhB,MAAOA,EACPE,MAAOA,EACPkB,OAAQhB,CACZ,CACJ,CACJ,CA6DA,OA7CAZ,EAAmB6B,cAAc,CAAG/B,EAAMH,EAAakC,cAAc,CAAE,CAInEvB,OAAQ,CACJwB,OAAQ,KAAK,EAQbjB,MAAO,CACX,CACJ,GACAhB,EAAOG,EAAmB+B,SAAS,CAAE,CACjCC,SAAU,YACVC,eAAgB,KAAK,CACzB,GACAzC,EAAe0C,kBAAkB,CAAC,YAAalC,GAyBxCA,CACX,GACAnB,EAAgBD,EAAU,sCAAuC,CAACA,CAAQ,CAAC,kBAAkB,CAAC,CAAE,SAAUF,CAAU,EAGhH,OAAOA,CACX,EACJ"}
--------------------------------------------------------------------------------
/h2-highchart/stock-tools/trendline.src.js:
--------------------------------------------------------------------------------
1 | /**
2 | * @license Highstock JS v11.4.0 (2024-03-04)
3 | *
4 | * Indicator series type for Highcharts Stock
5 | *
6 | * (c) 2010-2024 Sebastian Bochan
7 | *
8 | * License: www.highcharts.com/license
9 | */
10 | (function (factory) {
11 | if (typeof module === 'object' && module.exports) {
12 | factory['default'] = factory;
13 | module.exports = factory;
14 | } else if (typeof define === 'function' && define.amd) {
15 | define('highcharts/indicators/trendline', ['highcharts', 'highcharts/modules/stock'], function (Highcharts) {
16 | factory(Highcharts);
17 | factory.Highcharts = Highcharts;
18 | return factory;
19 | });
20 | } else {
21 | factory(typeof Highcharts !== 'undefined' ? Highcharts : undefined);
22 | }
23 | }(function (Highcharts) {
24 | 'use strict';
25 | var _modules = Highcharts ? Highcharts._modules : {};
26 | function _registerModule(obj, path, args, fn) {
27 | if (!obj.hasOwnProperty(path)) {
28 | obj[path] = fn.apply(null, args);
29 |
30 | if (typeof CustomEvent === 'function') {
31 | window.dispatchEvent(new CustomEvent(
32 | 'HighchartsModuleLoaded',
33 | { detail: { path: path, module: obj[path] } }
34 | ));
35 | }
36 | }
37 | }
38 | _registerModule(_modules, 'Stock/Indicators/TrendLine/TrendLineIndicator.js', [_modules['Core/Series/SeriesRegistry.js'], _modules['Core/Utilities.js']], function (SeriesRegistry, U) {
39 | /* *
40 | *
41 | * License: www.highcharts.com/license
42 | *
43 | * !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!!
44 | *
45 | * */
46 | const { sma: SMAIndicator } = SeriesRegistry.seriesTypes;
47 | const { extend, merge, isArray } = U;
48 | /* *
49 | *
50 | * Class
51 | *
52 | * */
53 | /**
54 | * The Trend line series type.
55 | *
56 | * @private
57 | * @class
58 | * @name Highcharts.seriesTypes.trendline
59 | *
60 | * @augments Highcharts.Series
61 | */
62 | class TrendLineIndicator extends SMAIndicator {
63 | constructor() {
64 | /* *
65 | *
66 | * Static Properties
67 | *
68 | * */
69 | super(...arguments);
70 | this.updateAllPoints = true;
71 | }
72 | /* *
73 | *
74 | * Functions
75 | *
76 | * */
77 | getValues(series, params) {
78 | const orgXVal = series.xData, yVal = series.yData, xVal = [], LR = [], xData = [], yData = [], index = params.index;
79 | let numerator = 0, denominator = 0, xValSum = 0, yValSum = 0, counter = 0;
80 | // Create an array of consecutive xValues, (don't remove duplicates)
81 | for (let i = 0; i < orgXVal.length; i++) {
82 | if (i === 0 || orgXVal[i] !== orgXVal[i - 1]) {
83 | counter++;
84 | }
85 | xVal.push(counter);
86 | }
87 | for (let i = 0; i < xVal.length; i++) {
88 | xValSum += xVal[i];
89 | yValSum += isArray(yVal[i]) ? yVal[i][index] : yVal[i];
90 | }
91 | const meanX = xValSum / xVal.length, meanY = yValSum / yVal.length;
92 | for (let i = 0; i < xVal.length; i++) {
93 | const y = isArray(yVal[i]) ? yVal[i][index] : yVal[i];
94 | numerator += (xVal[i] - meanX) * (y - meanY);
95 | denominator += Math.pow(xVal[i] - meanX, 2);
96 | }
97 | // Calculate linear regression:
98 | for (let i = 0; i < xVal.length; i++) {
99 | // Check if the xVal is already used
100 | if (orgXVal[i] === xData[xData.length - 1]) {
101 | continue;
102 | }
103 | const x = orgXVal[i], y = meanY + (numerator / denominator) * (xVal[i] - meanX);
104 | LR.push([x, y]);
105 | xData.push(x);
106 | yData.push(y);
107 | }
108 | return {
109 | xData: xData,
110 | yData: yData,
111 | values: LR
112 | };
113 | }
114 | }
115 | /**
116 | * Trendline (linear regression) fits a straight line to the selected data
117 | * using a method called the Sum Of Least Squares. This series requires the
118 | * `linkedTo` option to be set.
119 | *
120 | * @sample stock/indicators/trendline
121 | * Trendline indicator
122 | *
123 | * @extends plotOptions.sma
124 | * @since 7.1.3
125 | * @product highstock
126 | * @requires stock/indicators/indicators
127 | * @requires stock/indicators/trendline
128 | * @optionparent plotOptions.trendline
129 | */
130 | TrendLineIndicator.defaultOptions = merge(SMAIndicator.defaultOptions, {
131 | /**
132 | * @excluding period
133 | */
134 | params: {
135 | period: void 0,
136 | /**
137 | * The point index which indicator calculations will base. For
138 | * example using OHLC data, index=2 means the indicator will be
139 | * calculated using Low values.
140 | *
141 | * @default 3
142 | */
143 | index: 3
144 | }
145 | });
146 | extend(TrendLineIndicator.prototype, {
147 | nameBase: 'Trendline',
148 | nameComponents: void 0
149 | });
150 | SeriesRegistry.registerSeriesType('trendline', TrendLineIndicator);
151 | /* *
152 | *
153 | * Default Export
154 | *
155 | * */
156 | /* *
157 | *
158 | * API Options
159 | *
160 | * */
161 | /**
162 | * A `TrendLine` series. If the [type](#series.trendline.type) option is not
163 | * specified, it is inherited from [chart.type](#chart.type).
164 | *
165 | * @extends series,plotOptions.trendline
166 | * @since 7.1.3
167 | * @product highstock
168 | * @excluding dataParser, dataURL
169 | * @requires stock/indicators/indicators
170 | * @requires stock/indicators/trendline
171 | * @apioption series.trendline
172 | */
173 | ''; // to include the above in the js output
174 |
175 | return TrendLineIndicator;
176 | });
177 | _registerModule(_modules, 'masters/indicators/trendline.src.js', [_modules['Core/Globals.js']], function (Highcharts) {
178 |
179 |
180 | return Highcharts;
181 | });
182 | }));
--------------------------------------------------------------------------------
/h2-highchart/stock-tools/wma.js:
--------------------------------------------------------------------------------
1 | !/**
2 | * Highstock JS v11.4.0 (2024-03-04)
3 | *
4 | * Indicator series type for Highcharts Stock
5 | *
6 | * (c) 2010-2024 Kacper Madej
7 | *
8 | * License: www.highcharts.com/license
9 | */function(e){"object"==typeof module&&module.exports?(e.default=e,module.exports=e):"function"==typeof define&&define.amd?define("highcharts/indicators/wma",["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,n){e.hasOwnProperty(t)||(e[t]=n.apply(null,s),"function"==typeof CustomEvent&&window.dispatchEvent(new CustomEvent("HighchartsModuleLoaded",{detail:{path:t,module:e[t]}})))}s(t,"Stock/Indicators/WMA/WMAIndicator.js",[t["Core/Series/SeriesRegistry.js"],t["Core/Utilities.js"]],function(e,t){let{sma:s}=e.seriesTypes,{isArray:n,merge:i}=t;function r(e,t,s,n,i){let r=t[n],o=i<0?s[n]:s[n][i];e.push([r,o])}function o(e,t,s,n){let i=e.length,r=e.reduce(function(e,t,s){return[null,e[1]+t[1]*(s+1)]})[1]/((i+1)/2*i),o=t[n-1];return e.shift(),[o,r]}class u extends s{getValues(e,t){let s=t.period,i=e.xData,u=e.yData,a=u?u.length:0,d=i[0],h=[],c=[],l=[],f=1,p=-1,m,g,y=u[0];if(i.length"],"sourcesContent":["/**\n * @license Highstock JS v11.4.0 (2024-03-04)\n *\n * Indicator series type for Highcharts Stock\n *\n * (c) 2010-2024 Kacper Madej\n *\n * License: www.highcharts.com/license\n */\n(function (factory) {\n if (typeof module === 'object' && module.exports) {\n factory['default'] = factory;\n module.exports = factory;\n } else if (typeof define === 'function' && define.amd) {\n define('highcharts/indicators/wma', ['highcharts', 'highcharts/modules/stock'], function (Highcharts) {\n factory(Highcharts);\n factory.Highcharts = Highcharts;\n return factory;\n });\n } else {\n factory(typeof Highcharts !== 'undefined' ? Highcharts : undefined);\n }\n}(function (Highcharts) {\n 'use strict';\n var _modules = Highcharts ? Highcharts._modules : {};\n function _registerModule(obj, path, args, fn) {\n if (!obj.hasOwnProperty(path)) {\n obj[path] = fn.apply(null, args);\n\n if (typeof CustomEvent === 'function') {\n window.dispatchEvent(new CustomEvent(\n 'HighchartsModuleLoaded',\n { detail: { path: path, module: obj[path] } }\n ));\n }\n }\n }\n _registerModule(_modules, 'Stock/Indicators/WMA/WMAIndicator.js', [_modules['Core/Series/SeriesRegistry.js'], _modules['Core/Utilities.js']], function (SeriesRegistry, U) {\n /* *\n *\n * (c) 2010-2024 Kacper Madej\n *\n * License: www.highcharts.com/license\n *\n * !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!!\n *\n * */\n const { sma: SMAIndicator } = SeriesRegistry.seriesTypes;\n const { isArray, merge } = U;\n /* *\n *\n * Functions\n *\n * */\n // Utils:\n /**\n * @private\n */\n function accumulateAverage(points, xVal, yVal, i, index) {\n const xValue = xVal[i], yValue = index < 0 ? yVal[i] : yVal[i][index];\n points.push([xValue, yValue]);\n }\n /**\n * @private\n */\n function weightedSumArray(array, pLen) {\n // The denominator is the sum of the number of days as a triangular number.\n // If there are 5 days, the triangular numbers are 5, 4, 3, 2, and 1.\n // The sum is 5 + 4 + 3 + 2 + 1 = 15.\n const denominator = (pLen + 1) / 2 * pLen;\n // reduce VS loop => reduce\n return array.reduce(function (prev, cur, i) {\n return [null, prev[1] + cur[1] * (i + 1)];\n })[1] / denominator;\n }\n /**\n * @private\n */\n function populateAverage(points, xVal, yVal, i) {\n const pLen = points.length, wmaY = weightedSumArray(points, pLen), wmaX = xVal[i - 1];\n points.shift(); // remove point until range < period\n return [wmaX, wmaY];\n }\n /* *\n *\n * Class\n *\n * */\n /**\n * The SMA series type.\n *\n * @private\n * @class\n * @name Highcharts.seriesTypes.wma\n *\n * @augments Highcharts.Series\n */\n class WMAIndicator extends SMAIndicator {\n /* *\n *\n * Functions\n *\n * */\n getValues(series, params) {\n const period = params.period, xVal = series.xData, yVal = series.yData, yValLen = yVal ? yVal.length : 0, xValue = xVal[0], wma = [], xData = [], yData = [];\n let range = 1, index = -1, i, wmaPoint, yValue = yVal[0];\n if (xVal.length < period) {\n return;\n }\n // Switch index for OHLC / Candlestick\n if (isArray(yVal[0])) {\n index = params.index;\n yValue = yVal[0][index];\n }\n // Starting point\n const points = [[xValue, yValue]];\n // Accumulate first N-points\n while (range !== period) {\n accumulateAverage(points, xVal, yVal, range, index);\n range++;\n }\n // Calculate value one-by-one for each period in visible data\n for (i = range; i < yValLen; i++) {\n wmaPoint = populateAverage(points, xVal, yVal, i);\n wma.push(wmaPoint);\n xData.push(wmaPoint[0]);\n yData.push(wmaPoint[1]);\n accumulateAverage(points, xVal, yVal, i, index);\n }\n wmaPoint = populateAverage(points, xVal, yVal, i);\n wma.push(wmaPoint);\n xData.push(wmaPoint[0]);\n yData.push(wmaPoint[1]);\n return {\n values: wma,\n xData: xData,\n yData: yData\n };\n }\n }\n /* *\n *\n * Static Properties\n *\n * */\n /**\n * Weighted moving average indicator (WMA). This series requires `linkedTo`\n * option to be set.\n *\n * @sample stock/indicators/wma\n * Weighted moving average indicator\n *\n * @extends plotOptions.sma\n * @since 6.0.0\n * @product highstock\n * @requires stock/indicators/indicators\n * @requires stock/indicators/wma\n * @optionparent plotOptions.wma\n */\n WMAIndicator.defaultOptions = merge(SMAIndicator.defaultOptions, {\n params: {\n index: 3,\n period: 9\n }\n });\n SeriesRegistry.registerSeriesType('wma', WMAIndicator);\n /* *\n *\n * Default Export\n *\n * */\n /* *\n *\n * API Options\n *\n * */\n /**\n * A `WMA` series. If the [type](#series.wma.type) option is not specified, it\n * is inherited from [chart.type](#chart.type).\n *\n * @extends series,plotOptions.wma\n * @since 6.0.0\n * @product highstock\n * @excluding dataParser, dataURL\n * @requires stock/indicators/indicators\n * @requires stock/indicators/wma\n * @apioption series.wma\n */\n ''; // adds doclet above to the transpiled file\n\n return WMAIndicator;\n });\n _registerModule(_modules, 'masters/indicators/wma.src.js', [_modules['Core/Globals.js']], function (Highcharts) {\n\n\n return Highcharts;\n });\n}));"],"names":["factory","module","exports","define","amd","Highcharts","undefined","_modules","_registerModule","obj","path","args","fn","hasOwnProperty","apply","CustomEvent","window","dispatchEvent","detail","SeriesRegistry","U","sma","SMAIndicator","seriesTypes","isArray","merge","accumulateAverage","points","xVal","yVal","i","index","xValue","yValue","push","populateAverage","pLen","length","wmaY","array","reduce","prev","cur","wmaX","shift","WMAIndicator","getValues","series","params","period","xData","yData","yValLen","wma","range","wmaPoint","values","defaultOptions","registerSeriesType"],"mappings":"CAAA;;;;;;;;CAQC,EACA,SAAUA,CAAO,EACV,AAAkB,UAAlB,OAAOC,QAAuBA,OAAOC,OAAO,EAC5CF,EAAQ,OAAU,CAAGA,EACrBC,OAAOC,OAAO,CAAGF,GACV,AAAkB,YAAlB,OAAOG,QAAyBA,OAAOC,GAAG,CACjDD,OAAO,4BAA6B,CAAC,aAAc,2BAA2B,CAAE,SAAUE,CAAU,EAGhG,OAFAL,EAAQK,GACRL,EAAQK,UAAU,CAAGA,EACdL,CACX,GAEAA,EAAQ,AAAsB,aAAtB,OAAOK,WAA6BA,WAAaC,KAAAA,EAEjE,EAAE,SAAUD,CAAU,EAClB,aACA,IAAIE,EAAWF,EAAaA,EAAWE,QAAQ,CAAG,CAAC,EACnD,SAASC,EAAgBC,CAAG,CAAEC,CAAI,CAAEC,CAAI,CAA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AAQ,CACZ,CACJ,GACA9B,EAAeuC,kBAAkB,CAAC,MAAOb,GAyBlCA,CACX,GACArC,EAAgBD,EAAU,gCAAiC,CAACA,CAAQ,CAAC,kBAAkB,CAAC,CAAE,SAAUF,CAAU,EAG1G,OAAOA,CACX,EACJ"}
--------------------------------------------------------------------------------
/h2-highchart/stock-tools/wma.src.js:
--------------------------------------------------------------------------------
1 | /**
2 | * @license Highstock JS v11.4.0 (2024-03-04)
3 | *
4 | * Indicator series type for Highcharts Stock
5 | *
6 | * (c) 2010-2024 Kacper Madej
7 | *
8 | * License: www.highcharts.com/license
9 | */
10 | (function (factory) {
11 | if (typeof module === 'object' && module.exports) {
12 | factory['default'] = factory;
13 | module.exports = factory;
14 | } else if (typeof define === 'function' && define.amd) {
15 | define('highcharts/indicators/wma', ['highcharts', 'highcharts/modules/stock'], function (Highcharts) {
16 | factory(Highcharts);
17 | factory.Highcharts = Highcharts;
18 | return factory;
19 | });
20 | } else {
21 | factory(typeof Highcharts !== 'undefined' ? Highcharts : undefined);
22 | }
23 | }(function (Highcharts) {
24 | 'use strict';
25 | var _modules = Highcharts ? Highcharts._modules : {};
26 | function _registerModule(obj, path, args, fn) {
27 | if (!obj.hasOwnProperty(path)) {
28 | obj[path] = fn.apply(null, args);
29 |
30 | if (typeof CustomEvent === 'function') {
31 | window.dispatchEvent(new CustomEvent(
32 | 'HighchartsModuleLoaded',
33 | { detail: { path: path, module: obj[path] } }
34 | ));
35 | }
36 | }
37 | }
38 | _registerModule(_modules, 'Stock/Indicators/WMA/WMAIndicator.js', [_modules['Core/Series/SeriesRegistry.js'], _modules['Core/Utilities.js']], function (SeriesRegistry, U) {
39 | /* *
40 | *
41 | * (c) 2010-2024 Kacper Madej
42 | *
43 | * License: www.highcharts.com/license
44 | *
45 | * !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!!
46 | *
47 | * */
48 | const { sma: SMAIndicator } = SeriesRegistry.seriesTypes;
49 | const { isArray, merge } = U;
50 | /* *
51 | *
52 | * Functions
53 | *
54 | * */
55 | // Utils:
56 | /**
57 | * @private
58 | */
59 | function accumulateAverage(points, xVal, yVal, i, index) {
60 | const xValue = xVal[i], yValue = index < 0 ? yVal[i] : yVal[i][index];
61 | points.push([xValue, yValue]);
62 | }
63 | /**
64 | * @private
65 | */
66 | function weightedSumArray(array, pLen) {
67 | // The denominator is the sum of the number of days as a triangular number.
68 | // If there are 5 days, the triangular numbers are 5, 4, 3, 2, and 1.
69 | // The sum is 5 + 4 + 3 + 2 + 1 = 15.
70 | const denominator = (pLen + 1) / 2 * pLen;
71 | // reduce VS loop => reduce
72 | return array.reduce(function (prev, cur, i) {
73 | return [null, prev[1] + cur[1] * (i + 1)];
74 | })[1] / denominator;
75 | }
76 | /**
77 | * @private
78 | */
79 | function populateAverage(points, xVal, yVal, i) {
80 | const pLen = points.length, wmaY = weightedSumArray(points, pLen), wmaX = xVal[i - 1];
81 | points.shift(); // remove point until range < period
82 | return [wmaX, wmaY];
83 | }
84 | /* *
85 | *
86 | * Class
87 | *
88 | * */
89 | /**
90 | * The SMA series type.
91 | *
92 | * @private
93 | * @class
94 | * @name Highcharts.seriesTypes.wma
95 | *
96 | * @augments Highcharts.Series
97 | */
98 | class WMAIndicator extends SMAIndicator {
99 | /* *
100 | *
101 | * Functions
102 | *
103 | * */
104 | getValues(series, params) {
105 | const period = params.period, xVal = series.xData, yVal = series.yData, yValLen = yVal ? yVal.length : 0, xValue = xVal[0], wma = [], xData = [], yData = [];
106 | let range = 1, index = -1, i, wmaPoint, yValue = yVal[0];
107 | if (xVal.length < period) {
108 | return;
109 | }
110 | // Switch index for OHLC / Candlestick
111 | if (isArray(yVal[0])) {
112 | index = params.index;
113 | yValue = yVal[0][index];
114 | }
115 | // Starting point
116 | const points = [[xValue, yValue]];
117 | // Accumulate first N-points
118 | while (range !== period) {
119 | accumulateAverage(points, xVal, yVal, range, index);
120 | range++;
121 | }
122 | // Calculate value one-by-one for each period in visible data
123 | for (i = range; i < yValLen; i++) {
124 | wmaPoint = populateAverage(points, xVal, yVal, i);
125 | wma.push(wmaPoint);
126 | xData.push(wmaPoint[0]);
127 | yData.push(wmaPoint[1]);
128 | accumulateAverage(points, xVal, yVal, i, index);
129 | }
130 | wmaPoint = populateAverage(points, xVal, yVal, i);
131 | wma.push(wmaPoint);
132 | xData.push(wmaPoint[0]);
133 | yData.push(wmaPoint[1]);
134 | return {
135 | values: wma,
136 | xData: xData,
137 | yData: yData
138 | };
139 | }
140 | }
141 | /* *
142 | *
143 | * Static Properties
144 | *
145 | * */
146 | /**
147 | * Weighted moving average indicator (WMA). This series requires `linkedTo`
148 | * option to be set.
149 | *
150 | * @sample stock/indicators/wma
151 | * Weighted moving average indicator
152 | *
153 | * @extends plotOptions.sma
154 | * @since 6.0.0
155 | * @product highstock
156 | * @requires stock/indicators/indicators
157 | * @requires stock/indicators/wma
158 | * @optionparent plotOptions.wma
159 | */
160 | WMAIndicator.defaultOptions = merge(SMAIndicator.defaultOptions, {
161 | params: {
162 | index: 3,
163 | period: 9
164 | }
165 | });
166 | SeriesRegistry.registerSeriesType('wma', WMAIndicator);
167 | /* *
168 | *
169 | * Default Export
170 | *
171 | * */
172 | /* *
173 | *
174 | * API Options
175 | *
176 | * */
177 | /**
178 | * A `WMA` series. If the [type](#series.wma.type) option is not specified, it
179 | * is inherited from [chart.type](#chart.type).
180 | *
181 | * @extends series,plotOptions.wma
182 | * @since 6.0.0
183 | * @product highstock
184 | * @excluding dataParser, dataURL
185 | * @requires stock/indicators/indicators
186 | * @requires stock/indicators/wma
187 | * @apioption series.wma
188 | */
189 | ''; // adds doclet above to the transpiled file
190 |
191 | return WMAIndicator;
192 | });
193 | _registerModule(_modules, 'masters/indicators/wma.src.js', [_modules['Core/Globals.js']], function (Highcharts) {
194 |
195 |
196 | return Highcharts;
197 | });
198 | }));
--------------------------------------------------------------------------------