Socket
Socket
Sign inDemoInstall

technicalindicators

Package Overview
Dependencies
4
Maintainers
1
Versions
73
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.0.15 to 1.0.16

debug.js

18

.vscode/launch.json

@@ -5,13 +5,21 @@ {

{
"name": "Run mocha",
"name": "Debug",
"type": "node",
"request": "launch",
"program": "${workspaceRoot}/node_modules/mocha/bin/_mocha",
"program": "${workspaceRoot}/debug.js",
"stopOnEntry": false,
"args": ["--compilers", "js:babel-core/register", "--require", "babel-polyfill"],
"args": [],
"cwd": "${workspaceRoot}",
"runtimeExecutable": null,
"env": { "NODE_ENV": "testing"}
"preLaunchTask": null,
"runtimeExecutable": "${workspaceRoot}/node_modules/.bin/babel-node",
"runtimeArgs": [
"--nolazy"
],
"env": {
"NODE_ENV": "development"
},
"console": "internalConsole",
"sourceMaps": true
}
]
}

@@ -1,3 +0,3 @@

!function(e){"use strict";function t(e,t){ee[e]=t}function r(e){return ee[e]}function n(e){var t=r("precision");return t?parseFloat(e.toPrecision(t)):e}function o(e){ae.reverseInputs(e);var t=new he(e).result;return e.reversedInput&&t.reverse(),ae.reverseInputs(e),t}function i(e){ae.reverseInputs(e);var t=new le(e).result;return e.reversedInput&&t.reverse(),ae.reverseInputs(e),t}function a(e){ae.reverseInputs(e);var t=new ce(e).result;return e.reversedInput&&t.reverse(),ae.reverseInputs(e),t}function u(e){ae.reverseInputs(e);var t=new ve(e).result;return e.reversedInput&&t.reverse(),ae.reverseInputs(e),t}function s(e){ae.reverseInputs(e);var t=new pe(e).result;return e.reversedInput&&t.reverse(),ae.reverseInputs(e),t}function h(e){ae.reverseInputs(e);var t=new fe(e).result;return e.reversedInput&&t.reverse(),ae.reverseInputs(e),t}function l(e){ae.reverseInputs(e);var t=new ge(e).result;return e.reversedInput&&t.reverse(),ae.reverseInputs(e),t}function c(e){ae.reverseInputs(e);var t=new de(e).result;return e.reversedInput&&t.reverse(),ae.reverseInputs(e),t}function v(e){ae.reverseInputs(e);var t=new we(e).result;return e.reversedInput&&t.reverse(),ae.reverseInputs(e),t}function p(e){ae.reverseInputs(e);var t=new xe(e).result;return e.reversedInput&&t.reverse(),ae.reverseInputs(e),t}function f(e){ae.reverseInputs(e);var t=new me(e).result;return e.reversedInput&&t.reverse(),ae.reverseInputs(e),t}function g(e){ae.reverseInputs(e);var t=new ke(e).result;return e.reversedInput&&t.reverse(),ae.reverseInputs(e),t}function d(e){ae.reverseInputs(e);var t=new Oe(e).result;return e.reversedInput&&t.reverse(),ae.reverseInputs(e),t}function _(e){ae.reverseInputs(e);var t=new Pe(e).result;return e.reversedInput&&t.reverse(),ae.reverseInputs(e),t}function w(e){ae.reverseInputs(e);var t=new je(e).result;return e.reversedInput&&t.reverse(),ae.reverseInputs(e),t}function x(e){ae.reverseInputs(e);var t=new Ie(e).result;return e.reversedInput&&t.reverse(),ae.reverseInputs(e),t}function m(e){ae.reverseInputs(e);var t=new Re(e).result;return e.reversedInput&&t.reverse(),ae.reverseInputs(e),t}function b(e){ae.reverseInputs(e);var t=new Ve(e).result;return e.reversedInput&&t.reverse(),ae.reverseInputs(e),t}function y(e){ae.reverseInputs(e);var t=new Ce(e).result;return e.reversedInput&&t.reverse(),ae.reverseInputs(e),t}function k(e){ae.reverseInputs(e);var t=new qe(e).result;return e.reversedInput&&t.reverse(),ae.reverseInputs(e),t}function O(e){ae.reverseInputs(e);var t=new Ee(e).result;return e.reversedInput&&t.reverse(),ae.reverseInputs(e),t}function P(e){ae.reverseInputs(e);var t=new Se(e).result;return e.reversedInput&&(t.open.reverse(),t.high.reverse(),t.low.reverse(),t.close.reverse(),t.volume.reverse(),t.timestamp.reverse()),ae.reverseInputs(e),t}function j(e){ae.reverseInputs(e);var t=new Ae(e).result;return e.reversedInput&&(t.open.reverse(),t.high.reverse(),t.low.reverse(),t.close.reverse(),t.volume.reverse(),t.timestamp.reverse()),ae.reverseInputs(e),t}function I(e){return(new Le).hasPattern(e)}function R(e){return(new ze).hasPattern(e)}function V(e){return(new He).hasPattern(e)}function C(e){return(new Be).hasPattern(e)}function q(e){return(new Te).hasPattern(e)}function E(e){return(new Ne).hasPattern(e)}function M(e){return(new Fe).hasPattern(e)}function S(e){return(new We).hasPattern(e)}function A(e){return(new Ge).hasPattern(e)}function D(e){return(new Xe).hasPattern(e)}function L(e){return(new Je).hasPattern(e)}function z(e){return(new Qe).hasPattern(e)}function H(e){return(new Ue).hasPattern(e)}function B(e){return(new Ye).hasPattern(e)}function T(e){return(new Ze).hasPattern(e)}function N(e){return(new $e).hasPattern(e)}function F(e){return(new et).hasPattern(e)}function W(e){return(new tt).hasPattern(e)}function G(e){return(new nt).hasPattern(e)}function X(e){return(new ot).hasPattern(e)}function K(e){return(new it).hasPattern(e)}function J(e){return(new at).hasPattern(e)}function Q(e){return(new ut).hasPattern(e)}function U(e){return(new st).hasPattern(e)}function Y(e){return(new ht).hasPattern(e)}function Z(e,t){var r=[0,23.6,38.2,50,61.8,78.6,100,127.2,161.8,261.8,423.6];return e<t?r.map(function(r){var n=t-Math.abs(e-t)*r/100;return n>0?n:0}):r.map(function(r){var n=t+Math.abs(e-t)*r/100;return n>0?n:0})}function $(){var e=[];return e.push("sma"),e.push("ema"),e.push("wma"),e.push("wema"),e.push("macd"),e.push("rsi"),e.push("bollingerbands"),e.push("adx"),e.push("atr"),e.push("truerange"),e.push("roc"),e.push("kst"),e.push("stochastic"),e.push("williamsr"),e.push("adl"),e.push("obv"),e.push("trix"),e.push("averagegain"),e.push("averageloss"),e.push("sd"),e.push("bullish"),e.push("bearish"),e.push("abandonedbaby"),e.push("doji"),e.push("bearishengulfingpattern"),e.push("bullishengulfingpattern"),e.push("darkcloudcover"),e.push("downsidetasukigap"),e.push("dragonflydoji"),e.push("gravestonedoji"),e.push("bullishharami"),e.push("bearishharami"),e.push("bullishharamicross"),e.push("bearishharamicross"),e.push("eveningdojistar"),e.push("eveningstar"),e.push("morningdojistar"),e.push("morningstar"),e.push("bullishmarubozu"),e.push("bearishmarubozu"),e.push("piercingline"),e.push("bullishspinningtop"),e.push("bearishspinningtop"),e.push("threeblackcrows"),e.push("threewhitesoldiers"),e}var ee={},te=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},re=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),ne=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)},oe=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t},ie=function e(){te(this,e)},ae=function(){function e(t){te(this,e),this.format=t.format||n}return re(e,[{key:"getResult",value:function(){return this.result}}],[{key:"reverseInputs",value:function(e){e.reversedInput&&(e.values&&e.values.reverse(),e.open&&e.open.reverse(),e.high&&e.high.reverse(),e.low&&e.low.reverse(),e.close&&e.close.reverse(),e.volume&&e.volume.reverse(),e.timestamp&&e.timestamp.reverse())}}]),e}(),ue=function e(t,r,n){te(this,e),this.next=n,n&&(n.prev=this),this.prev=r,r&&(r.next=this),this.data=t},se=function(){function e(){te(this,e),this._length=0}return re(e,[{key:"push",value:function(e){this._tail=new ue(e,this._tail),0===this._length&&(this._head=this._tail,this._current=this._head,this._next=this._head),this._length++}},{key:"pop",value:function(){var e=this._tail;if(0!==this._length)return 0===--this._length?(this._head=this._tail=this._current=this._next=void 0,e.data):(this._tail=e.prev,this._tail.next=void 0,this._current===e&&(this._current=this._tail,this._next=void 0),e.data)}},{key:"shift",value:function(){var e=this._head;if(0!==this._length)return 0===--this._length?(this._head=this._tail=this._current=this._next=void 0,e.data):(this._head=this._head.next,this._current===e&&(this._current=this._head,this._next=this._current.next),e.data)}},{key:"unshift",value:function(e){this._head=new ue(e,void 0,this._head),0===this._length&&(this._tail=this._head,this._next=this._head),this._length++}},{key:"unshiftCurrent",value:function(){var e=this._current;return e===this._head||this._length<2?e&&e.data:(e===this._tail?(this._tail=e.prev,this._tail.next=void 0,this._current=this._tail):(e.next.prev=e.prev,e.prev.next=e.next,this._current=e.prev),this._next=this._current.next,e.next=this._head,e.prev=void 0,this._head.prev=e,this._head=e,e.data)}},{key:"removeCurrent",value:function(){var e=this._current;if(0!==this._length)return 0===--this._length?(this._head=this._tail=this._current=this._next=void 0,e.data):(e===this._tail?(this._tail=e.prev,this._tail.next=void 0,this._current=this._tail):e===this._head?(this._head=e.next,this._head.prev=void 0,this._current=this._head):(e.next.prev=e.prev,e.prev.next=e.next,this._current=e.prev),this._next=this._current.next,e.data)}},{key:"resetCursor",value:function(){return this._current=this._next=this._head,this}},{key:"next",value:function(){var e=this._next;if(void 0!==e)return this._next=e.next,this._current=e,e.data}},{key:"head",get:function(){return this._head&&this._head.data}},{key:"tail",get:function(){return this._tail&&this._tail.data}},{key:"current",get:function(){return this._current&&this._current.data}},{key:"length",get:function(){return this._length}}]),e}(),he=(function(e){function t(e,r){te(this,t);var n=oe(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return n.period=e,n.values=r,n}ne(t,e)}(ie),function(e){function t(e){te(this,t);var r=oe(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));r.period=e.period,r.price=e.values;var n=regeneratorRuntime.mark(function e(t){var r,n,o,i,a;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return r=new se,n=0,o=1,void(e.next=5);case 5:i=e.sent,r.push(0);case 7:return o<t?(o++,r.push(i),n+=i):(n=n-r.shift()+i,a=n/t,r.push(i)),e.next=11,a;case 11:i=e.sent,e.next=7;break;case 14:case"end":return e.stop()}},e,this)});return r.generator=n(r.period),r.generator.next(),r.result=[],r.price.forEach(function(e){var t=r.generator.next(e);void 0!==t.value&&r.result.push(r.format(t.value))}),r}return ne(t,e),re(t,[{key:"nextValue",value:function(e){var t=this.generator.next(e).value;if(void 0!=t)return this.format(t)}}]),t}(ae));he.calculate=o;var le=function(e){function t(e){te(this,t);var r,n=oe(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e)),o=e.period,i=e.values,a=2/(o+1);n.result=[],r=new he({period:o,values:[]});var u=regeneratorRuntime.mark(function e(){var t,n;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return void(e.next=2);case 2:t=e.sent;case 3:if(!n||!t){e.next=11;break}return n=(t-n)*a+n,e.next=8,n;case 8:t=e.sent,e.next=19;break;case 11:return void(e.next=13);case 13:if(t=e.sent,!(n=r.nextValue(t))){e.next=19;break}return e.next=18,n;case 18:t=e.sent;case 19:e.next=3;break;case 21:case"end":return e.stop()}},e,this)});return n.generator=u(),n.generator.next(),n.generator.next(),i.forEach(function(e){var t=n.generator.next(e);void 0!=t.value&&n.result.push(n.format(t.value))}),n}return ne(t,e),re(t,[{key:"nextValue",value:function(e){var t=this.generator.next(e).value;if(void 0!=t)return this.format(t)}}]),t}(ae);le.calculate=i;var ce=function(e){function t(e){te(this,t);var r=oe(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e)),n=e.period,o=e.values;return r.result=[],r.generator=regeneratorRuntime.mark(function e(){var t,r,o,i,a;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:t=new se,r=n*(n+1)/2;case 2:if(!(t.length<n)){e.next=11;break}return e.t0=t,void(e.next=7);case 7:e.t1=e.sent,e.t0.push.call(e.t0,e.t1),e.next=19;break;case 11:for(t.resetCursor(),o=0,i=1;i<=n;i++)o+=t.next()*i/r;return e.next=16,o;case 16:a=e.sent,t.shift(),t.push(a);case 19:e.next=2;break;case 21:case"end":return e.stop()}},e,this)})(),r.generator.next(),o.forEach(function(e,t){var n=r.generator.next(e);void 0!=n.value&&r.result.push(r.format(n.value))}),r}return ne(t,e),re(t,[{key:"nextValue",value:function(e){var t=this.generator.next(e).value;if(void 0!=t)return this.format(t)}}]),t}(ae);ce.calculate=a;var ve=function(e){function t(e){te(this,t);var r,n=oe(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e)),o=e.period,i=e.values,a=1/o;n.result=[],r=new he({period:o,values:[]});var u=regeneratorRuntime.mark(function e(){var t,n;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return void(e.next=2);case 2:t=e.sent;case 3:if(!n||void 0==t){e.next=11;break}return n=(t-n)*a+n,e.next=8,n;case 8:t=e.sent,e.next=19;break;case 11:return void(e.next=13);case 13:if(t=e.sent,!(n=r.nextValue(t))){e.next=19;break}return e.next=18,n;case 18:t=e.sent;case 19:e.next=3;break;case 21:case"end":return e.stop()}},e,this)});return n.generator=u(),n.generator.next(),n.generator.next(),i.forEach(function(e){var t=n.generator.next(e);void 0!=t.value&&n.result.push(n.format(t.value))}),n}return ne(t,e),re(t,[{key:"nextValue",value:function(e){var t=this.generator.next(e).value;if(void 0!=t)return this.format(t)}}]),t}(ae);ve.calculate=u;var pe=(function(e){function t(e,r){te(this,t);var n=oe(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return n.period=e,n.values=r,n.SimpleMAOscillator=!0,n.SimpleMASignal=!0,n}ne(t,e)}(ie),function(e){function t(e){te(this,t);var r=oe(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e)),n=e.SimpleMAOscillator?he:le,o=e.SimpleMASignal?he:le,i=new n({period:e.fastPeriod,values:[],format:function(e){return e}}),a=new n({period:e.slowPeriod,values:[],format:function(e){return e}}),u=new o({period:e.signalPeriod,values:[],format:function(e){return e}}),s=r.format;return r.result=[],r.generator=regeneratorRuntime.mark(function t(){var r,n,o,h,l,c,v;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:r=0;case 1:if(!(r<e.slowPeriod)){t.next=10;break}return void(t.next=5);case 5:return n=t.sent,c=i.nextValue(n),v=a.nextValue(n),r++,t.abrupt("continue",1);case 10:return c&&v&&(o=c-v,h=u.nextValue(o)),l=o-h,t.next=14,{MACD:s(o),signal:h?s(h):void 0,histogram:isNaN(l)?void 0:s(l)};case 14:n=t.sent,c=i.nextValue(n),v=a.nextValue(n),t.next=1;break;case 19:case"end":return t.stop()}},t,this)})(),r.generator.next(),e.values.forEach(function(e){var t=r.generator.next(e);void 0!=t.value&&r.result.push(t.value)}),r}return ne(t,e),re(t,[{key:"nextValue",value:function(e){return this.generator.next(e).value}}]),t}(ae));pe.calculate=s;var fe=(function(e){function t(){return te(this,t),oe(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}ne(t,e)}(ie),function(e){function t(e){te(this,t);var r=oe(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e)),n=e.values,o=e.period,i=r.format;return r.generator=regeneratorRuntime.mark(function e(t){var r,n,o,a,u,s;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return void(e.next=2);case 2:r=e.sent,n=1,o=0;case 5:return u=s?r-s:0,u=u||0,u>0&&(o+=u),n<t+1?n++:a=a?(a*(t-1)+(u>0?u:0))/t:o/t,s=r,a=a?i(a):void 0,e.next=14,a;case 14:r=e.sent,e.next=5;break;case 17:case"end":return e.stop()}},e,this)})(o),r.generator.next(),r.result=[],n.forEach(function(e){var t=r.generator.next(e);void 0!==t.value&&r.result.push(t.value)}),r}return ne(t,e),re(t,[{key:"nextValue",value:function(e){return this.generator.next(e).value}}]),t}(ae));fe.calculate=h;var ge=(function(e){function t(){return te(this,t),oe(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}ne(t,e)}(ie),function(e){function t(e){te(this,t);var r=oe(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e)),n=e.values,o=e.period,i=r.format;return r.generator=regeneratorRuntime.mark(function e(t){var r,n,o,a,u,s;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return void(e.next=2);case 2:r=e.sent,n=1,o=0;case 5:return u=s?s-r:0,u=u||0,u>0&&(o+=u),n<t+1?n++:a=a?(a*(t-1)+(u>0?u:0))/t:o/t,s=r,a=a?i(a):void 0,e.next=14,a;case 14:r=e.sent,e.next=5;break;case 17:case"end":return e.stop()}},e,this)})(o),r.generator.next(),r.result=[],n.forEach(function(e){var t=r.generator.next(e);void 0!==t.value&&r.result.push(t.value)}),r}return ne(t,e),re(t,[{key:"nextValue",value:function(e){return this.generator.next(e).value}}]),t}(ae));ge.calculate=l;var de=(function(e){function t(){return te(this,t),oe(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}ne(t,e)}(ie),function(e){function t(e){te(this,t);var r=oe(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e)),n=e.period,o=e.values,i=new fe({period:n,values:[]}),a=new ge({period:n,values:[]});return r.generator=regeneratorRuntime.mark(function e(t){var r,n,o,u,s;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return void(e.next=2);case 2:r=e.sent;case 3:return n=i.nextValue(r),o=a.nextValue(r),n&&o&&(0===o?s=100:(u=n/o,s=parseFloat((100-100/(1+u)).toFixed(2)))),e.next=9,s;case 9:r=e.sent,e.next=3;break;case 12:case"end":return e.stop()}},e,this)})(n),r.generator.next(),r.result=[],o.forEach(function(e){var t=r.generator.next(e);void 0!==t.value&&r.result.push(t.value)}),r}return ne(t,e),re(t,[{key:"nextValue",value:function(e){return this.generator.next(e).value}}]),t}(ae));de.calculate=c;var _e=function(e){function t(e,r,n){te(this,t);var o=oe(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));if(o.size=e,o.maintainHigh=r,o.maintainLow=n,o.periodHigh=0,o.periodLow=1/0,!e||"number"!=typeof e)throw"Size required and should be a number.";return o._push=o.push,o.push=function(e){this.add(e)},o}return ne(t,e),re(t,[{key:"add",value:function(e){this.length===this.size?(this.lastShift=this.shift(),this._push(e),this.maintainHigh&&this.lastShift==this.periodHigh&&this.calculatePeriodHigh(),this.maintainLow&&this.lastShift==this.periodLow&&this.calculatePeriodLow()):this._push(e),this.maintainHigh&&this.periodHigh<=e&&(this.periodHigh=e),this.maintainLow&&this.periodLow>=e&&(this.periodLow=e)}},{key:"iterator",value:regeneratorRuntime.mark(function e(){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:this.resetCursor();case 1:if(!this.next()){e.next=6;break}return e.next=4,this.current;case 4:e.next=1;break;case 6:case"end":return e.stop()}},e,this)})},{key:"calculatePeriodHigh",value:function(){for(this.resetCursor(),this.next()&&(this.periodHigh=this.current);this.next();)this.periodHigh<=this.current&&(this.periodHigh=this.current)}},{key:"calculatePeriodLow",value:function(){for(this.resetCursor(),this.next()&&(this.periodLow=this.current);this.next();)this.periodLow>=this.current&&(this.periodLow=this.current)}}]),t}(se),we=(function(e){function t(){return te(this,t),oe(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}ne(t,e)}(ie),function(e){function t(e){te(this,t);var r=oe(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e)),n=e.period,o=e.values,i=new he({period:n,values:[],format:function(e){return e}});return r.result=[],r.generator=regeneratorRuntime.mark(function e(){var t,r,o,a,u,s,h,l,c,v,p;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return o=new _e(n),void(e.next=4);case 4:t=e.sent;case 5:if(o.push(t),!(r=i.nextValue(t))){e.next=30;break}for(u=0,s=!0,h=!1,l=void 0,e.prev=13,c=o.iterator()[Symbol.iterator]();!(s=(v=c.next()).done);s=!0)p=v.value,u+=Math.pow(p-r,2);e.next=21;break;case 17:e.prev=17,e.t0=e.catch(13),h=!0,l=e.t0;case 21:e.prev=21,e.prev=22,!s&&c.return&&c.return();case 24:if(e.prev=24,!h){e.next=27;break}throw l;case 27:return e.finish(24);case 28:return e.finish(21);case 29:a=Math.sqrt(u/n);case 30:return e.next=32,a;case 32:t=e.sent,e.next=5;break;case 35:case"end":return e.stop()}},e,this,[[13,17,21,29],[22,,24,28]])})(),r.generator.next(),o.forEach(function(e){var t=r.generator.next(e);void 0!=t.value&&r.result.push(r.format(t.value))}),r}return ne(t,e),re(t,[{key:"nextValue",value:function(e){var t=this.generator.next(e);if(void 0!=t.value)return this.format(t.value)}}]),t}(ae));we.calculate=v;var xe=(function(e){function t(){return te(this,t),oe(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}ne(t,e)}(ie),function(e){function t(){return te(this,t),oe(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}ne(t,e)}(ie),function(e){function t(e){te(this,t);var r,n,o=oe(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e)),i=e.period,a=e.values,u=e.stdDev,s=o.format;return o.result=[],r=new he({period:i,values:[],format:function(e){return e}}),n=new we({period:i,values:[],format:function(e){return e}}),o.generator=regeneratorRuntime.mark(function e(){var t,o,i,a,h,l,c,v;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return void(e.next=2);case 2:o=e.sent;case 3:return i=r.nextValue(o),a=n.nextValue(o),i&&(h=s(i),l=s(i+a*u),c=s(i-a*u),v=s((o-c)/(l-c)),t={middle:h,upper:l,lower:c,pb:v}),e.next=9,t;case 9:o=e.sent,e.next=3;break;case 12:case"end":return e.stop()}},e,this)})(),o.generator.next(),a.forEach(function(e){var t=o.generator.next(e);void 0!=t.value&&o.result.push(t.value)}),o}return ne(t,e),re(t,[{key:"nextValue",value:function(e){return this.generator.next(e).value}}]),t}(ae));xe.calculate=p;var me=function(e){function t(e){te(this,t);var r=oe(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));r.period=e.period,r.price=e.values;var n=regeneratorRuntime.mark(function e(t){var r,n,o,i,a;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return r=new se,n=0,o=1,void(e.next=5);case 5:i=e.sent;case 6:return o<t?(o++,n+=i):o==t?(o++,n+=i,a=n):a=a-a/t+i,e.next=10,a;case 10:i=e.sent,e.next=6;break;case 13:case"end":return e.stop()}},e,this)});return r.generator=n(r.period),r.generator.next(),r.result=[],r.price.forEach(function(e){var t=r.generator.next(e);void 0!=t.value&&r.result.push(r.format(t.value))}),r}return ne(t,e),re(t,[{key:"nextValue",value:function(e){var t=this.generator.next(e).value;if(void 0!=t)return this.format(t)}}]),t}(ae);me.calculate=f;var be=(function(e){function t(){return te(this,t),oe(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}ne(t,e)}(ie),function(e){function t(e){te(this,t);var r=oe(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e)),n=e.low,o=e.high,i=r.format;if(n.length!=o.length)throw"Inputs(low,high) not of equal size";return r.result=[],r.generator=regeneratorRuntime.mark(function e(){var t,r,n,o,a;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return void(e.next=2);case 2:r=e.sent;case 3:return n&&(o=r.high-n.high,a=n.low-r.low,t=i(a>o&&a>0?a:0)),n=r,e.next=8,t;case 8:r=e.sent,e.next=3;break;case 11:case"end":return e.stop()}},e,this)})(),r.generator.next(),n.forEach(function(e,t){var i=r.generator.next({high:o[t],low:n[t]});void 0!==i.value&&r.result.push(i.value)}),r}return ne(t,e),re(t,[{key:"nextValue",value:function(e){return this.generator.next(e).value}}],[{key:"calculate",value:function(e){ae.reverseInputs(e);var r=new t(e).result;return e.reversedInput&&r.reverse(),ae.reverseInputs(e),r}}]),t}(ae)),ye=(function(e){function t(){return te(this,t),oe(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}ne(t,e)}(ie),function(e){function t(e){te(this,t);var r=oe(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e)),n=e.low,o=e.high,i=r.format;if(n.length!=o.length)throw"Inputs(low,high) not of equal size";return r.result=[],r.generator=regeneratorRuntime.mark(function e(){var t,r,n,o,a;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return void(e.next=2);case 2:r=e.sent;case 3:return n&&(o=r.high-n.high,a=n.low-r.low,t=i(o>a&&o>0?o:0)),n=r,e.next=8,t;case 8:r=e.sent,e.next=3;break;case 11:case"end":return e.stop()}},e,this)})(),r.generator.next(),n.forEach(function(e,t){var i=r.generator.next({high:o[t],low:n[t]});void 0!==i.value&&r.result.push(i.value)}),r}return ne(t,e),re(t,[{key:"nextValue",value:function(e){return this.generator.next(e).value}}],[{key:"calculate",value:function(e){ae.reverseInputs(e);var r=new t(e).result;return e.reversedInput&&r.reverse(),ae.reverseInputs(e),r}}]),t}(ae)),ke=(function(e){function t(){return te(this,t),oe(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}ne(t,e)}(ie),function(e){function t(e){te(this,t);var r=oe(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e)),n=e.low,o=e.high,i=e.close,a=r.format;if(n.length!=o.length)throw"Inputs(low,high) not of equal size";return r.result=[],r.generator=regeneratorRuntime.mark(function e(){var t,r,n;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return void(e.next=2);case 2:t=e.sent;case 3:if(void 0!==r){e.next=9;break}return r=t.close,e.next=8,n;case 8:t=e.sent;case 9:return n=Math.max(t.high-t.low,isNaN(Math.abs(t.high-r))?0:Math.abs(t.high-r),isNaN(Math.abs(t.low-r))?0:Math.abs(t.low-r)),r=t.close,void 0!=n&&(n=a(n)),e.next=14,n;case 14:t=e.sent,e.next=3;break;case 17:case"end":return e.stop()}},e,this)})(),r.generator.next(),n.forEach(function(e,t){var a=r.generator.next({high:o[t],low:n[t],close:i[t]});void 0!=a.value&&r.result.push(a.value)}),r}return ne(t,e),re(t,[{key:"nextValue",value:function(e){return this.generator.next(e).value}}]),t}(ae));ke.calculate=g;var Oe=(function(e){function t(){return te(this,t),oe(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}ne(t,e)}(ie),function(e){function t(){return te(this,t),oe(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}ne(t,e)}(ie),function(e){function t(e){te(this,t);var r=oe(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e)),n=e.low,o=e.high,i=e.close,a=e.period,u=r.format,s=new ye({high:[],low:[]}),h=new be({high:[],low:[]}),l=new me({period:a,values:[],format:function(e){return e}}),c=new me({period:a,values:[],format:function(e){return e}}),v=new me({period:a,values:[],format:function(e){return e}}),p=new ve({period:a,values:[],format:function(e){return e}}),f=new ke({low:[],high:[],close:[]});if(n.length!==o.length||o.length!==i.length)throw"Inputs(low,high, close) not of equal size";return r.result=[],r.generator=regeneratorRuntime.mark(function e(){var t,r,n,o,i,a,u,g,d,_,w,x,m,b,y,k,O;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return void(e.next=2);case 2:t=e.sent,r=0,n=0,o=0,i=0;case 7:if(_=f.nextValue(t),w=s.nextValue(t),x=h.nextValue(t),void 0!==_){e.next=16;break}return void(e.next=14);case 14:return t=e.sent,e.abrupt("continue",7);case 16:return m=v.nextValue(_),b=l.nextValue(w),y=c.nextValue(x),void 0!=m&&void 0!=b&&void 0!=y&&(a=100*b/m,u=100*y/m,k=Math.abs(a-u),O=a+u,g=k/O*100,d=p.nextValue(g)),e.next=22,{adx:d,pdi:a,mdi:u};case 22:t=e.sent,e.next=7;break;case 25:case"end":return e.stop()}},e,this)})(),r.generator.next(),n.forEach(function(e,t){var a=r.generator.next({high:o[t],low:n[t],close:i[t]});void 0!=a.value&&void 0!=a.value.adx&&r.result.push({adx:u(a.value.adx),pdi:u(a.value.pdi),mdi:u(a.value.mdi)})}),r}return ne(t,e),re(t,[{key:"nextValue",value:function(e){var t=this.generator.next(e).value;if(void 0!=t&&void 0!=t.adx)return{adx:this.format(t.adx),pdi:this.format(t.pdi),mdi:this.format(t.mdi)}}}]),t}(ae));Oe.calculate=d;var Pe=(function(e){function t(){return te(this,t),oe(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}ne(t,e)}(ie),function(e){function t(e){te(this,t);var r=oe(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e)),n=e.low,o=e.high,i=e.close,a=e.period,u=r.format;if(n.length!==o.length||o.length!==i.length)throw"Inputs(low,high, close) not of equal size";var s=new ke({low:[],high:[],close:[]}),h=new ve({period:a,values:[],format:function(e){return e}});return r.result=[],r.generator=regeneratorRuntime.mark(function e(){var t,r,n;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return void(e.next=2);case 2:t=e.sent;case 4:return n=s.nextValue({low:t.low,high:t.high,close:t.close}),r=void 0===n?void 0:h.nextValue(n),e.next=9,r;case 9:t=e.sent,e.next=4;break;case 12:case"end":return e.stop()}},e,this)})(),r.generator.next(),n.forEach(function(e,t){var a=r.generator.next({high:o[t],low:n[t],close:i[t]});void 0!==a.value&&r.result.push(u(a.value))}),r}return ne(t,e),re(t,[{key:"nextValue",value:function(e){return this.generator.next(e).value}}]),t}(ae));Pe.calculate=_;var je=(function(e){function t(){return te(this,t),oe(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}ne(t,e)}(ie),function(e){function t(e){te(this,t);var r=oe(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e)),n=e.period,o=e.values;return r.result=[],r.generator=regeneratorRuntime.mark(function e(){var t,r,o,i;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return t=1,r=new _e(n),void(e.next=5);case 5:o=e.sent;case 6:return r.push(o),t<n?t++:i=(o-r.lastShift)/r.lastShift*100,e.next=11,i;case 11:o=e.sent,e.next=6;break;case 14:case"end":return e.stop()}},e,this)})(),r.generator.next(),o.forEach(function(e){var t=r.generator.next(e);void 0==t.value||isNaN(t.value)||r.result.push(r.format(t.value))}),r}return ne(t,e),re(t,[{key:"nextValue",value:function(e){var t=this.generator.next(e);if(void 0!=t.value&&!isNaN(t.value))return this.format(t.value)}}]),t}(ae));je.calculate=w;var Ie=(function(e){function t(){return te(this,t),oe(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}ne(t,e)}(ie),function(e){function t(e){te(this,t);var r=oe(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e)),n=e.values,o=e.ROCPer1,i=e.ROCPer2,a=e.ROCPer3,u=e.ROCPer4,s=e.SMAROCPer1,h=e.SMAROCPer2,l=e.SMAROCPer3,c=e.SMAROCPer4,v=e.signalPeriod,p=new je({period:o,values:[]}),f=new je({period:i,values:[]}),g=new je({period:a,values:[]}),d=new je({period:u,values:[]}),_=new he({period:s,values:[],format:function(e){return e}}),w=new he({period:h,values:[],format:function(e){return e}}),x=new he({period:l,values:[],format:function(e){return e}}),m=new he({period:c,values:[],format:function(e){return e}}),b=new he({period:v,values:[],format:function(e){return e}}),y=r.format;r.result=[];var k=Math.max(o+s,i+h,a+l,u+c);return r.generator=regeneratorRuntime.mark(function e(){var t,r,n,o,i,a,u,s,h,l,c,v,O;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return t=1,void(e.next=3);case 3:r=e.sent,n=void 0,o=void 0,i=void 0,a=void 0,u=void 0,s=void 0,h=void 0;case 6:return l=p.nextValue(r),c=f.nextValue(r),v=g.nextValue(r),O=d.nextValue(r),o=void 0!==l?_.nextValue(l):void 0,i=void 0!==c?w.nextValue(c):void 0,a=void 0!==v?x.nextValue(v):void 0,u=void 0!==O?m.nextValue(O):void 0,t<k?t++:n=1*o+2*i+3*a+4*u,s=void 0!==n?b.nextValue(n):void 0,h=void 0!==n?{kst:y(n),signal:s?y(s):void 0}:void 0,e.next=20,h;case 20:r=e.sent,e.next=6;break;case 23:case"end":return e.stop()}},e,this)})(),r.generator.next(),n.forEach(function(e){var t=r.generator.next(e);void 0!=t.value&&r.result.push(t.value)}),r}return ne(t,e),re(t,[{key:"nextValue",value:function(e){var t=this.generator.next(e);if(void 0!=t.value)return t.value}}]),t}(ae));Ie.calculate=x;var Re=(function(e){function t(){return te(this,t),oe(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}ne(t,e)}(ie),function(e){function t(e){te(this,t);var r=oe(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e)),n=e.low,o=e.high,i=e.close,a=e.period,u=e.signalPeriod,s=r.format;if(n.length!==o.length||o.length!==i.length)throw"Inputs(low,high, close) not of equal size";return r.result=[],r.generator=regeneratorRuntime.mark(function e(){var t,r,n,o,i,h,l,c;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return t=1,r=new _e(a,!0,!1),n=new _e(a,!1,!0),o=new he({period:u,values:[],format:function(e){return e}}),i=void 0,h=void 0,void(e.next=7);case 7:l=e.sent;case 8:if(r.push(l.high),n.push(l.low),!(t<a)){e.next=17;break}return t++,void(e.next=15);case 15:return l=e.sent,e.abrupt("continue",8);case 17:return c=n.periodLow,i=(l.close-c)/(r.periodHigh-c)*100,h=o.nextValue(i),e.next=22,{k:s(i),d:h?s(h):void 0};case 22:l=e.sent,e.next=8;break;case 25:case"end":return e.stop()}},e,this)})(),r.generator.next(),n.forEach(function(e,t){var a=r.generator.next({high:o[t],low:n[t],close:i[t]});void 0!==a.value&&r.result.push(a.value)}),r}return ne(t,e),re(t,[{key:"nextValue",value:function(e){var t=this.generator.next(e);if(void 0!==t.value)return t.value}}]),t
}(ae));Re.calculate=m;var Ve=(function(e){function t(){return te(this,t),oe(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}ne(t,e)}(ie),function(e){function t(e){te(this,t);var r=oe(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e)),n=e.low,o=e.high,i=e.close,a=e.period,u=r.format;if(n.length!==o.length||o.length!==i.length)throw"Inputs(low,high, close) not of equal size";return r.result=[],r.generator=regeneratorRuntime.mark(function e(){var t,r,n,o,i,s,h;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return t=1,r=new _e(a,!0,!1),n=new _e(a,!1,!0),o=void 0,i=void 0,void(e.next=7);case 7:s=e.sent,h=void 0;case 9:if(r.push(s.high),n.push(s.low),!(t<a)){e.next=18;break}return t++,void(e.next=16);case 16:return s=e.sent,e.abrupt("continue",9);case 18:return o=n.periodLow,i=r.periodHigh,h=u((i-s.close)/(i-o)*-100),e.next=23,h;case 23:s=e.sent,e.next=9;break;case 26:case"end":return e.stop()}},e,this)})(),r.generator.next(),n.forEach(function(e,t){var a=r.generator.next({high:o[t],low:n[t],close:i[t]});void 0!==a.value&&r.result.push(a.value)}),r}return ne(t,e),re(t,[{key:"nextValue",value:function(e){var t=this.generator.next(e);if(void 0!=t.value)return this.format(t.value)}}]),t}(ae));Ve.calculate=b;var Ce=(function(e){function t(){return te(this,t),oe(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}ne(t,e)}(ie),function(e){function t(e){te(this,t);var r=oe(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e)),n=e.high,o=e.low,i=e.close,a=e.volume;if(o.length!==n.length||n.length!==i.length||n.length!==a.length)throw"Inputs(low,high, close, volumes) not of equal size";return r.result=[],r.generator=regeneratorRuntime.mark(function e(){var t,r,n,o;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return t=0,void(e.next=3);case 3:r=e.sent;case 4:return n=(r.close-r.low-(r.high-r.close))/(r.high-r.low),o=n*r.volume,t+=o,e.next=10,Math.round(t);case 10:r=e.sent,e.next=4;break;case 13:case"end":return e.stop()}},e,this)})(),r.generator.next(),n.forEach(function(e,t){var n={high:e,low:o[t],close:i[t],volume:a[t]},u=r.generator.next(n);void 0!=u.value&&r.result.push(u.value)}),r}return ne(t,e),re(t,[{key:"nextValue",value:function(e){return this.generator.next(e).value}}]),t}(ae));Ce.calculate=y;var qe=(function(e){function t(){return te(this,t),oe(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}ne(t,e)}(ie),function(e){function t(e){te(this,t);var r=oe(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e)),n=e.close,o=e.volume;return r.result=[],r.generator=regeneratorRuntime.mark(function e(){var t,r,n;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return t=0,void(e.next=3);case 3:if(r=e.sent,!r.close||"number"!=typeof r.close){e.next=9;break}return n=r.close,void(e.next=8);case 8:r=e.sent;case 9:return n<r.close?t+=r.volume:r.close<n&&(t-=r.volume),n=r.close,e.next=14,t;case 14:r=e.sent,e.next=9;break;case 17:case"end":return e.stop()}},e,this)})(),r.generator.next(),n.forEach(function(e,t){var i={close:n[t],volume:o[t]},a=r.generator.next(i);void 0!=a.value&&r.result.push(a.value)}),r}return ne(t,e),re(t,[{key:"nextValue",value:function(e){return this.generator.next(e).value}}]),t}(ae));qe.calculate=k;var Ee=(function(e){function t(){return te(this,t),oe(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}ne(t,e)}(ie),function(e){function t(e){te(this,t);var r=oe(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e)),n=e.values,o=e.period,i=r.format,a=new le({period:o,values:[],format:function(e){return e}}),u=new le({period:o,values:[],format:function(e){return e}}),s=new le({period:o,values:[],format:function(e){return e}}),h=new je({period:1,values:[],format:function(e){return e}});return r.result=[],r.generator=regeneratorRuntime.mark(function e(){var t,r,n,o,l;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return void(e.next=2);case 2:t=e.sent;case 3:return r=a.nextValue(t),n=r?u.nextValue(r):void 0,o=n?s.nextValue(n):void 0,l=o?h.nextValue(o):void 0,e.next=10,l?i(l):void 0;case 10:t=e.sent,e.next=3;break;case 13:case"end":return e.stop()}},e,this)})(),r.generator.next(),n.forEach(function(e){var t=r.generator.next(e);void 0!==t.value&&r.result.push(t.value)}),r}return ne(t,e),re(t,[{key:"nextValue",value:function(e){var t=this.generator.next(e);if(void 0!==t.value)return t.value}}]),t}(ae));Ee.calculate=O;var Me=function e(){te(this,e),this.open=[],this.high=[],this.low=[],this.close=[],this.volume=[],this.timestamp=[]},Se=(function(e){function t(){return te(this,t),oe(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}ne(t,e)}(ie),function(e){function t(e){te(this,t);var r=oe(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e)),n=(r.format,e.useATR),o=e.brickSize||0;if(n){var i=_(Object.assign({},e));o=i[i.length-1]}if(r.result=new Me,0===o)return console.error("Not enough data to calculate brickSize for renko when using ATR"),oe(r);var a=0,u=0,s=1/0,h=0,l=0,c=0;return r.generator=regeneratorRuntime.mark(function e(){var t,r;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return void(e.next=2);case 2:t=e.sent;case 3:if(0!==a){e.next=15;break}return a=t.close,u=t.high,s=t.low,h=t.close,l=t.volume,c=t.timestamp,void(e.next=13);case 13:return t=e.sent,e.abrupt("continue",3);case 15:if(!(Math.abs(t.close-a)>=o)){e.next=22;break}return r={open:a,high:u>t.high?u:t.high,low:s<t.Low?s:t.low,close:a>t.close?a-o:a+o,volume:l+t.volume,timestamp:t.timestamp},e.next=19,r;case 19:t=e.sent,e.next=30;break;case 22:return u=t.high,s=t.low,h=t.close,l+=t.volume,c=t.timestamp,void(e.next=29);case 29:t=e.sent;case 30:e.next=3;break;case 32:case"end":return e.stop()}},e,this)})(),r.generator.next(),e.low.forEach(function(t,n){var o=r.generator.next({open:e.open[n],high:e.high[n],low:e.low[n],close:e.close[n],volume:e.volume[n],timestamp:e.timestamp[n]});o.value&&(r.result.open.push(o.value.open),r.result.high.push(o.value.high),r.result.low.push(o.value.low),r.result.close.push(o.value.close),r.result.volume.push(o.value.volume),r.result.timestamp.push(o.value.timestamp))}),r}return ne(t,e),re(t,[{key:"nextValue",value:function(e){return console.error("Cannot calculate next value on Renko, Every value has to be recomputed for every change, use calcualte method"),null}}]),t}(ae));Se.calculate=P;var Ae=(function(e){function t(){return te(this,t),oe(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}ne(t,e)}(ie),function(e){function t(e){te(this,t);var r=oe(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));r.format;r.result=new Me;var n=null,o=0,i=1/0,a=0,u=0,s=0;return r.generator=regeneratorRuntime.mark(function e(){var t,r,h,l,c,v;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return void(e.next=2);case 2:t=e.sent,r=null;case 4:return null===n?(n=(t.close+t.open)/2,o=t.high,i=t.low,a=(t.close+t.open+t.high+t.low)/4,u=t.volume||0,s=t.timestamp||0,r={open:n,high:o,low:i,close:a,volume:t.volume||0,timestamp:t.timestamp||0}):(h=(t.close+t.open+t.high+t.low)/4,l=(n+a)/2,c=Math.max(l,h,t.high),v=Math.min(t.low,l,h),r={close:h,open:l,high:c,low:v,volume:t.volume||0,timestamp:t.timestamp||0},a=h,n=l,o=c,i=v),e.next=8,r;case 8:t=e.sent,e.next=4;break;case 11:case"end":return e.stop()}},e,this)})(),r.generator.next(),e.low.forEach(function(t,n){var o=r.generator.next({open:e.open[n],high:e.high[n],low:e.low[n],close:e.close[n],volume:e.volume?e.volume[n]:e.volume,timestamp:e.timestamp?e.timestamp[n]:e.timestamp});o.value&&(r.result.open.push(o.value.open),r.result.high.push(o.value.high),r.result.low.push(o.value.low),r.result.close.push(o.value.close),r.result.volume.push(o.value.volume),r.result.timestamp.push(o.value.timestamp))}),r}return ne(t,e),re(t,[{key:"nextValue",value:function(e){return this.generator.next(e).value}}]),t}(ae));Ae.calculate=j;var De=function(){function e(){te(this,e)}return re(e,[{key:"approximateEqual",value:function(e,t){return 1*parseFloat(Math.abs(e-t).toPrecision(4))<=1*parseFloat((.001*e).toPrecision(4))}},{key:"logic",value:function(e){throw"this has to be implemented"}},{key:"getAllPatternIndex",value:function(e){var t=this;if(e.close.length<this.requiredCount)return console.warn("Data count less than data required for the strategy ",this.name),[];e.reversedInput&&(e.open.reverse(),e.high.reverse(),e.low.reverse(),e.close.reverse());var r=this.logic;return this._generateDataForCandleStick(e).map(function(e,n){return r.call(t,e)?n:void 0}).filter(function(e){return e})}},{key:"hasPattern",value:function(e){return e.close.length<this.requiredCount?(console.warn("Data count less than data required for the strategy ",this.name),!1):(e.reversedInput&&(e.open.reverse(),e.high.reverse(),e.low.reverse(),e.close.reverse()),this.logic.call(this,this._getLastDataForCandleStick(e)))}},{key:"_getLastDataForCandleStick",value:function(e){var t=this.requiredCount;if(e.close.length===t)return e;for(var r={open:[],high:[],low:[],close:[]},n=0,o=e.close.length-t;n<t;)r.open.push(e.open[o+n]),r.high.push(e.high[o+n]),r.low.push(e.low[o+n]),r.close.push(e.close[o+n]),n++;return r}},{key:"_generateDataForCandleStick",value:function(e){var t=this.requiredCount;return e.close.map(function(r,n){for(var o=0,i={open:[],high:[],low:[],close:[]};o<t;)i.open.push(e.open[n+o]),i.high.push(e.high[n+o]),i.low.push(e.low[n+o]),i.close.push(e.close[n+o]),o++;return i}).filter(function(r,n){return n<=e.close.length-t})}}]),e}(),Le=function(e){function t(){te(this,t);var e=oe(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return e.name="MorningStar",e.requiredCount=3,e}return ne(t,e),re(t,[{key:"logic",value:function(e){var t=e.open[0],r=e.close[0],n=(e.high[0],e.low[0]),o=(e.open[1],e.close[1]),i=e.high[1],a=e.low[1],u=e.open[2],s=e.close[2],h=(e.high[2],e.low[2],(t+r)/2),l=r<t,c=n>a&&n>i,v=u<s,p=i<n&&a<n&&u>i&&o<u,f=s>h;return l&&c&&p&&v&&f}}]),t}(De),ze=function(e){function t(){te(this,t);var e=oe(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return e.name="BullishEngulfingPattern",e.requiredCount=2,e}return ne(t,e),re(t,[{key:"logic",value:function(e){var t=e.open[0],r=e.close[0],n=(e.high[0],e.low[0],e.open[1]),o=e.close[1];e.high[1],e.low[1];return r<t&&t>n&&r>n&&t<o}}]),t}(De),He=function(e){function t(){te(this,t);var e=oe(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return e.requiredCount=2,e.name="BullishHarami",e}return ne(t,e),re(t,[{key:"logic",value:function(e){var t=e.open[0],r=e.close[0],n=e.high[0],o=(e.low[0],e.open[1]),i=e.close[1],a=e.high[1],u=e.low[1];return t<o&&r>o&&r>i&&t<u&&n>a}}]),t}(De),Be=function(e){function t(){te(this,t);var e=oe(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return e.requiredCount=2,e.name="BullishHaramiCross",e}return ne(t,e),re(t,[{key:"logic",value:function(e){var t=e.open[0],r=e.close[0],n=e.high[0],o=(e.low[0],e.open[1]),i=e.close[1],a=e.high[1],u=e.low[1],s=t<o&&r>o&&r>i&&t<u&&n>a,h=this.approximateEqual(o,i);return s&&h}}]),t}(De),Te=function(e){function t(){te(this,t);var e=oe(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return e.name="Doji",e.requiredCount=1,e}return ne(t,e),re(t,[{key:"logic",value:function(e){var t=e.open[0],r=e.close[0];return this.approximateEqual(t,r)}}]),t}(De),Ne=function(e){function t(){te(this,t);var e=oe(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return e.name="MorningDojiStar",e.requiredCount=3,e}return ne(t,e),re(t,[{key:"logic",value:function(e){var t=e.open[0],r=e.close[0],n=(e.high[0],e.low[0]),o=e.open[1],i=e.close[1],a=e.high[1],u=e.low[1],s=e.open[2],h=e.close[2],l=(e.high[2],e.low[2],(t+r)/2),c=r<t,v=(new Te).hasPattern({open:[o],close:[i],high:[a],low:[u]}),p=s<h,f=a<n&&u<n&&s>a&&i<s,g=h>l;return c&&v&&p&&f&&g}}]),t}(De),Fe=function(e){function t(){te(this,t);var e=oe(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return e.requiredCount=3,e.name="DownsideTasukiGap",e}return ne(t,e),re(t,[{key:"logic",value:function(e){var t=e.open[0],r=e.close[0],n=(e.high[0],e.low[0]),o=e.open[1],i=e.close[1],a=e.high[1],u=(e.low[1],e.open[2]),s=e.close[2],h=(e.high[2],e.low[2],r<t),l=i<o,c=s>u,v=a<n,p=o>u&&i<u&&s>o&&s<r;return h&&l&&c&&v&&p}}]),t}(De),We=function(e){function t(){te(this,t);var e=oe(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return e.name="BullishMarubozu",e.requiredCount=1,e}return ne(t,e),re(t,[{key:"logic",value:function(e){var t=e.open[0],r=e.close[0],n=e.high[0],o=e.low[0];return this.approximateEqual(r,n)&&this.approximateEqual(o,t)&&t<r&&t<n}}]),t}(De),Ge=function(e){function t(){te(this,t);var e=oe(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return e.requiredCount=2,e.name="PiercingLine",e}return ne(t,e),re(t,[{key:"logic",value:function(e){var t=e.open[0],r=e.close[0],n=(e.high[0],e.low[0]),o=e.open[1],i=e.close[1],a=(e.high[1],e.low[1]),u=(t+r)/2,s=a<n,h=r<t,l=i>o,c=n>o&&i>u;return s&&h&&c&&l}}]),t}(De),Xe=function(e){function t(){te(this,t);var e=oe(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return e.name="ThreeWhiteSoldiers",e.requiredCount=3,e}return ne(t,e),re(t,[{key:"logic",value:function(e){var t=e.open[0],r=e.close[0],n=e.high[0],o=(e.low[0],e.open[1]),i=e.close[1],a=e.high[1],u=(e.low[1],e.open[2]),s=e.close[2],h=e.high[2],l=(e.low[2],a>n&&h>a),c=t<r&&o<i&&u<s,v=r>o&&o<n&&a>u&&u<i;return l&&c&&v}}]),t}(De),Ke=[new ze,new Fe,new He,new Be,new Ne,new Le,new We,new Ge,new Xe],Je=function(e){function t(){te(this,t);var e=oe(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return e.name="Bullish Candlesticks",e}return ne(t,e),re(t,[{key:"hasPattern",value:function(e){return Ke.reduce(function(t,r){var n=r.hasPattern(e);return n&&console.log("Matched pattern ",r.name),t||n},!1)}}]),t}(De),Qe=function(e){function t(){te(this,t);var e=oe(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return e.name="BearishEngulfingPattern",e.requiredCount=2,e}return ne(t,e),re(t,[{key:"logic",value:function(e){var t=e.open[0],r=e.close[0],n=(e.high[0],e.low[0],e.open[1]),o=e.close[1];e.high[1],e.low[1];return r>t&&t<n&&r<n&&t>o}}]),t}(De),Ue=function(e){function t(){te(this,t);var e=oe(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return e.requiredCount=2,e.name="BearishHarami",e}return ne(t,e),re(t,[{key:"logic",value:function(e){var t=e.open[0],r=e.close[0],n=e.high[0],o=(e.low[0],e.open[1]),i=e.close[1],a=e.high[1],u=e.low[1];return t>o&&r<o&&r<i&&t>u&&n>a}}]),t}(De),Ye=function(e){function t(){te(this,t);var e=oe(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return e.requiredCount=2,e.name="BearishHaramiCross",e}return ne(t,e),re(t,[{key:"logic",value:function(e){var t=e.open[0],r=e.close[0],n=e.high[0],o=(e.low[0],e.open[1]),i=e.close[1],a=e.high[1],u=e.low[1],s=t>o&&r<o&&r<i&&t>u&&n>a,h=this.approximateEqual(o,i);return s&&h}}]),t}(De),Ze=function(e){function t(){te(this,t);var e=oe(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return e.name="EveningDojiStar",e.requiredCount=3,e}return ne(t,e),re(t,[{key:"logic",value:function(e){var t=e.open[0],r=e.close[0],n=e.high[0],o=(e.low[0],e.open[1]),i=e.close[1],a=e.high[1],u=e.low[1],s=e.open[2],h=e.close[2],l=(e.high[2],e.low[2],(t+r)/2),c=r>t,v=(new Te).hasPattern({open:[o],close:[i],high:[a],low:[u]}),p=s>h,f=a>n&&u>n&&s<u&&i>s,g=h<l;return c&&v&&f&&p&&g}}]),t}(De),$e=function(e){function t(){te(this,t);var e=oe(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return e.name="EveningStar",e.requiredCount=3,e}return ne(t,e),re(t,[{key:"logic",value:function(e){var t=e.open[0],r=e.close[0],n=e.high[0],o=(e.low[0],e.open[1],e.close[1]),i=e.high[1],a=e.low[1],u=e.open[2],s=e.close[2],h=(e.high[2],e.low[2],(t+r)/2),l=r>t,c=n<a&&n<i,v=u>s,p=i>n&&a>n&&u<a&&o>u,f=s<h;return l&&c&&p&&v&&f}}]),t}(De),et=function(e){function t(){te(this,t);var e=oe(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return e.name="BearishMarubozu",e.requiredCount=1,e}return ne(t,e),re(t,[{key:"logic",value:function(e){var t=e.open[0],r=e.close[0],n=e.high[0],o=e.low[0];return this.approximateEqual(t,n)&&this.approximateEqual(o,r)&&t>r&&t>o}}]),t}(De),tt=function(e){function t(){te(this,t);var e=oe(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return e.name="ThreeBlackCrows",e.requiredCount=3,e}return ne(t,e),re(t,[{key:"logic",value:function(e){var t=e.open[0],r=e.close[0],n=(e.high[0],e.low[0]),o=e.open[1],i=e.close[1],a=(e.high[1],e.low[1]),u=e.open[2],s=e.close[2],h=(e.high[2],e.low[2]),l=n>a&&a>h,c=t>r&&o>i&&u>s,v=t>o&&o>r&&o>u&&u>i;return l&&c&&v}}]),t}(De),rt=[new Qe,new Ue,new Ye,new Ze,new $e,new et,new tt],nt=function(e){function t(){te(this,t);var e=oe(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return e.name="Bearish Candlesticks",e}return ne(t,e),re(t,[{key:"hasPattern",value:function(e){return rt.reduce(function(t,r){return t||r.hasPattern(e)},!1)}}]),t}(De),ot=function(e){function t(){te(this,t);var e=oe(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return e.name="AbandonedBaby",e.requiredCount=3,e}return ne(t,e),re(t,[{key:"logic",value:function(e){var t=e.open[0],r=e.close[0],n=(e.high[0],e.low[0]),o=e.open[1],i=e.close[1],a=e.high[1],u=e.low[1],s=e.open[2],h=e.close[2],l=e.high[2],c=e.low[2],v=r<t,p=(new Te).hasPattern({open:[o],close:[i],high:[a],low:[u]}),f=a<n&&c>a&&h>s,g=l<t;return v&&p&&f&&g}}]),t}(De),it=function(e){function t(){te(this,t);var e=oe(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return e.name="DarkCloudCover",e.requiredCount=2,e}return ne(t,e),re(t,[{key:"logic",value:function(e){var t=e.open[0],r=e.close[0],n=e.high[0],o=(e.low[0],e.open[1]),i=e.close[1],a=(e.high[1],e.low[1],(r+t)/2),u=r>t,s=i<o,h=o>n&&i<a&&i>t;return u&&s&&h}}]),t}(De),at=function(e){function t(){te(this,t);var e=oe(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return e.requiredCount=1,e.name="DragonFlyDoji",e}return ne(t,e),re(t,[{key:"logic",value:function(e){var t=e.open[0],r=e.close[0],n=e.high[0],o=this.approximateEqual(t,r),i=this.approximateEqual(t,n);return o&&i}}]),t}(De),ut=function(e){function t(){te(this,t);var e=oe(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return e.requiredCount=1,e.name="GraveStoneDoji",e}return ne(t,e),re(t,[{key:"logic",value:function(e){var t=e.open[0],r=e.close[0],n=e.low[0],o=this.approximateEqual(t,r),i=this.approximateEqual(t,n);return o&&i}}]),t}(De),st=function(e){function t(){te(this,t);var e=oe(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return e.name="BullishSpinningTop",e.requiredCount=1,e}return ne(t,e),re(t,[{key:"logic",value:function(e){var t=e.open[0],r=e.close[0],n=e.high[0],o=e.low[0],i=Math.abs(r-t),a=Math.abs(n-r),u=Math.abs(t-o);return i<a&&i<u}}]),t}(De),ht=function(e){function t(){te(this,t);var e=oe(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return e.name="BearishSpinningTop",e.requiredCount=1,e}return ne(t,e),re(t,[{key:"logic",value:function(e){var t=e.open[0],r=e.close[0],n=e.high[0],o=e.low[0],i=Math.abs(r-t),a=Math.abs(n-t),u=Math.abs(n-o);return i<a&&i<u}}]),t}(De);e.getAvailableIndicators=$,e.sma=o,e.SMA=he,e.ema=i,e.EMA=le,e.wma=a,e.WMA=ce,e.wema=u,e.WEMA=ve,e.macd=s,e.MACD=pe,e.rsi=c,e.RSI=de,e.bollingerbands=p,e.BollingerBands=xe,e.adx=d,e.ADX=Oe,e.atr=_,e.ATR=Pe,e.truerange=g,e.TrueRange=ke,e.roc=w,e.ROC=je,e.kst=x,e.KST=Ie,e.stochastic=m,e.Stochastic=Re,e.williamsr=b,e.WilliamsR=Ve,e.adl=y,e.ADL=Ce,e.obv=k,e.OBV=qe,e.trix=O,e.TRIX=Ee,e.averagegain=h,e.AverageGain=fe,e.averageloss=l,e.AverageLoss=ge,e.sd=v,e.SD=we,e.renko=P,e.HeikinAshi=Ae,e.heikinashi=j,e.bullish=L,e.bearish=G,e.abandonedbaby=X,e.doji=q,e.bearishengulfingpattern=z,e.bullishengulfingpattern=R,e.darkcloudcover=K,e.downsidetasukigap=M,e.dragonflydoji=J,e.gravestonedoji=Q,e.bullishharami=V,e.bearishharami=H,e.bullishharamicross=C,e.bearishharamicross=B,e.eveningdojistar=T,e.eveningstar=N,e.morningdojistar=E,e.morningstar=I,e.bullishmarubozu=S,e.bearishmarubozu=F,e.piercingline=A,e.bullishspinningtop=U,e.bearishspinningtop=Y,e.threeblackcrows=W,e.threewhitesoldiers=D,e.fibonacciretracement=Z,e.setConfig=t,e.getConfig=r}(this.window=this.window||{});
!function(e){"use strict";function t(e,t){ee[e]=t}function r(e){return ee[e]}function n(e){var t=r("precision");return t?parseFloat(e.toPrecision(t)):e}function o(e){ae.reverseInputs(e);var t=new he(e).result;return e.reversedInput&&t.reverse(),ae.reverseInputs(e),t}function i(e){ae.reverseInputs(e);var t=new le(e).result;return e.reversedInput&&t.reverse(),ae.reverseInputs(e),t}function a(e){ae.reverseInputs(e);var t=new ce(e).result;return e.reversedInput&&t.reverse(),ae.reverseInputs(e),t}function u(e){ae.reverseInputs(e);var t=new ve(e).result;return e.reversedInput&&t.reverse(),ae.reverseInputs(e),t}function s(e){ae.reverseInputs(e);var t=new pe(e).result;return e.reversedInput&&t.reverse(),ae.reverseInputs(e),t}function h(e){ae.reverseInputs(e);var t=new fe(e).result;return e.reversedInput&&t.reverse(),ae.reverseInputs(e),t}function l(e){ae.reverseInputs(e);var t=new ge(e).result;return e.reversedInput&&t.reverse(),ae.reverseInputs(e),t}function c(e){ae.reverseInputs(e);var t=new de(e).result;return e.reversedInput&&t.reverse(),ae.reverseInputs(e),t}function v(e){ae.reverseInputs(e);var t=new we(e).result;return e.reversedInput&&t.reverse(),ae.reverseInputs(e),t}function p(e){ae.reverseInputs(e);var t=new xe(e).result;return e.reversedInput&&t.reverse(),ae.reverseInputs(e),t}function f(e){ae.reverseInputs(e);var t=new me(e).result;return e.reversedInput&&t.reverse(),ae.reverseInputs(e),t}function g(e){ae.reverseInputs(e);var t=new ke(e).result;return e.reversedInput&&t.reverse(),ae.reverseInputs(e),t}function d(e){ae.reverseInputs(e);var t=new Oe(e).result;return e.reversedInput&&t.reverse(),ae.reverseInputs(e),t}function _(e){ae.reverseInputs(e);var t=new Pe(e).result;return e.reversedInput&&t.reverse(),ae.reverseInputs(e),t}function w(e){ae.reverseInputs(e);var t=new je(e).result;return e.reversedInput&&t.reverse(),ae.reverseInputs(e),t}function x(e){ae.reverseInputs(e);var t=new Ie(e).result;return e.reversedInput&&t.reverse(),ae.reverseInputs(e),t}function m(e){ae.reverseInputs(e);var t=new Re(e).result;return e.reversedInput&&t.reverse(),ae.reverseInputs(e),t}function b(e){ae.reverseInputs(e);var t=new Ve(e).result;return e.reversedInput&&t.reverse(),ae.reverseInputs(e),t}function y(e){ae.reverseInputs(e);var t=new Ce(e).result;return e.reversedInput&&t.reverse(),ae.reverseInputs(e),t}function k(e){ae.reverseInputs(e);var t=new qe(e).result;return e.reversedInput&&t.reverse(),ae.reverseInputs(e),t}function O(e){ae.reverseInputs(e);var t=new Ee(e).result;return e.reversedInput&&t.reverse(),ae.reverseInputs(e),t}function P(e){ae.reverseInputs(e);var t=new Se(e).result;return e.reversedInput&&(t.open.reverse(),t.high.reverse(),t.low.reverse(),t.close.reverse(),t.volume.reverse(),t.timestamp.reverse()),ae.reverseInputs(e),t}function j(e){ae.reverseInputs(e);var t=new Ae(e).result;return e.reversedInput&&(t.open.reverse(),t.high.reverse(),t.low.reverse(),t.close.reverse(),t.volume.reverse(),t.timestamp.reverse()),ae.reverseInputs(e),t}function I(e){return(new De).hasPattern(e)}function R(e){return(new ze).hasPattern(e)}function V(e){return(new He).hasPattern(e)}function C(e){return(new Be).hasPattern(e)}function q(e){return(new Te).hasPattern(e)}function E(e){return(new Ne).hasPattern(e)}function M(e){return(new Fe).hasPattern(e)}function S(e){return(new We).hasPattern(e)}function A(e){return(new Ge).hasPattern(e)}function L(e){return(new Xe).hasPattern(e)}function D(e){return(new Je).hasPattern(e)}function z(e){return(new Qe).hasPattern(e)}function H(e){return(new Ue).hasPattern(e)}function B(e){return(new Ye).hasPattern(e)}function T(e){return(new Ze).hasPattern(e)}function N(e){return(new $e).hasPattern(e)}function F(e){return(new et).hasPattern(e)}function W(e){return(new tt).hasPattern(e)}function G(e){return(new nt).hasPattern(e)}function X(e){return(new ot).hasPattern(e)}function K(e){return(new it).hasPattern(e)}function J(e){return(new at).hasPattern(e)}function Q(e){return(new ut).hasPattern(e)}function U(e){return(new st).hasPattern(e)}function Y(e){return(new ht).hasPattern(e)}function Z(e,t){var r=[0,23.6,38.2,50,61.8,78.6,100,127.2,161.8,261.8,423.6];return e<t?r.map(function(r){var n=t-Math.abs(e-t)*r/100;return n>0?n:0}):r.map(function(r){var n=t+Math.abs(e-t)*r/100;return n>0?n:0})}function $(){var e=[];return e.push("sma"),e.push("ema"),e.push("wma"),e.push("wema"),e.push("macd"),e.push("rsi"),e.push("bollingerbands"),e.push("adx"),e.push("atr"),e.push("truerange"),e.push("roc"),e.push("kst"),e.push("stochastic"),e.push("williamsr"),e.push("adl"),e.push("obv"),e.push("trix"),e.push("averagegain"),e.push("averageloss"),e.push("sd"),e.push("bullish"),e.push("bearish"),e.push("abandonedbaby"),e.push("doji"),e.push("bearishengulfingpattern"),e.push("bullishengulfingpattern"),e.push("darkcloudcover"),e.push("downsidetasukigap"),e.push("dragonflydoji"),e.push("gravestonedoji"),e.push("bullishharami"),e.push("bearishharami"),e.push("bullishharamicross"),e.push("bearishharamicross"),e.push("eveningdojistar"),e.push("eveningstar"),e.push("morningdojistar"),e.push("morningstar"),e.push("bullishmarubozu"),e.push("bearishmarubozu"),e.push("piercingline"),e.push("bullishspinningtop"),e.push("bearishspinningtop"),e.push("threeblackcrows"),e.push("threewhitesoldiers"),e}var ee={},te=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},re=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),ne=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)},oe=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t},ie=function e(){te(this,e)},ae=function(){function e(t){te(this,e),this.format=t.format||n}return re(e,[{key:"getResult",value:function(){return this.result}}],[{key:"reverseInputs",value:function(e){e.reversedInput&&(e.values&&e.values.reverse(),e.open&&e.open.reverse(),e.high&&e.high.reverse(),e.low&&e.low.reverse(),e.close&&e.close.reverse(),e.volume&&e.volume.reverse(),e.timestamp&&e.timestamp.reverse())}}]),e}(),ue=function e(t,r,n){te(this,e),this.next=n,n&&(n.prev=this),this.prev=r,r&&(r.next=this),this.data=t},se=function(){function e(){te(this,e),this._length=0}return re(e,[{key:"push",value:function(e){this._tail=new ue(e,this._tail),0===this._length&&(this._head=this._tail,this._current=this._head,this._next=this._head),this._length++}},{key:"pop",value:function(){var e=this._tail;if(0!==this._length)return 0===--this._length?(this._head=this._tail=this._current=this._next=void 0,e.data):(this._tail=e.prev,this._tail.next=void 0,this._current===e&&(this._current=this._tail,this._next=void 0),e.data)}},{key:"shift",value:function(){var e=this._head;if(0!==this._length)return 0===--this._length?(this._head=this._tail=this._current=this._next=void 0,e.data):(this._head=this._head.next,this._current===e&&(this._current=this._head,this._next=this._current.next),e.data)}},{key:"unshift",value:function(e){this._head=new ue(e,void 0,this._head),0===this._length&&(this._tail=this._head,this._next=this._head),this._length++}},{key:"unshiftCurrent",value:function(){var e=this._current;return e===this._head||this._length<2?e&&e.data:(e===this._tail?(this._tail=e.prev,this._tail.next=void 0,this._current=this._tail):(e.next.prev=e.prev,e.prev.next=e.next,this._current=e.prev),this._next=this._current.next,e.next=this._head,e.prev=void 0,this._head.prev=e,this._head=e,e.data)}},{key:"removeCurrent",value:function(){var e=this._current;if(0!==this._length)return 0===--this._length?(this._head=this._tail=this._current=this._next=void 0,e.data):(e===this._tail?(this._tail=e.prev,this._tail.next=void 0,this._current=this._tail):e===this._head?(this._head=e.next,this._head.prev=void 0,this._current=this._head):(e.next.prev=e.prev,e.prev.next=e.next,this._current=e.prev),this._next=this._current.next,e.data)}},{key:"resetCursor",value:function(){return this._current=this._next=this._head,this}},{key:"next",value:function(){var e=this._next;if(void 0!==e)return this._next=e.next,this._current=e,e.data}},{key:"head",get:function(){return this._head&&this._head.data}},{key:"tail",get:function(){return this._tail&&this._tail.data}},{key:"current",get:function(){return this._current&&this._current.data}},{key:"length",get:function(){return this._length}}]),e}(),he=(function(e){function t(e,r){te(this,t);var n=oe(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return n.period=e,n.values=r,n}ne(t,e)}(ie),function(e){function t(e){te(this,t);var r=oe(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));r.period=e.period,r.price=e.values;var n=regeneratorRuntime.mark(function e(t){var r,n,o,i,a;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return r=new se,n=0,o=1,void(e.next=5);case 5:i=e.sent,r.push(0);case 7:return o<t?(o++,r.push(i),n+=i):(n=n-r.shift()+i,a=n/t,r.push(i)),e.next=11,a;case 11:i=e.sent,e.next=7;break;case 14:case"end":return e.stop()}},e,this)});return r.generator=n(r.period),r.generator.next(),r.result=[],r.price.forEach(function(e){var t=r.generator.next(e);void 0!==t.value&&r.result.push(r.format(t.value))}),r}return ne(t,e),re(t,[{key:"nextValue",value:function(e){var t=this.generator.next(e).value;if(void 0!=t)return this.format(t)}}]),t}(ae));he.calculate=o;var le=function(e){function t(e){te(this,t);var r,n=oe(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e)),o=e.period,i=e.values,a=2/(o+1);n.result=[],r=new he({period:o,values:[]});var u=regeneratorRuntime.mark(function e(){var t,n;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return void(e.next=2);case 2:t=e.sent;case 3:if(!n||!t){e.next=11;break}return n=(t-n)*a+n,e.next=8,n;case 8:t=e.sent,e.next=19;break;case 11:return void(e.next=13);case 13:if(t=e.sent,!(n=r.nextValue(t))){e.next=19;break}return e.next=18,n;case 18:t=e.sent;case 19:e.next=3;break;case 21:case"end":return e.stop()}},e,this)});return n.generator=u(),n.generator.next(),n.generator.next(),i.forEach(function(e){var t=n.generator.next(e);void 0!=t.value&&n.result.push(n.format(t.value))}),n}return ne(t,e),re(t,[{key:"nextValue",value:function(e){var t=this.generator.next(e).value;if(void 0!=t)return this.format(t)}}]),t}(ae);le.calculate=i;var ce=function(e){function t(e){te(this,t);var r=oe(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e)),n=e.period,o=e.values;return r.result=[],r.generator=regeneratorRuntime.mark(function e(){var t,r,o,i,a;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:t=new se,r=n*(n+1)/2;case 2:if(!(t.length<n)){e.next=11;break}return e.t0=t,void(e.next=7);case 7:e.t1=e.sent,e.t0.push.call(e.t0,e.t1),e.next=19;break;case 11:for(t.resetCursor(),o=0,i=1;i<=n;i++)o+=t.next()*i/r;return e.next=16,o;case 16:a=e.sent,t.shift(),t.push(a);case 19:e.next=2;break;case 21:case"end":return e.stop()}},e,this)})(),r.generator.next(),o.forEach(function(e,t){var n=r.generator.next(e);void 0!=n.value&&r.result.push(r.format(n.value))}),r}return ne(t,e),re(t,[{key:"nextValue",value:function(e){var t=this.generator.next(e).value;if(void 0!=t)return this.format(t)}}]),t}(ae);ce.calculate=a;var ve=function(e){function t(e){te(this,t);var r,n=oe(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e)),o=e.period,i=e.values,a=1/o;n.result=[],r=new he({period:o,values:[]});var u=regeneratorRuntime.mark(function e(){var t,n;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return void(e.next=2);case 2:t=e.sent;case 3:if(!n||void 0==t){e.next=11;break}return n=(t-n)*a+n,e.next=8,n;case 8:t=e.sent,e.next=19;break;case 11:return void(e.next=13);case 13:if(t=e.sent,!(n=r.nextValue(t))){e.next=19;break}return e.next=18,n;case 18:t=e.sent;case 19:e.next=3;break;case 21:case"end":return e.stop()}},e,this)});return n.generator=u(),n.generator.next(),n.generator.next(),i.forEach(function(e){var t=n.generator.next(e);void 0!=t.value&&n.result.push(n.format(t.value))}),n}return ne(t,e),re(t,[{key:"nextValue",value:function(e){var t=this.generator.next(e).value;if(void 0!=t)return this.format(t)}}]),t}(ae);ve.calculate=u;var pe=(function(e){function t(e,r){te(this,t);var n=oe(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return n.period=e,n.values=r,n.SimpleMAOscillator=!0,n.SimpleMASignal=!0,n}ne(t,e)}(ie),function(e){function t(e){te(this,t);var r=oe(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e)),n=e.SimpleMAOscillator?he:le,o=e.SimpleMASignal?he:le,i=new n({period:e.fastPeriod,values:[],format:function(e){return e}}),a=new n({period:e.slowPeriod,values:[],format:function(e){return e}}),u=new o({period:e.signalPeriod,values:[],format:function(e){return e}}),s=r.format;return r.result=[],r.generator=regeneratorRuntime.mark(function t(){var r,n,o,h,l,c,v;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:r=0;case 1:if(!(r<e.slowPeriod)){t.next=10;break}return void(t.next=5);case 5:return n=t.sent,c=i.nextValue(n),v=a.nextValue(n),r++,t.abrupt("continue",1);case 10:return c&&v&&(o=c-v,h=u.nextValue(o)),l=o-h,t.next=14,{MACD:s(o),signal:h?s(h):void 0,histogram:isNaN(l)?void 0:s(l)};case 14:n=t.sent,c=i.nextValue(n),v=a.nextValue(n),t.next=1;break;case 19:case"end":return t.stop()}},t,this)})(),r.generator.next(),e.values.forEach(function(e){var t=r.generator.next(e);void 0!=t.value&&r.result.push(t.value)}),r}return ne(t,e),re(t,[{key:"nextValue",value:function(e){return this.generator.next(e).value}}]),t}(ae));pe.calculate=s;var fe=(function(e){function t(){return te(this,t),oe(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}ne(t,e)}(ie),function(e){function t(e){te(this,t);var r=oe(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e)),n=e.values,o=e.period,i=r.format;return r.generator=regeneratorRuntime.mark(function e(t){var r,n,o,a,u,s;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return void(e.next=2);case 2:r=e.sent,n=1,o=0;case 5:return u=s?r-s:0,u=u||0,u>0&&(o+=u),n<t+1?n++:a=a?(a*(t-1)+(u>0?u:0))/t:o/t,s=r,a=a?i(a):void 0,e.next=14,a;case 14:r=e.sent,e.next=5;break;case 17:case"end":return e.stop()}},e,this)})(o),r.generator.next(),r.result=[],n.forEach(function(e){var t=r.generator.next(e);void 0!==t.value&&r.result.push(t.value)}),r}return ne(t,e),re(t,[{key:"nextValue",value:function(e){return this.generator.next(e).value}}]),t}(ae));fe.calculate=h;var ge=(function(e){function t(){return te(this,t),oe(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}ne(t,e)}(ie),function(e){function t(e){te(this,t);var r=oe(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e)),n=e.values,o=e.period,i=r.format;return r.generator=regeneratorRuntime.mark(function e(t){var r,n,o,a,u,s;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return void(e.next=2);case 2:r=e.sent,n=1,o=0;case 5:return u=s?s-r:0,u=u||0,u>0&&(o+=u),n<t+1?n++:a=a?(a*(t-1)+(u>0?u:0))/t:o/t,s=r,a=a?i(a):void 0,e.next=14,a;case 14:r=e.sent,e.next=5;break;case 17:case"end":return e.stop()}},e,this)})(o),r.generator.next(),r.result=[],n.forEach(function(e){var t=r.generator.next(e);void 0!==t.value&&r.result.push(t.value)}),r}return ne(t,e),re(t,[{key:"nextValue",value:function(e){return this.generator.next(e).value}}]),t}(ae));ge.calculate=l;var de=(function(e){function t(){return te(this,t),oe(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}ne(t,e)}(ie),function(e){function t(e){te(this,t);var r=oe(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e)),n=e.period,o=e.values,i=new fe({period:n,values:[]}),a=new ge({period:n,values:[]});return r.generator=regeneratorRuntime.mark(function e(t){var r,n,o,u,s;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return void(e.next=2);case 2:r=e.sent;case 3:return n=i.nextValue(r),o=a.nextValue(r),n&&o&&(0===o?s=100:(u=n/o,s=parseFloat((100-100/(1+u)).toFixed(2)))),e.next=9,s;case 9:r=e.sent,e.next=3;break;case 12:case"end":return e.stop()}},e,this)})(n),r.generator.next(),r.result=[],o.forEach(function(e){var t=r.generator.next(e);void 0!==t.value&&r.result.push(t.value)}),r}return ne(t,e),re(t,[{key:"nextValue",value:function(e){return this.generator.next(e).value}}]),t}(ae));de.calculate=c;var _e=function(e){function t(e,r,n){te(this,t);var o=oe(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));if(o.size=e,o.maintainHigh=r,o.maintainLow=n,o.periodHigh=0,o.periodLow=1/0,!e||"number"!=typeof e)throw"Size required and should be a number.";return o._push=o.push,o.push=function(e){this.add(e)},o}return ne(t,e),re(t,[{key:"add",value:function(e){this.length===this.size?(this.lastShift=this.shift(),this._push(e),this.maintainHigh&&this.lastShift==this.periodHigh&&this.calculatePeriodHigh(),this.maintainLow&&this.lastShift==this.periodLow&&this.calculatePeriodLow()):this._push(e),this.maintainHigh&&this.periodHigh<=e&&(this.periodHigh=e),this.maintainLow&&this.periodLow>=e&&(this.periodLow=e)}},{key:"iterator",value:regeneratorRuntime.mark(function e(){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:this.resetCursor();case 1:if(!this.next()){e.next=6;break}return e.next=4,this.current;case 4:e.next=1;break;case 6:case"end":return e.stop()}},e,this)})},{key:"calculatePeriodHigh",value:function(){for(this.resetCursor(),this.next()&&(this.periodHigh=this.current);this.next();)this.periodHigh<=this.current&&(this.periodHigh=this.current)}},{key:"calculatePeriodLow",value:function(){for(this.resetCursor(),this.next()&&(this.periodLow=this.current);this.next();)this.periodLow>=this.current&&(this.periodLow=this.current)}}]),t}(se),we=(function(e){function t(){return te(this,t),oe(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}ne(t,e)}(ie),function(e){function t(e){te(this,t);var r=oe(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e)),n=e.period,o=e.values,i=new he({period:n,values:[],format:function(e){return e}});return r.result=[],r.generator=regeneratorRuntime.mark(function e(){var t,r,o,a,u,s,h,l,c,v,p;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return o=new _e(n),void(e.next=4);case 4:t=e.sent;case 5:if(o.push(t),!(r=i.nextValue(t))){e.next=30;break}for(u=0,s=!0,h=!1,l=void 0,e.prev=13,c=o.iterator()[Symbol.iterator]();!(s=(v=c.next()).done);s=!0)p=v.value,u+=Math.pow(p-r,2);e.next=21;break;case 17:e.prev=17,e.t0=e.catch(13),h=!0,l=e.t0;case 21:e.prev=21,e.prev=22,!s&&c.return&&c.return();case 24:if(e.prev=24,!h){e.next=27;break}throw l;case 27:return e.finish(24);case 28:return e.finish(21);case 29:a=Math.sqrt(u/n);case 30:return e.next=32,a;case 32:t=e.sent,e.next=5;break;case 35:case"end":return e.stop()}},e,this,[[13,17,21,29],[22,,24,28]])})(),r.generator.next(),o.forEach(function(e){var t=r.generator.next(e);void 0!=t.value&&r.result.push(r.format(t.value))}),r}return ne(t,e),re(t,[{key:"nextValue",value:function(e){var t=this.generator.next(e);if(void 0!=t.value)return this.format(t.value)}}]),t}(ae));we.calculate=v;var xe=(function(e){function t(){return te(this,t),oe(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}ne(t,e)}(ie),function(e){function t(){return te(this,t),oe(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}ne(t,e)}(ie),function(e){function t(e){te(this,t);var r,n,o=oe(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e)),i=e.period,a=e.values,u=e.stdDev,s=o.format;return o.result=[],r=new he({period:i,values:[],format:function(e){return e}}),n=new we({period:i,values:[],format:function(e){return e}}),o.generator=regeneratorRuntime.mark(function e(){var t,o,i,a,h,l,c,v;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return void(e.next=2);case 2:o=e.sent;case 3:return i=r.nextValue(o),a=n.nextValue(o),i&&(h=s(i),l=s(i+a*u),c=s(i-a*u),v=s((o-c)/(l-c)),t={middle:h,upper:l,lower:c,pb:v}),e.next=9,t;case 9:o=e.sent,e.next=3;break;case 12:case"end":return e.stop()}},e,this)})(),o.generator.next(),a.forEach(function(e){var t=o.generator.next(e);void 0!=t.value&&o.result.push(t.value)}),o}return ne(t,e),re(t,[{key:"nextValue",value:function(e){return this.generator.next(e).value}}]),t}(ae));xe.calculate=p;var me=function(e){function t(e){te(this,t);var r=oe(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));r.period=e.period,r.price=e.values;var n=regeneratorRuntime.mark(function e(t){var r,n,o,i,a;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return r=new se,n=0,o=1,void(e.next=5);case 5:i=e.sent;case 6:return o<t?(o++,n+=i):o==t?(o++,n+=i,a=n):a=a-a/t+i,e.next=10,a;case 10:i=e.sent,e.next=6;break;case 13:case"end":return e.stop()}},e,this)});return r.generator=n(r.period),r.generator.next(),r.result=[],r.price.forEach(function(e){var t=r.generator.next(e);void 0!=t.value&&r.result.push(r.format(t.value))}),r}return ne(t,e),re(t,[{key:"nextValue",value:function(e){var t=this.generator.next(e).value;if(void 0!=t)return this.format(t)}}]),t}(ae);me.calculate=f;var be=(function(e){function t(){return te(this,t),oe(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}ne(t,e)}(ie),function(e){function t(e){te(this,t);var r=oe(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e)),n=e.low,o=e.high,i=r.format;if(n.length!=o.length)throw"Inputs(low,high) not of equal size";return r.result=[],r.generator=regeneratorRuntime.mark(function e(){var t,r,n,o,a;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return void(e.next=2);case 2:r=e.sent;case 3:return n&&(o=r.high-n.high,a=n.low-r.low,t=i(a>o&&a>0?a:0)),n=r,e.next=8,t;case 8:r=e.sent,e.next=3;break;case 11:case"end":return e.stop()}},e,this)})(),r.generator.next(),n.forEach(function(e,t){var i=r.generator.next({high:o[t],low:n[t]});void 0!==i.value&&r.result.push(i.value)}),r}return ne(t,e),re(t,[{key:"nextValue",value:function(e){return this.generator.next(e).value}}],[{key:"calculate",value:function(e){ae.reverseInputs(e);var r=new t(e).result;return e.reversedInput&&r.reverse(),ae.reverseInputs(e),r}}]),t}(ae)),ye=(function(e){function t(){return te(this,t),oe(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}ne(t,e)}(ie),function(e){function t(e){te(this,t);var r=oe(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e)),n=e.low,o=e.high,i=r.format;if(n.length!=o.length)throw"Inputs(low,high) not of equal size";return r.result=[],r.generator=regeneratorRuntime.mark(function e(){var t,r,n,o,a;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return void(e.next=2);case 2:r=e.sent;case 3:return n&&(o=r.high-n.high,a=n.low-r.low,t=i(o>a&&o>0?o:0)),n=r,e.next=8,t;case 8:r=e.sent,e.next=3;break;case 11:case"end":return e.stop()}},e,this)})(),r.generator.next(),n.forEach(function(e,t){var i=r.generator.next({high:o[t],low:n[t]});void 0!==i.value&&r.result.push(i.value)}),r}return ne(t,e),re(t,[{key:"nextValue",value:function(e){return this.generator.next(e).value}}],[{key:"calculate",value:function(e){ae.reverseInputs(e);var r=new t(e).result;return e.reversedInput&&r.reverse(),ae.reverseInputs(e),r}}]),t}(ae)),ke=(function(e){function t(){return te(this,t),oe(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}ne(t,e)}(ie),function(e){function t(e){te(this,t);var r=oe(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e)),n=e.low,o=e.high,i=e.close,a=r.format;if(n.length!=o.length)throw"Inputs(low,high) not of equal size";return r.result=[],r.generator=regeneratorRuntime.mark(function e(){var t,r,n;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return void(e.next=2);case 2:t=e.sent;case 3:if(void 0!==r){e.next=9;break}return r=t.close,e.next=8,n;case 8:t=e.sent;case 9:return n=Math.max(t.high-t.low,isNaN(Math.abs(t.high-r))?0:Math.abs(t.high-r),isNaN(Math.abs(t.low-r))?0:Math.abs(t.low-r)),r=t.close,void 0!=n&&(n=a(n)),e.next=14,n;case 14:t=e.sent,e.next=3;break;case 17:case"end":return e.stop()}},e,this)})(),r.generator.next(),n.forEach(function(e,t){var a=r.generator.next({high:o[t],low:n[t],close:i[t]});void 0!=a.value&&r.result.push(a.value)}),r}return ne(t,e),re(t,[{key:"nextValue",value:function(e){return this.generator.next(e).value}}]),t}(ae));ke.calculate=g;var Oe=(function(e){function t(){return te(this,t),oe(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}ne(t,e)}(ie),function(e){function t(){return te(this,t),oe(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}ne(t,e)}(ie),function(e){function t(e){te(this,t);var r=oe(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e)),n=e.low,o=e.high,i=e.close,a=e.period,u=r.format,s=new ye({high:[],low:[]}),h=new be({high:[],low:[]}),l=new me({period:a,values:[],format:function(e){return e}}),c=new me({period:a,values:[],format:function(e){return e}}),v=new me({period:a,values:[],format:function(e){return e}}),p=new ve({period:a,values:[],format:function(e){return e}}),f=new ke({low:[],high:[],close:[]});if(n.length!==o.length||o.length!==i.length)throw"Inputs(low,high, close) not of equal size";return r.result=[],r.generator=regeneratorRuntime.mark(function e(){var t,r,n,o,i,a,u,g,d,_,w,x,m,b,y,k,O;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return void(e.next=2);case 2:t=e.sent,r=0,n=0,o=0,i=0;case 7:if(_=f.nextValue(t),w=s.nextValue(t),x=h.nextValue(t),void 0!==_){e.next=16;break}return void(e.next=14);case 14:return t=e.sent,e.abrupt("continue",7);case 16:return m=v.nextValue(_),b=l.nextValue(w),y=c.nextValue(x),void 0!=m&&void 0!=b&&void 0!=y&&(a=100*b/m,u=100*y/m,k=Math.abs(a-u),O=a+u,g=k/O*100,d=p.nextValue(g)),e.next=22,{adx:d,pdi:a,mdi:u};case 22:t=e.sent,e.next=7;break;case 25:case"end":return e.stop()}},e,this)})(),r.generator.next(),n.forEach(function(e,t){var a=r.generator.next({high:o[t],low:n[t],close:i[t]});void 0!=a.value&&void 0!=a.value.adx&&r.result.push({adx:u(a.value.adx),pdi:u(a.value.pdi),mdi:u(a.value.mdi)})}),r}return ne(t,e),re(t,[{key:"nextValue",value:function(e){var t=this.generator.next(e).value;if(void 0!=t&&void 0!=t.adx)return{adx:this.format(t.adx),pdi:this.format(t.pdi),mdi:this.format(t.mdi)}}}]),t}(ae));Oe.calculate=d;var Pe=(function(e){function t(){return te(this,t),oe(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}ne(t,e)}(ie),function(e){function t(e){te(this,t);var r=oe(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e)),n=e.low,o=e.high,i=e.close,a=e.period,u=r.format;if(n.length!==o.length||o.length!==i.length)throw"Inputs(low,high, close) not of equal size";var s=new ke({low:[],high:[],close:[]}),h=new ve({period:a,values:[],format:function(e){return e}});return r.result=[],r.generator=regeneratorRuntime.mark(function e(){var t,r,n;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return void(e.next=2);case 2:t=e.sent;case 4:return n=s.nextValue({low:t.low,high:t.high,close:t.close}),r=void 0===n?void 0:h.nextValue(n),e.next=9,r;case 9:t=e.sent,e.next=4;break;case 12:case"end":return e.stop()}},e,this)})(),r.generator.next(),n.forEach(function(e,t){var a=r.generator.next({high:o[t],low:n[t],close:i[t]});void 0!==a.value&&r.result.push(u(a.value))}),r}return ne(t,e),re(t,[{key:"nextValue",value:function(e){return this.generator.next(e).value}}]),t}(ae));Pe.calculate=_;var je=(function(e){function t(){return te(this,t),oe(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}ne(t,e)}(ie),function(e){function t(e){te(this,t);var r=oe(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e)),n=e.period,o=e.values;return r.result=[],r.generator=regeneratorRuntime.mark(function e(){var t,r,o,i;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return t=1,r=new _e(n),void(e.next=5);case 5:o=e.sent;case 6:return r.push(o),t<n?t++:i=(o-r.lastShift)/r.lastShift*100,e.next=11,i;case 11:o=e.sent,e.next=6;break;case 14:case"end":return e.stop()}},e,this)})(),r.generator.next(),o.forEach(function(e){var t=r.generator.next(e);void 0==t.value||isNaN(t.value)||r.result.push(r.format(t.value))}),r}return ne(t,e),re(t,[{key:"nextValue",value:function(e){var t=this.generator.next(e);if(void 0!=t.value&&!isNaN(t.value))return this.format(t.value)}}]),t}(ae));je.calculate=w;var Ie=(function(e){function t(){return te(this,t),oe(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}ne(t,e)}(ie),function(e){function t(e){te(this,t);var r=oe(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e)),n=e.values,o=e.ROCPer1,i=e.ROCPer2,a=e.ROCPer3,u=e.ROCPer4,s=e.SMAROCPer1,h=e.SMAROCPer2,l=e.SMAROCPer3,c=e.SMAROCPer4,v=e.signalPeriod,p=new je({period:o,values:[]}),f=new je({period:i,values:[]}),g=new je({period:a,values:[]}),d=new je({period:u,values:[]}),_=new he({period:s,values:[],format:function(e){return e}}),w=new he({period:h,values:[],format:function(e){return e}}),x=new he({period:l,values:[],format:function(e){return e}}),m=new he({period:c,values:[],format:function(e){return e}}),b=new he({period:v,values:[],format:function(e){return e}}),y=r.format;r.result=[];var k=Math.max(o+s,i+h,a+l,u+c);return r.generator=regeneratorRuntime.mark(function e(){var t,r,n,o,i,a,u,s,h,l,c,v,O;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return t=1,void(e.next=3);case 3:r=e.sent,n=void 0,o=void 0,i=void 0,a=void 0,u=void 0,s=void 0,h=void 0;case 6:return l=p.nextValue(r),c=f.nextValue(r),v=g.nextValue(r),O=d.nextValue(r),o=void 0!==l?_.nextValue(l):void 0,i=void 0!==c?w.nextValue(c):void 0,a=void 0!==v?x.nextValue(v):void 0,u=void 0!==O?m.nextValue(O):void 0,t<k?t++:n=1*o+2*i+3*a+4*u,s=void 0!==n?b.nextValue(n):void 0,h=void 0!==n?{kst:y(n),signal:s?y(s):void 0}:void 0,e.next=20,h;case 20:r=e.sent,e.next=6;break;case 23:case"end":return e.stop()}},e,this)})(),r.generator.next(),n.forEach(function(e){var t=r.generator.next(e);void 0!=t.value&&r.result.push(t.value)}),r}return ne(t,e),re(t,[{key:"nextValue",value:function(e){var t=this.generator.next(e);if(void 0!=t.value)return t.value}}]),t}(ae));Ie.calculate=x;var Re=(function(e){function t(){return te(this,t),oe(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}ne(t,e)}(ie),function(e){function t(e){te(this,t);var r=oe(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e)),n=e.low,o=e.high,i=e.close,a=e.period,u=e.signalPeriod,s=r.format;if(n.length!==o.length||o.length!==i.length)throw"Inputs(low,high, close) not of equal size";return r.result=[],r.generator=regeneratorRuntime.mark(function e(){var t,r,n,o,i,h,l,c;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return t=1,r=new _e(a,!0,!1),n=new _e(a,!1,!0),o=new he({period:u,values:[],format:function(e){return e}}),i=void 0,h=void 0,void(e.next=7);case 7:l=e.sent;case 8:if(r.push(l.high),n.push(l.low),!(t<a)){e.next=17;break}return t++,void(e.next=15);case 15:return l=e.sent,e.abrupt("continue",8);case 17:return c=n.periodLow,i=(l.close-c)/(r.periodHigh-c)*100,h=o.nextValue(i),e.next=22,{k:s(i),d:h?s(h):void 0};case 22:l=e.sent,e.next=8;break;case 25:case"end":return e.stop()}},e,this)})(),r.generator.next(),n.forEach(function(e,t){var a=r.generator.next({high:o[t],low:n[t],close:i[t]});void 0!==a.value&&r.result.push(a.value)}),r}return ne(t,e),re(t,[{key:"nextValue",value:function(e){var t=this.generator.next(e);if(void 0!==t.value)return t.value}}]),t
}(ae));Re.calculate=m;var Ve=(function(e){function t(){return te(this,t),oe(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}ne(t,e)}(ie),function(e){function t(e){te(this,t);var r=oe(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e)),n=e.low,o=e.high,i=e.close,a=e.period,u=r.format;if(n.length!==o.length||o.length!==i.length)throw"Inputs(low,high, close) not of equal size";return r.result=[],r.generator=regeneratorRuntime.mark(function e(){var t,r,n,o,i,s,h;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return t=1,r=new _e(a,!0,!1),n=new _e(a,!1,!0),o=void 0,i=void 0,void(e.next=7);case 7:s=e.sent,h=void 0;case 9:if(r.push(s.high),n.push(s.low),!(t<a)){e.next=18;break}return t++,void(e.next=16);case 16:return s=e.sent,e.abrupt("continue",9);case 18:return o=n.periodLow,i=r.periodHigh,h=u((i-s.close)/(i-o)*-100),e.next=23,h;case 23:s=e.sent,e.next=9;break;case 26:case"end":return e.stop()}},e,this)})(),r.generator.next(),n.forEach(function(e,t){var a=r.generator.next({high:o[t],low:n[t],close:i[t]});void 0!==a.value&&r.result.push(a.value)}),r}return ne(t,e),re(t,[{key:"nextValue",value:function(e){var t=this.generator.next(e);if(void 0!=t.value)return this.format(t.value)}}]),t}(ae));Ve.calculate=b;var Ce=(function(e){function t(){return te(this,t),oe(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}ne(t,e)}(ie),function(e){function t(e){te(this,t);var r=oe(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e)),n=e.high,o=e.low,i=e.close,a=e.volume;if(o.length!==n.length||n.length!==i.length||n.length!==a.length)throw"Inputs(low,high, close, volumes) not of equal size";return r.result=[],r.generator=regeneratorRuntime.mark(function e(){var t,r,n,o;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return t=0,void(e.next=3);case 3:r=e.sent;case 4:return n=(r.close-r.low-(r.high-r.close))/(r.high-r.low),o=n*r.volume,t+=o,e.next=10,Math.round(t);case 10:r=e.sent,e.next=4;break;case 13:case"end":return e.stop()}},e,this)})(),r.generator.next(),n.forEach(function(e,t){var n={high:e,low:o[t],close:i[t],volume:a[t]},u=r.generator.next(n);void 0!=u.value&&r.result.push(u.value)}),r}return ne(t,e),re(t,[{key:"nextValue",value:function(e){return this.generator.next(e).value}}]),t}(ae));Ce.calculate=y;var qe=(function(e){function t(){return te(this,t),oe(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}ne(t,e)}(ie),function(e){function t(e){te(this,t);var r=oe(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e)),n=e.close,o=e.volume;return r.result=[],r.generator=regeneratorRuntime.mark(function e(){var t,r,n;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return t=0,void(e.next=3);case 3:if(r=e.sent,!r.close||"number"!=typeof r.close){e.next=9;break}return n=r.close,void(e.next=8);case 8:r=e.sent;case 9:return n<r.close?t+=r.volume:r.close<n&&(t-=r.volume),n=r.close,e.next=14,t;case 14:r=e.sent,e.next=9;break;case 17:case"end":return e.stop()}},e,this)})(),r.generator.next(),n.forEach(function(e,t){var i={close:n[t],volume:o[t]},a=r.generator.next(i);void 0!=a.value&&r.result.push(a.value)}),r}return ne(t,e),re(t,[{key:"nextValue",value:function(e){return this.generator.next(e).value}}]),t}(ae));qe.calculate=k;var Ee=(function(e){function t(){return te(this,t),oe(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}ne(t,e)}(ie),function(e){function t(e){te(this,t);var r=oe(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e)),n=e.values,o=e.period,i=r.format,a=new le({period:o,values:[],format:function(e){return e}}),u=new le({period:o,values:[],format:function(e){return e}}),s=new le({period:o,values:[],format:function(e){return e}}),h=new je({period:1,values:[],format:function(e){return e}});return r.result=[],r.generator=regeneratorRuntime.mark(function e(){var t,r,n,o,l;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return void(e.next=2);case 2:t=e.sent;case 3:return r=a.nextValue(t),n=r?u.nextValue(r):void 0,o=n?s.nextValue(n):void 0,l=o?h.nextValue(o):void 0,e.next=10,l?i(l):void 0;case 10:t=e.sent,e.next=3;break;case 13:case"end":return e.stop()}},e,this)})(),r.generator.next(),n.forEach(function(e){var t=r.generator.next(e);void 0!==t.value&&r.result.push(t.value)}),r}return ne(t,e),re(t,[{key:"nextValue",value:function(e){var t=this.generator.next(e);if(void 0!==t.value)return t.value}}]),t}(ae));Ee.calculate=O;var Me=function e(){te(this,e),this.open=[],this.high=[],this.low=[],this.close=[],this.volume=[],this.timestamp=[]},Se=(function(e){function t(){return te(this,t),oe(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}ne(t,e)}(ie),function(e){function t(e){te(this,t);var r=oe(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e)),n=(r.format,e.useATR),o=e.brickSize||0;if(n){var i=_(Object.assign({},e));o=i[i.length-1]}if(r.result=new Me,0===o)return console.error("Not enough data to calculate brickSize for renko when using ATR"),oe(r);var a=0,u=0,s=1/0,h=0,l=0,c=0;return r.generator=regeneratorRuntime.mark(function e(){var t,r,n,i,v;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return void(e.next=2);case 2:t=e.sent;case 3:if(0!==a){e.next=15;break}return a=t.close,u=t.high,s=t.low,h=t.close,l=t.volume,c=t.timestamp,void(e.next=13);case 13:return t=e.sent,e.abrupt("continue",3);case 15:if(r=Math.abs(t.close-h),n=Math.abs(t.close-a),!(r>=o&&n>=o)){e.next=30;break}return i=r>n?a:h,v={open:i,high:u>t.high?u:t.high,low:s<t.Low?s:t.low,close:i>t.close?i-o:i+o,volume:l+t.volume,timestamp:t.timestamp},a=v.open,u=v.close,s=v.close,h=v.close,l=0,e.next=27,v;case 27:t=e.sent,e.next=37;break;case 30:return u=u>t.high?u:t.high,s=s<t.Low?s:t.low,l+=t.volume,c=t.timestamp,void(e.next=36);case 36:t=e.sent;case 37:e.next=3;break;case 39:case"end":return e.stop()}},e,this)})(),r.generator.next(),e.low.forEach(function(t,n){var o=r.generator.next({open:e.open[n],high:e.high[n],low:e.low[n],close:e.close[n],volume:e.volume[n],timestamp:e.timestamp[n]});o.value&&(r.result.open.push(o.value.open),r.result.high.push(o.value.high),r.result.low.push(o.value.low),r.result.close.push(o.value.close),r.result.volume.push(o.value.volume),r.result.timestamp.push(o.value.timestamp))}),r}return ne(t,e),re(t,[{key:"nextValue",value:function(e){return console.error("Cannot calculate next value on Renko, Every value has to be recomputed for every change, use calcualte method"),null}}]),t}(ae));Se.calculate=P;var Ae=(function(e){function t(){return te(this,t),oe(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}ne(t,e)}(ie),function(e){function t(e){te(this,t);var r=oe(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));r.format;r.result=new Me;var n=null,o=0,i=1/0,a=0,u=0,s=0;return r.generator=regeneratorRuntime.mark(function e(){var t,r,h,l,c,v;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return void(e.next=2);case 2:t=e.sent,r=null;case 4:return null===n?(n=(t.close+t.open)/2,o=t.high,i=t.low,a=(t.close+t.open+t.high+t.low)/4,u=t.volume||0,s=t.timestamp||0,r={open:n,high:o,low:i,close:a,volume:t.volume||0,timestamp:t.timestamp||0}):(h=(t.close+t.open+t.high+t.low)/4,l=(n+a)/2,c=Math.max(l,h,t.high),v=Math.min(t.low,l,h),r={close:h,open:l,high:c,low:v,volume:t.volume||0,timestamp:t.timestamp||0},a=h,n=l,o=c,i=v),e.next=8,r;case 8:t=e.sent,e.next=4;break;case 11:case"end":return e.stop()}},e,this)})(),r.generator.next(),e.low.forEach(function(t,n){var o=r.generator.next({open:e.open[n],high:e.high[n],low:e.low[n],close:e.close[n],volume:e.volume?e.volume[n]:e.volume,timestamp:e.timestamp?e.timestamp[n]:e.timestamp});o.value&&(r.result.open.push(o.value.open),r.result.high.push(o.value.high),r.result.low.push(o.value.low),r.result.close.push(o.value.close),r.result.volume.push(o.value.volume),r.result.timestamp.push(o.value.timestamp))}),r}return ne(t,e),re(t,[{key:"nextValue",value:function(e){return this.generator.next(e).value}}]),t}(ae));Ae.calculate=j;var Le=function(){function e(){te(this,e)}return re(e,[{key:"approximateEqual",value:function(e,t){return 1*parseFloat(Math.abs(e-t).toPrecision(4))<=1*parseFloat((.001*e).toPrecision(4))}},{key:"logic",value:function(e){throw"this has to be implemented"}},{key:"getAllPatternIndex",value:function(e){var t=this;if(e.close.length<this.requiredCount)return console.warn("Data count less than data required for the strategy ",this.name),[];e.reversedInput&&(e.open.reverse(),e.high.reverse(),e.low.reverse(),e.close.reverse());var r=this.logic;return this._generateDataForCandleStick(e).map(function(e,n){return r.call(t,e)?n:void 0}).filter(function(e){return e})}},{key:"hasPattern",value:function(e){return e.close.length<this.requiredCount?(console.warn("Data count less than data required for the strategy ",this.name),!1):(e.reversedInput&&(e.open.reverse(),e.high.reverse(),e.low.reverse(),e.close.reverse()),this.logic.call(this,this._getLastDataForCandleStick(e)))}},{key:"_getLastDataForCandleStick",value:function(e){var t=this.requiredCount;if(e.close.length===t)return e;for(var r={open:[],high:[],low:[],close:[]},n=0,o=e.close.length-t;n<t;)r.open.push(e.open[o+n]),r.high.push(e.high[o+n]),r.low.push(e.low[o+n]),r.close.push(e.close[o+n]),n++;return r}},{key:"_generateDataForCandleStick",value:function(e){var t=this.requiredCount;return e.close.map(function(r,n){for(var o=0,i={open:[],high:[],low:[],close:[]};o<t;)i.open.push(e.open[n+o]),i.high.push(e.high[n+o]),i.low.push(e.low[n+o]),i.close.push(e.close[n+o]),o++;return i}).filter(function(r,n){return n<=e.close.length-t})}}]),e}(),De=function(e){function t(){te(this,t);var e=oe(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return e.name="MorningStar",e.requiredCount=3,e}return ne(t,e),re(t,[{key:"logic",value:function(e){var t=e.open[0],r=e.close[0],n=(e.high[0],e.low[0]),o=(e.open[1],e.close[1]),i=e.high[1],a=e.low[1],u=e.open[2],s=e.close[2],h=(e.high[2],e.low[2],(t+r)/2),l=r<t,c=n>a&&n>i,v=u<s,p=i<n&&a<n&&u>i&&o<u,f=s>h;return l&&c&&p&&v&&f}}]),t}(Le),ze=function(e){function t(){te(this,t);var e=oe(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return e.name="BullishEngulfingPattern",e.requiredCount=2,e}return ne(t,e),re(t,[{key:"logic",value:function(e){var t=e.open[0],r=e.close[0],n=(e.high[0],e.low[0],e.open[1]),o=e.close[1];e.high[1],e.low[1];return r<t&&t>n&&r>n&&t<o}}]),t}(Le),He=function(e){function t(){te(this,t);var e=oe(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return e.requiredCount=2,e.name="BullishHarami",e}return ne(t,e),re(t,[{key:"logic",value:function(e){var t=e.open[0],r=e.close[0],n=e.high[0],o=(e.low[0],e.open[1]),i=e.close[1],a=e.high[1],u=e.low[1];return t<o&&r>o&&r>i&&t<u&&n>a}}]),t}(Le),Be=function(e){function t(){te(this,t);var e=oe(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return e.requiredCount=2,e.name="BullishHaramiCross",e}return ne(t,e),re(t,[{key:"logic",value:function(e){var t=e.open[0],r=e.close[0],n=e.high[0],o=(e.low[0],e.open[1]),i=e.close[1],a=e.high[1],u=e.low[1],s=t<o&&r>o&&r>i&&t<u&&n>a,h=this.approximateEqual(o,i);return s&&h}}]),t}(Le),Te=function(e){function t(){te(this,t);var e=oe(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return e.name="Doji",e.requiredCount=1,e}return ne(t,e),re(t,[{key:"logic",value:function(e){var t=e.open[0],r=e.close[0];return this.approximateEqual(t,r)}}]),t}(Le),Ne=function(e){function t(){te(this,t);var e=oe(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return e.name="MorningDojiStar",e.requiredCount=3,e}return ne(t,e),re(t,[{key:"logic",value:function(e){var t=e.open[0],r=e.close[0],n=(e.high[0],e.low[0]),o=e.open[1],i=e.close[1],a=e.high[1],u=e.low[1],s=e.open[2],h=e.close[2],l=(e.high[2],e.low[2],(t+r)/2),c=r<t,v=(new Te).hasPattern({open:[o],close:[i],high:[a],low:[u]}),p=s<h,f=a<n&&u<n&&s>a&&i<s,g=h>l;return c&&v&&p&&f&&g}}]),t}(Le),Fe=function(e){function t(){te(this,t);var e=oe(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return e.requiredCount=3,e.name="DownsideTasukiGap",e}return ne(t,e),re(t,[{key:"logic",value:function(e){var t=e.open[0],r=e.close[0],n=(e.high[0],e.low[0]),o=e.open[1],i=e.close[1],a=e.high[1],u=(e.low[1],e.open[2]),s=e.close[2],h=(e.high[2],e.low[2],r<t),l=i<o,c=s>u,v=a<n,p=o>u&&i<u&&s>o&&s<r;return h&&l&&c&&v&&p}}]),t}(Le),We=function(e){function t(){te(this,t);var e=oe(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return e.name="BullishMarubozu",e.requiredCount=1,e}return ne(t,e),re(t,[{key:"logic",value:function(e){var t=e.open[0],r=e.close[0],n=e.high[0],o=e.low[0];return this.approximateEqual(r,n)&&this.approximateEqual(o,t)&&t<r&&t<n}}]),t}(Le),Ge=function(e){function t(){te(this,t);var e=oe(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return e.requiredCount=2,e.name="PiercingLine",e}return ne(t,e),re(t,[{key:"logic",value:function(e){var t=e.open[0],r=e.close[0],n=(e.high[0],e.low[0]),o=e.open[1],i=e.close[1],a=(e.high[1],e.low[1]),u=(t+r)/2,s=a<n,h=r<t,l=i>o,c=n>o&&i>u;return s&&h&&c&&l}}]),t}(Le),Xe=function(e){function t(){te(this,t);var e=oe(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return e.name="ThreeWhiteSoldiers",e.requiredCount=3,e}return ne(t,e),re(t,[{key:"logic",value:function(e){var t=e.open[0],r=e.close[0],n=e.high[0],o=(e.low[0],e.open[1]),i=e.close[1],a=e.high[1],u=(e.low[1],e.open[2]),s=e.close[2],h=e.high[2],l=(e.low[2],a>n&&h>a),c=t<r&&o<i&&u<s,v=r>o&&o<n&&a>u&&u<i;return l&&c&&v}}]),t}(Le),Ke=[new ze,new Fe,new He,new Be,new Ne,new De,new We,new Ge,new Xe],Je=function(e){function t(){te(this,t);var e=oe(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return e.name="Bullish Candlesticks",e}return ne(t,e),re(t,[{key:"hasPattern",value:function(e){return Ke.reduce(function(t,r){var n=r.hasPattern(e);return n&&console.log("Matched pattern ",r.name),t||n},!1)}}]),t}(Le),Qe=function(e){function t(){te(this,t);var e=oe(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return e.name="BearishEngulfingPattern",e.requiredCount=2,e}return ne(t,e),re(t,[{key:"logic",value:function(e){var t=e.open[0],r=e.close[0],n=(e.high[0],e.low[0],e.open[1]),o=e.close[1];e.high[1],e.low[1];return r>t&&t<n&&r<n&&t>o}}]),t}(Le),Ue=function(e){function t(){te(this,t);var e=oe(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return e.requiredCount=2,e.name="BearishHarami",e}return ne(t,e),re(t,[{key:"logic",value:function(e){var t=e.open[0],r=e.close[0],n=e.high[0],o=(e.low[0],e.open[1]),i=e.close[1],a=e.high[1],u=e.low[1];return t>o&&r<o&&r<i&&t>u&&n>a}}]),t}(Le),Ye=function(e){function t(){te(this,t);var e=oe(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return e.requiredCount=2,e.name="BearishHaramiCross",e}return ne(t,e),re(t,[{key:"logic",value:function(e){var t=e.open[0],r=e.close[0],n=e.high[0],o=(e.low[0],e.open[1]),i=e.close[1],a=e.high[1],u=e.low[1],s=t>o&&r<o&&r<i&&t>u&&n>a,h=this.approximateEqual(o,i);return s&&h}}]),t}(Le),Ze=function(e){function t(){te(this,t);var e=oe(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return e.name="EveningDojiStar",e.requiredCount=3,e}return ne(t,e),re(t,[{key:"logic",value:function(e){var t=e.open[0],r=e.close[0],n=e.high[0],o=(e.low[0],e.open[1]),i=e.close[1],a=e.high[1],u=e.low[1],s=e.open[2],h=e.close[2],l=(e.high[2],e.low[2],(t+r)/2),c=r>t,v=(new Te).hasPattern({open:[o],close:[i],high:[a],low:[u]}),p=s>h,f=a>n&&u>n&&s<u&&i>s,g=h<l;return c&&v&&f&&p&&g}}]),t}(Le),$e=function(e){function t(){te(this,t);var e=oe(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return e.name="EveningStar",e.requiredCount=3,e}return ne(t,e),re(t,[{key:"logic",value:function(e){var t=e.open[0],r=e.close[0],n=e.high[0],o=(e.low[0],e.open[1],e.close[1]),i=e.high[1],a=e.low[1],u=e.open[2],s=e.close[2],h=(e.high[2],e.low[2],(t+r)/2),l=r>t,c=n<a&&n<i,v=u>s,p=i>n&&a>n&&u<a&&o>u,f=s<h;return l&&c&&p&&v&&f}}]),t}(Le),et=function(e){function t(){te(this,t);var e=oe(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return e.name="BearishMarubozu",e.requiredCount=1,e}return ne(t,e),re(t,[{key:"logic",value:function(e){var t=e.open[0],r=e.close[0],n=e.high[0],o=e.low[0];return this.approximateEqual(t,n)&&this.approximateEqual(o,r)&&t>r&&t>o}}]),t}(Le),tt=function(e){function t(){te(this,t);var e=oe(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return e.name="ThreeBlackCrows",e.requiredCount=3,e}return ne(t,e),re(t,[{key:"logic",value:function(e){var t=e.open[0],r=e.close[0],n=(e.high[0],e.low[0]),o=e.open[1],i=e.close[1],a=(e.high[1],e.low[1]),u=e.open[2],s=e.close[2],h=(e.high[2],e.low[2]),l=n>a&&a>h,c=t>r&&o>i&&u>s,v=t>o&&o>r&&o>u&&u>i;return l&&c&&v}}]),t}(Le),rt=[new Qe,new Ue,new Ye,new Ze,new $e,new et,new tt],nt=function(e){function t(){te(this,t);var e=oe(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return e.name="Bearish Candlesticks",e}return ne(t,e),re(t,[{key:"hasPattern",value:function(e){return rt.reduce(function(t,r){return t||r.hasPattern(e)},!1)}}]),t}(Le),ot=function(e){function t(){te(this,t);var e=oe(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return e.name="AbandonedBaby",e.requiredCount=3,e}return ne(t,e),re(t,[{key:"logic",value:function(e){var t=e.open[0],r=e.close[0],n=(e.high[0],e.low[0]),o=e.open[1],i=e.close[1],a=e.high[1],u=e.low[1],s=e.open[2],h=e.close[2],l=e.high[2],c=e.low[2],v=r<t,p=(new Te).hasPattern({open:[o],close:[i],high:[a],low:[u]}),f=a<n&&c>a&&h>s,g=l<t;return v&&p&&f&&g}}]),t}(Le),it=function(e){function t(){te(this,t);var e=oe(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return e.name="DarkCloudCover",e.requiredCount=2,e}return ne(t,e),re(t,[{key:"logic",value:function(e){var t=e.open[0],r=e.close[0],n=e.high[0],o=(e.low[0],e.open[1]),i=e.close[1],a=(e.high[1],e.low[1],(r+t)/2),u=r>t,s=i<o,h=o>n&&i<a&&i>t;return u&&s&&h}}]),t}(Le),at=function(e){function t(){te(this,t);var e=oe(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return e.requiredCount=1,e.name="DragonFlyDoji",e}return ne(t,e),re(t,[{key:"logic",value:function(e){var t=e.open[0],r=e.close[0],n=e.high[0],o=this.approximateEqual(t,r),i=this.approximateEqual(t,n);return o&&i}}]),t}(Le),ut=function(e){function t(){te(this,t);var e=oe(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return e.requiredCount=1,e.name="GraveStoneDoji",e}return ne(t,e),re(t,[{key:"logic",value:function(e){var t=e.open[0],r=e.close[0],n=e.low[0],o=this.approximateEqual(t,r),i=this.approximateEqual(t,n);return o&&i}}]),t}(Le),st=function(e){function t(){te(this,t);var e=oe(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return e.name="BullishSpinningTop",e.requiredCount=1,e}return ne(t,e),re(t,[{key:"logic",value:function(e){var t=e.open[0],r=e.close[0],n=e.high[0],o=e.low[0],i=Math.abs(r-t),a=Math.abs(n-r),u=Math.abs(t-o);return i<a&&i<u}}]),t}(Le),ht=function(e){function t(){te(this,t);var e=oe(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return e.name="BearishSpinningTop",e.requiredCount=1,e}return ne(t,e),re(t,[{key:"logic",value:function(e){var t=e.open[0],r=e.close[0],n=e.high[0],o=e.low[0],i=Math.abs(r-t),a=Math.abs(n-t),u=Math.abs(n-o);return i<a&&i<u}}]),t}(Le);e.getAvailableIndicators=$,e.sma=o,e.SMA=he,e.ema=i,e.EMA=le,e.wma=a,e.WMA=ce,e.wema=u,e.WEMA=ve,e.macd=s,e.MACD=pe,e.rsi=c,e.RSI=de,e.bollingerbands=p,e.BollingerBands=xe,e.adx=d,e.ADX=Oe,e.atr=_,e.ATR=Pe,e.truerange=g,e.TrueRange=ke,e.roc=w,e.ROC=je,e.kst=x,e.KST=Ie,e.stochastic=m,e.Stochastic=Re,e.williamsr=b,e.WilliamsR=Ve,e.adl=y,e.ADL=Ce,e.obv=k,e.OBV=qe,e.trix=O,e.TRIX=Ee,e.averagegain=h,e.AverageGain=fe,e.averageloss=l,e.AverageLoss=ge,e.sd=v,e.SD=we,e.renko=P,e.HeikinAshi=Ae,e.heikinashi=j,e.bullish=D,e.bearish=G,e.abandonedbaby=X,e.doji=q,e.bearishengulfingpattern=z,e.bullishengulfingpattern=R,e.darkcloudcover=K,e.downsidetasukigap=M,e.dragonflydoji=J,e.gravestonedoji=Q,e.bullishharami=V,e.bearishharami=H,e.bullishharamicross=C,e.bearishharamicross=B,e.eveningdojistar=T,e.eveningstar=N,e.morningdojistar=E,e.morningstar=I,e.bullishmarubozu=S,e.bearishmarubozu=F,e.piercingline=A,e.bullishspinningtop=U,e.bearishspinningtop=Y,e.threeblackcrows=W,e.threewhitesoldiers=L,e.fibonacciretracement=Z,e.setConfig=t,e.getConfig=r}(this.window=this.window||{});
//# sourceMappingURL=browser.js.map

@@ -45,17 +45,24 @@ import { CandleList } from '../StockData';

}
if (Math.abs(candleData.close - lastOpen) >= brickSize) {
let absoluteMovementFromClose = Math.abs(candleData.close - lastClose);
let absoluteMovementFromOpen = Math.abs(candleData.close - lastOpen);
if ((absoluteMovementFromClose >= brickSize) && (absoluteMovementFromOpen >= brickSize)) {
let reference = absoluteMovementFromClose > absoluteMovementFromOpen ? lastOpen : lastClose;
let calculated = {
open: lastOpen,
open: reference,
high: lastHigh > candleData.high ? lastHigh : candleData.high,
low: lastLow < candleData.Low ? lastLow : candleData.low,
close: lastOpen > candleData.close ? (lastOpen - brickSize) : (lastOpen + brickSize),
close: reference > candleData.close ? (reference - brickSize) : (reference + brickSize),
volume: lastVolume + candleData.volume,
timestamp: candleData.timestamp
};
lastOpen = calculated.open;
lastHigh = calculated.close;
lastLow = calculated.close;
lastClose = calculated.close;
lastVolume = 0;
candleData = yield calculated;
}
else {
lastHigh = candleData.high;
lastLow = candleData.low;
lastClose = candleData.close;
lastHigh = lastHigh > candleData.high ? lastHigh : candleData.high;
lastLow = lastLow < candleData.Low ? lastLow : candleData.low;
lastVolume = lastVolume + candleData.volume;

@@ -62,0 +69,0 @@ lastTimestamp = candleData.timestamp;

{
"name": "technicalindicators",
"version": "1.0.15",
"version": "1.0.16",
"description": "Techincal Indicators written in javascript",

@@ -5,0 +5,0 @@ "main": "dist/index.js",

@@ -88,3 +88,3 @@ [![Travis CI](https://img.shields.io/travis/anandanand84/technicalindicators.svg?style=flat-square)](https://travis-ci.org/anandanand84/technicalindicators)

15. [Triple Exponentially Smoothed Average (TRIX)](https://tonicdev.com/anandaravindan/trix "TRIX").
16. [Average Directional Index (ADX)](https://tonicdev.com/anandaravindan/adx "ADX").
16. [Average Directional Index (ADX)](https://github.com/anandanand84/technicalindicators/blob/master/test/directionalmovement/ADX.js "ADX").
17. [Commodity Channel Index (CCI)](https://github.com/anandanand84/technicalindicators/blob/master/test/oscillators/CCI.js "CCI").

@@ -91,0 +91,0 @@ 18. [Volume Weighted Average Price (VWAP)](https://github.com/anandanand84/technicalindicators/blob/master/test/volume/VWAP.js "VWAP").

@@ -58,16 +58,24 @@ import { CandleData, CandleList } from '../StockData';

}
if(Math.abs(candleData.close - lastOpen) >= brickSize) {
let absoluteMovementFromClose = Math.abs(candleData.close - lastClose);
let absoluteMovementFromOpen = Math.abs(candleData.close - lastOpen);
if((absoluteMovementFromClose >= brickSize) && (absoluteMovementFromOpen >= brickSize)) {
let reference = absoluteMovementFromClose > absoluteMovementFromOpen ? lastOpen : lastClose
let calculated = <any>{
open : lastOpen,
open : reference,
high : lastHigh > candleData.high ? lastHigh : candleData.high,
low : lastLow < candleData.Low ? lastLow : candleData.low,
close : lastOpen > candleData.close ? (lastOpen - brickSize) : (lastOpen + brickSize),
close : reference > candleData.close ? (reference - brickSize) : (reference + brickSize),
volume : lastVolume + candleData.volume,
timestamp : candleData.timestamp
};
lastOpen = calculated.open;
lastHigh = calculated.close;
lastLow = calculated.close;
lastClose = calculated.close;
lastVolume = 0;
candleData = yield calculated
} else {
lastHigh = candleData.high;
lastLow = candleData.low;
lastClose = candleData.close;
lastHigh = lastHigh > candleData.high ? lastHigh : candleData.high;
lastLow = lastLow < candleData.Low ? lastLow : candleData.low;
lastVolume = lastVolume + candleData.volume;

@@ -74,0 +82,0 @@ lastTimestamp = candleData.timestamp;

@@ -16,7 +16,7 @@ "use strict"

//var inputRSI = {
// values : [45.8433,46.0826,45.8931,46.0328,45.6140,46.2820,46.2820,46.0028,46.0328,46.4116,46.2222,45.6439, 46.2122,46.2521,45.7137,46.4515,45.7835,45.3548,44.0288,44.1783,44.2181,44.5672,43.4205,42.6628,43.1314],
//have issue with this input
// var inputRSI = {
// values : [[ 294435, 294435, 294435, 294500, 294500, 294500, 294520, 294539, 294539, 294600, 294600, 294600, 294600, 294600, 294700 ]],
// period : 14
//};
// };
//var expectedResult = [

@@ -23,0 +23,0 @@ // 70.53,66.32,66.55,69.41,66.36,57.97,62.93,63.26,56.06,62.38

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc