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.16 to 1.0.17

.editorconfig

3

declarations/index.d.ts

@@ -18,2 +18,5 @@ export { sma, SMA } from './moving_averages/SMA';

export { trix, TRIX } from './momentum/TRIX';
export { forceindex, ForceIndex } from './volume/ForceIndex';
export { cci, CCI } from './oscillators/CCI';
export { vwap, VWAP } from './volume/VWAP';
export { averagegain, AverageGain } from './Utils/AverageGain';

@@ -20,0 +23,0 @@ export { averageloss, AverageLoss } from './Utils/AverageLoss';

4

dist/browser.js

@@ -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 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||{});
!function(e){"use strict";function t(e,t){ne[e]=t}function r(e){return ne[e]}function n(e){var t=r("precision");return t?parseFloat(e.toPrecision(t)):e}function o(e){le.reverseInputs(e);var t=new ve(e).result;return e.reversedInput&&t.reverse(),le.reverseInputs(e),t}function i(e){le.reverseInputs(e);var t=new pe(e).result;return e.reversedInput&&t.reverse(),le.reverseInputs(e),t}function a(e){le.reverseInputs(e);var t=new fe(e).result;return e.reversedInput&&t.reverse(),le.reverseInputs(e),t}function u(e){le.reverseInputs(e);var t=new ge(e).result;return e.reversedInput&&t.reverse(),le.reverseInputs(e),t}function s(e){le.reverseInputs(e);var t=new de(e).result;return e.reversedInput&&t.reverse(),le.reverseInputs(e),t}function l(e){le.reverseInputs(e);var t=new _e(e).result;return e.reversedInput&&t.reverse(),le.reverseInputs(e),t}function c(e){le.reverseInputs(e);var t=new we(e).result;return e.reversedInput&&t.reverse(),le.reverseInputs(e),t}function h(e){le.reverseInputs(e);var t=new xe(e).result;return e.reversedInput&&t.reverse(),le.reverseInputs(e),t}function v(e){le.reverseInputs(e);var t=new be(e).result;return e.reversedInput&&t.reverse(),le.reverseInputs(e),t}function p(e){le.reverseInputs(e);var t=new ye(e).result;return e.reversedInput&&t.reverse(),le.reverseInputs(e),t}function f(e){le.reverseInputs(e);var t=new ke(e).result;return e.reversedInput&&t.reverse(),le.reverseInputs(e),t}function g(e){le.reverseInputs(e);var t=new Ie(e).result;return e.reversedInput&&t.reverse(),le.reverseInputs(e),t}function d(e){le.reverseInputs(e);var t=new je(e).result;return e.reversedInput&&t.reverse(),le.reverseInputs(e),t}function _(e){le.reverseInputs(e);var t=new Re(e).result;return e.reversedInput&&t.reverse(),le.reverseInputs(e),t}function w(e){le.reverseInputs(e);var t=new Ve(e).result;return e.reversedInput&&t.reverse(),le.reverseInputs(e),t}function x(e){le.reverseInputs(e);var t=new Ce(e).result;return e.reversedInput&&t.reverse(),le.reverseInputs(e),t}function m(e){le.reverseInputs(e);var t=new qe(e).result;return e.reversedInput&&t.reverse(),le.reverseInputs(e),t}function b(e){le.reverseInputs(e);var t=new Ee(e).result;return e.reversedInput&&t.reverse(),le.reverseInputs(e),t}function y(e){le.reverseInputs(e);var t=new Me(e).result;return e.reversedInput&&t.reverse(),le.reverseInputs(e),t}function k(e){le.reverseInputs(e);var t=new Se(e).result;return e.reversedInput&&t.reverse(),le.reverseInputs(e),t}function O(e){le.reverseInputs(e);var t=new Ae(e).result;return e.reversedInput&&t.reverse(),le.reverseInputs(e),t}function P(e){le.reverseInputs(e);var t=new ze(e).result;return e.reversedInput&&t.reverse(),le.reverseInputs(e),t}function I(e){le.reverseInputs(e);var t=new Le(e).result;return e.reversedInput&&t.reverse(),le.reverseInputs(e),t}function j(e){le.reverseInputs(e);var t=new De(e).result;return e.reversedInput&&t.reverse(),le.reverseInputs(e),t}function R(e){le.reverseInputs(e);var t=new Be(e).result;return e.reversedInput&&(t.open.reverse(),t.high.reverse(),t.low.reverse(),t.close.reverse(),t.volume.reverse(),t.timestamp.reverse()),le.reverseInputs(e),t}function V(e){le.reverseInputs(e);var t=new Te(e).result;return e.reversedInput&&(t.open.reverse(),t.high.reverse(),t.low.reverse(),t.close.reverse(),t.volume.reverse(),t.timestamp.reverse()),le.reverseInputs(e),t}function C(e){return(new Ne).hasPattern(e)}function q(e){return(new We).hasPattern(e)}function E(e){return(new Ge).hasPattern(e)}function M(e){return(new Xe).hasPattern(e)}function S(e){return(new Ke).hasPattern(e)}function A(e){return(new Je).hasPattern(e)}function z(e){return(new Qe).hasPattern(e)}function L(e){return(new Ue).hasPattern(e)}function D(e){return(new Ye).hasPattern(e)}function H(e){return(new Ze).hasPattern(e)}function B(e){return(new et).hasPattern(e)}function T(e){return(new tt).hasPattern(e)}function F(e){return(new rt).hasPattern(e)}function N(e){return(new nt).hasPattern(e)}function W(e){return(new ot).hasPattern(e)}function G(e){return(new it).hasPattern(e)}function X(e){return(new at).hasPattern(e)}function K(e){return(new ut).hasPattern(e)}function J(e){return(new lt).hasPattern(e)}function Q(e){return(new ct).hasPattern(e)}function U(e){return(new ht).hasPattern(e)}function Y(e){return(new vt).hasPattern(e)}function Z(e){return(new pt).hasPattern(e)}function $(e){return(new ft).hasPattern(e)}function ee(e){return(new gt).hasPattern(e)}function te(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 re(){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("cci"),e.push("forceindex"),e.push("vwap"),e.push("renko"),e.push("heikinashi"),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 ne={},oe=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},ie=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}}(),ae=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)},ue=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},se=function e(){oe(this,e)},le=function(){function e(t){oe(this,e),this.format=t.format||n}return ie(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}(),ce=function e(t,r,n){oe(this,e),this.next=n,n&&(n.prev=this),this.prev=r,r&&(r.next=this),this.data=t},he=function(){function e(){oe(this,e),this._length=0}return ie(e,[{key:"push",value:function(e){this._tail=new ce(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 ce(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}(),ve=(function(e){function t(e,r){oe(this,t);var n=ue(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return n.period=e,n.values=r,n}ae(t,e)}(se),function(e){function t(e){oe(this,t);var r=ue(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 he,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 ae(t,e),ie(t,[{key:"nextValue",value:function(e){var t=this.generator.next(e).value;if(void 0!=t)return this.format(t)}}]),t}(le));ve.calculate=o;var pe=function(e){function t(e){oe(this,t);var r,n=ue(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e)),o=e.period,i=e.values,a=2/(o+1);n.result=[],r=new ve({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 ae(t,e),ie(t,[{key:"nextValue",value:function(e){var t=this.generator.next(e).value;if(void 0!=t)return this.format(t)}}]),t}(le);pe.calculate=i;var fe=function(e){function t(e){oe(this,t);var r=ue(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 he,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 ae(t,e),ie(t,[{key:"nextValue",value:function(e){var t=this.generator.next(e).value;if(void 0!=t)return this.format(t)}}]),t}(le);fe.calculate=a;var ge=function(e){function t(e){oe(this,t);var r,n=ue(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e)),o=e.period,i=e.values,a=1/o;n.result=[],r=new ve({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 ae(t,e),ie(t,[{key:"nextValue",value:function(e){var t=this.generator.next(e).value;if(void 0!=t)return this.format(t)}}]),t}(le);ge.calculate=u;var de=(function(e){function t(e,r){oe(this,t);var n=ue(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return n.period=e,n.values=r,n.SimpleMAOscillator=!0,n.SimpleMASignal=!0,n}ae(t,e)}(se),function(e){function t(e){oe(this,t);var r=ue(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e)),n=e.SimpleMAOscillator?ve:pe,o=e.SimpleMASignal?ve:pe,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,l,c,h,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,h=i.nextValue(n),v=a.nextValue(n),r++,t.abrupt("continue",1);case 10:return h&&v&&(o=h-v,l=u.nextValue(o)),c=o-l,t.next=14,{MACD:s(o),signal:l?s(l):void 0,histogram:isNaN(c)?void 0:s(c)};case 14:n=t.sent,h=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 ae(t,e),ie(t,[{key:"nextValue",value:function(e){return this.generator.next(e).value}}]),t}(le));de.calculate=s;var _e=(function(e){function t(){return oe(this,t),ue(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}ae(t,e)}(se),function(e){function t(e){oe(this,t);var r=ue(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 ae(t,e),ie(t,[{key:"nextValue",value:function(e){return this.generator.next(e).value}}]),t}(le));_e.calculate=l;var we=(function(e){function t(){return oe(this,t),ue(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}ae(t,e)}(se),function(e){function t(e){oe(this,t);var r=ue(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 ae(t,e),ie(t,[{key:"nextValue",value:function(e){return this.generator.next(e).value}}]),t}(le));we.calculate=c;var xe=(function(e){function t(){return oe(this,t),ue(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}ae(t,e)}(se),function(e){function t(e){oe(this,t);var r=ue(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e)),n=e.period,o=e.values,i=new _e({period:n,values:[]}),a=new we({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 ae(t,e),ie(t,[{key:"nextValue",value:function(e){return this.generator.next(e).value}}]),t}(le));xe.calculate=h;var me=function(e){function t(e,r,n){oe(this,t);var o=ue(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 ae(t,e),ie(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}(he),be=(function(e){function t(){return oe(this,t),ue(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}ae(t,e)}(se),function(e){function t(e){oe(this,t);var r=ue(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e)),n=e.period,o=e.values,i=new ve({period:n,values:[],format:function(e){return e}});return r.result=[],r.generator=regeneratorRuntime.mark(function e(){var t,r,o,a,u,s,l,c,h,v,p;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return o=new me(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,l=!1,c=void 0,e.prev=13,h=o.iterator()[Symbol.iterator]();!(s=(v=h.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),l=!0,c=e.t0;case 21:e.prev=21,e.prev=22,!s&&h.return&&h.return();case 24:if(e.prev=24,!l){e.next=27;break}throw c;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 ae(t,e),ie(t,[{key:"nextValue",value:function(e){var t=this.generator.next(e);if(void 0!=t.value)return this.format(t.value)}}]),t}(le));be.calculate=v;var ye=(function(e){function t(){return oe(this,t),ue(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}ae(t,e)}(se),function(e){function t(){return oe(this,t),ue(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}ae(t,e)}(se),function(e){function t(e){oe(this,t);var r,n,o=ue(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 ve({period:i,values:[],format:function(e){return e}}),n=new be({period:i,values:[],format:function(e){return e}}),o.generator=regeneratorRuntime.mark(function e(){var t,o,i,a,l,c,h,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&&(l=s(i),c=s(i+a*u),h=s(i-a*u),v=s((o-h)/(c-h)),t={middle:l,upper:c,lower:h,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 ae(t,e),ie(t,[{key:"nextValue",value:function(e){return this.generator.next(e).value}}]),t}(le));ye.calculate=p;var ke=function(e){function t(e){oe(this,t);var r=ue(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 he,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 ae(t,e),ie(t,[{key:"nextValue",value:function(e){var t=this.generator.next(e).value;if(void 0!=t)return this.format(t)}}]),t}(le);ke.calculate=f;var Oe=(function(e){function t(){return oe(this,t),ue(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}ae(t,e)}(se),function(e){function t(e){oe(this,t);var r=ue(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 ae(t,e),ie(t,[{key:"nextValue",value:function(e){return this.generator.next(e).value}}],[{key:"calculate",value:function(e){le.reverseInputs(e);var r=new t(e).result;return e.reversedInput&&r.reverse(),le.reverseInputs(e),r}}]),t}(le)),Pe=(function(e){function t(){return oe(this,t),ue(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}ae(t,e)}(se),function(e){function t(e){oe(this,t);var r=ue(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 ae(t,e),ie(t,[{key:"nextValue",value:function(e){return this.generator.next(e).value}}],[{key:"calculate",value:function(e){le.reverseInputs(e);var r=new t(e).result;return e.reversedInput&&r.reverse(),le.reverseInputs(e),r}}]),t}(le)),Ie=(function(e){function t(){return oe(this,t),ue(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}ae(t,e)}(se),function(e){function t(e){oe(this,t);var r=ue(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 ae(t,e),ie(t,[{key:"nextValue",value:function(e){return this.generator.next(e).value}}]),t}(le));Ie.calculate=g;var je=(function(e){function t(){return oe(this,t),ue(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}ae(t,e)}(se),function(e){function t(){return oe(this,t),ue(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}ae(t,e)}(se),function(e){function t(e){oe(this,t);var r=ue(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 Pe({high:[],low:[]}),l=new Oe({high:[],low:[]}),c=new ke({period:a,values:[],format:function(e){return e}}),h=new ke({period:a,values:[],format:function(e){return e}}),v=new ke({period:a,values:[],format:function(e){return e}}),p=new ge({period:a,values:[],format:function(e){return e}}),f=new Ie({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=l.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=c.nextValue(w),y=h.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 ae(t,e),ie(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}(le));je.calculate=d;var Re=(function(e){function t(){return oe(this,t),ue(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}ae(t,e)}(se),function(e){function t(e){oe(this,t);var r=ue(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 Ie({low:[],high:[],close:[]}),l=new ge({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:l.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 ae(t,e),ie(t,[{key:"nextValue",value:function(e){return this.generator.next(e).value}}]),t}(le));Re.calculate=_;var Ve=(function(e){function t(){return oe(this,t),ue(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}ae(t,e)}(se),function(e){function t(e){oe(this,t);var r=ue(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 me(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 ae(t,e),ie(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}(le));Ve.calculate=w;var Ce=(function(e){function t(){return oe(this,t),ue(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}ae(t,e)}(se),function(e){function t(e){oe(this,t);var r=ue(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,l=e.SMAROCPer2,c=e.SMAROCPer3,h=e.SMAROCPer4,v=e.signalPeriod,p=new Ve({period:o,values:[]}),f=new Ve({period:i,values:[]}),g=new Ve({period:a,values:[]}),d=new Ve({period:u,values:[]}),_=new ve({period:s,values:[],format:function(e){return e}}),w=new ve({period:l,values:[],format:function(e){return e}}),x=new ve({period:c,values:[],format:function(e){return e}}),m=new ve({period:h,values:[],format:function(e){return e}}),b=new ve({period:v,values:[],format:function(e){return e}}),y=r.format;r.result=[];var k=Math.max(o+s,i+l,a+c,u+h);return r.generator=regeneratorRuntime.mark(function e(){var t,r,n,o,i,a,u,s,l,c,h,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,l=void 0;case 6:return c=p.nextValue(r),h=f.nextValue(r),v=g.nextValue(r),O=d.nextValue(r),o=void 0!==c?_.nextValue(c):void 0,i=void 0!==h?w.nextValue(h):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,l=void 0!==n?{kst:y(n),signal:s?y(s):void 0}:void 0,e.next=20,l;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 ae(t,e),ie(t,[{key:"nextValue",value:function(e){var t=this.generator.next(e);if(void 0!=t.value)return t.value}}]),t}(le));Ce.calculate=x;var qe=(function(e){function t(){return oe(this,t),ue(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}ae(t,e)}(se),function(e){function t(e){oe(this,t);var r=ue(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,l,c,h;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return t=1,r=new me(a,!0,!1),n=new me(a,!1,!0),o=new ve({period:u,values:[],format:function(e){return e}}),i=void 0,l=void 0,void(e.next=7);case 7:c=e.sent;case 8:if(r.push(c.high),n.push(c.low),!(t<a)){e.next=17;break}return t++,void(e.next=15);case 15:return c=e.sent,e.abrupt("continue",8);case 17:return h=n.periodLow,
i=(c.close-h)/(r.periodHigh-h)*100,l=o.nextValue(i),e.next=22,{k:s(i),d:l?s(l):void 0};case 22:c=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 ae(t,e),ie(t,[{key:"nextValue",value:function(e){var t=this.generator.next(e);if(void 0!==t.value)return t.value}}]),t}(le));qe.calculate=m;var Ee=(function(e){function t(){return oe(this,t),ue(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}ae(t,e)}(se),function(e){function t(e){oe(this,t);var r=ue(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,l;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return t=1,r=new me(a,!0,!1),n=new me(a,!1,!0),o=void 0,i=void 0,void(e.next=7);case 7:s=e.sent,l=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,l=u((i-s.close)/(i-o)*-100),e.next=23,l;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 ae(t,e),ie(t,[{key:"nextValue",value:function(e){var t=this.generator.next(e);if(void 0!=t.value)return this.format(t.value)}}]),t}(le));Ee.calculate=b;var Me=(function(e){function t(){return oe(this,t),ue(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}ae(t,e)}(se),function(e){function t(e){oe(this,t);var r=ue(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 ae(t,e),ie(t,[{key:"nextValue",value:function(e){return this.generator.next(e).value}}]),t}(le));Me.calculate=y;var Se=(function(e){function t(){return oe(this,t),ue(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}ae(t,e)}(se),function(e){function t(e){oe(this,t);var r=ue(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 ae(t,e),ie(t,[{key:"nextValue",value:function(e){return this.generator.next(e).value}}]),t}(le));Se.calculate=k;var Ae=(function(e){function t(){return oe(this,t),ue(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}ae(t,e)}(se),function(e){function t(e){oe(this,t);var r=ue(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e)),n=e.values,o=e.period,i=r.format,a=new pe({period:o,values:[],format:function(e){return e}}),u=new pe({period:o,values:[],format:function(e){return e}}),s=new pe({period:o,values:[],format:function(e){return e}}),l=new Ve({period:1,values:[],format:function(e){return e}});return r.result=[],r.generator=regeneratorRuntime.mark(function e(){var t,r,n,o,c;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,c=o?l.nextValue(o):void 0,e.next=10,c?i(c):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 ae(t,e),ie(t,[{key:"nextValue",value:function(e){var t=this.generator.next(e);if(void 0!==t.value)return t.value}}]),t}(le));Ae.calculate=O;var ze=(function(e){function t(){oe(this,t);var e=ue(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments));return e.period=1,e}ae(t,e)}(se),function(e){function t(e){oe(this,t);var r=ue(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e)),n=e.close,o=e.volume,i=e.period||1;if(o.length!==n.length)throw"Inputs(volume, close) not of equal size";var a=new pe({values:[],period:i});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:return t=e.sent,void(e.next=5);case 5:r=e.sent,n=void 0;case 7:return n=(r.close-t.close)*r.volume,t=r,e.next=12,a.nextValue(n);case 12:r=e.sent,e.next=7;break;case 15:case"end":return e.stop()}},e,this)})(),r.generator.next(),o.forEach(function(e,t){var i=r.generator.next({close:n[t],volume:o[t]});void 0!=i.value&&r.result.push(i.value)}),r}return ae(t,e),ie(t,[{key:"nextValue",value:function(e){var t=this.generator.next(e).value;if(void 0!=t)return t}}]),t}(le));ze.calculate=P;var Le=(function(e){function t(){return oe(this,t),ue(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}ae(t,e)}(se),function(e){function t(e){oe(this,t);var r=ue(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e)),n=e.low,o=e.high,i=e.close,a=e.period,u=(r.format,new me(a)),s=new ve({period:a,values:[],format:function(e){return e}});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,l,c,h,v,p,f;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(r=(t.high+t.low+t.close)/3,u.push(r),n=s.nextValue(r),o=null,i=void 0,a=0,void 0==n){e.next=32;break}for(l=!0,c=!1,h=void 0,e.prev=14,v=u.iterator()[Symbol.iterator]();!(l=(p=v.next()).done);l=!0)f=p.value,a+=Math.abs(f-n);e.next=22;break;case 18:e.prev=18,e.t0=e.catch(14),c=!0,h=e.t0;case 22:e.prev=22,e.prev=23,!l&&v.return&&v.return();case 25:if(e.prev=25,!c){e.next=28;break}throw h;case 28:return e.finish(25);case 29:return e.finish(22);case 30:o=a/20,i=(r-n)/(.015*o);case 32:return e.next=34,i;case 34:t=e.sent,e.next=3;break;case 37:case"end":return e.stop()}},e,this,[[14,18,22,30],[23,,25,29]])})(),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 ae(t,e),ie(t,[{key:"nextValue",value:function(e){var t=this.generator.next(e).value;if(void 0!=t)return t}}]),t}(le));Le.calculate=I;var De=(function(e){function t(){return oe(this,t),ue(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}ae(t,e)}(se),function(e){function t(e){oe(this,t);var r=ue(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e)),n=e.low,o=e.high,i=e.close,a=e.volume;e.period,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,a;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=void 0;case 6:return i=(t.high+t.low+t.close)/3,a=t.volume*i,r+=a,n+=t.volume,e.next=13,r/n;case 13:t=e.sent,e.next=6;break;case 17:case"end":return e.stop()}},e,this)})(),r.generator.next(),n.forEach(function(e,t){var u=r.generator.next({high:o[t],low:n[t],close:i[t],volume:a[t]});void 0!=u.value&&r.result.push(u.value)}),r}return ae(t,e),ie(t,[{key:"nextValue",value:function(e){var t=this.generator.next(e).value;if(void 0!=t)return t}}]),t}(le));De.calculate=j;var He=function e(){oe(this,e),this.open=[],this.high=[],this.low=[],this.close=[],this.volume=[],this.timestamp=[]},Be=(function(e){function t(){return oe(this,t),ue(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}ae(t,e)}(se),function(e){function t(e){oe(this,t);var r=ue(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 He,0===o)return console.error("Not enough data to calculate brickSize for renko when using ATR"),ue(r);var a=0,u=0,s=1/0,l=0,c=0,h=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,l=t.close,c=t.volume,h=t.timestamp,void(e.next=13);case 13:return t=e.sent,e.abrupt("continue",3);case 15:if(r=Math.abs(t.close-l),n=Math.abs(t.close-a),!(r>=o&&n>=o)){e.next=30;break}return i=r>n?a:l,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:c+t.volume,timestamp:t.timestamp},a=v.open,u=v.close,s=v.close,l=v.close,c=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,c+=t.volume,h=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 ae(t,e),ie(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}(le));Be.calculate=R;var Te=(function(e){function t(){return oe(this,t),ue(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}ae(t,e)}(se),function(e){function t(e){oe(this,t);var r=ue(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));r.format;r.result=new He;var n=null,o=0,i=1/0,a=0,u=0,s=0;return r.generator=regeneratorRuntime.mark(function e(){var t,r,l,c,h,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}):(l=(t.close+t.open+t.high+t.low)/4,c=(n+a)/2,h=Math.max(c,l,t.high),v=Math.min(t.low,c,l),r={close:l,open:c,high:h,low:v,volume:t.volume||0,timestamp:t.timestamp||0},a=l,n=c,o=h,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 ae(t,e),ie(t,[{key:"nextValue",value:function(e){return this.generator.next(e).value}}]),t}(le));Te.calculate=V;var Fe=function(){function e(){oe(this,e)}return ie(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}(),Ne=function(e){function t(){oe(this,t);var e=ue(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return e.name="MorningStar",e.requiredCount=3,e}return ae(t,e),ie(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],l=(e.high[2],e.low[2],(t+r)/2),c=r<t,h=n>a&&n>i,v=u<s,p=i<n&&a<n&&u>i&&o<u,f=s>l;return c&&h&&p&&v&&f}}]),t}(Fe),We=function(e){function t(){oe(this,t);var e=ue(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return e.name="BullishEngulfingPattern",e.requiredCount=2,e}return ae(t,e),ie(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}(Fe),Ge=function(e){function t(){oe(this,t);var e=ue(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return e.requiredCount=2,e.name="BullishHarami",e}return ae(t,e),ie(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}(Fe),Xe=function(e){function t(){oe(this,t);var e=ue(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return e.requiredCount=2,e.name="BullishHaramiCross",e}return ae(t,e),ie(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,l=this.approximateEqual(o,i);return s&&l}}]),t}(Fe),Ke=function(e){function t(){oe(this,t);var e=ue(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return e.name="Doji",e.requiredCount=1,e}return ae(t,e),ie(t,[{key:"logic",value:function(e){var t=e.open[0],r=e.close[0];return this.approximateEqual(t,r)}}]),t}(Fe),Je=function(e){function t(){oe(this,t);var e=ue(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return e.name="MorningDojiStar",e.requiredCount=3,e}return ae(t,e),ie(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],l=e.close[2],c=(e.high[2],e.low[2],(t+r)/2),h=r<t,v=(new Ke).hasPattern({open:[o],close:[i],high:[a],low:[u]}),p=s<l,f=a<n&&u<n&&s>a&&i<s,g=l>c;return h&&v&&p&&f&&g}}]),t}(Fe),Qe=function(e){function t(){oe(this,t);var e=ue(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return e.requiredCount=3,e.name="DownsideTasukiGap",e}return ae(t,e),ie(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],l=(e.high[2],e.low[2],r<t),c=i<o,h=s>u,v=a<n,p=o>u&&i<u&&s>o&&s<r;return l&&c&&h&&v&&p}}]),t}(Fe),Ue=function(e){function t(){oe(this,t);var e=ue(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return e.name="BullishMarubozu",e.requiredCount=1,e}return ae(t,e),ie(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}(Fe),Ye=function(e){function t(){oe(this,t);var e=ue(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return e.requiredCount=2,e.name="PiercingLine",e}return ae(t,e),ie(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,l=r<t,c=i>o,h=n>o&&i>u;return s&&l&&h&&c}}]),t}(Fe),Ze=function(e){function t(){oe(this,t);var e=ue(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return e.name="ThreeWhiteSoldiers",e.requiredCount=3,e}return ae(t,e),ie(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],l=e.high[2],c=(e.low[2],a>n&&l>a),h=t<r&&o<i&&u<s,v=r>o&&o<n&&a>u&&u<i;return c&&h&&v}}]),t}(Fe),$e=[new We,new Qe,new Ge,new Xe,new Je,new Ne,new Ue,new Ye,new Ze],et=function(e){function t(){oe(this,t);var e=ue(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return e.name="Bullish Candlesticks",e}return ae(t,e),ie(t,[{key:"hasPattern",value:function(e){return $e.reduce(function(t,r){var n=r.hasPattern(e);return n&&console.log("Matched pattern ",r.name),t||n},!1)}}]),t}(Fe),tt=function(e){function t(){oe(this,t);var e=ue(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return e.name="BearishEngulfingPattern",e.requiredCount=2,e}return ae(t,e),ie(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}(Fe),rt=function(e){function t(){oe(this,t);var e=ue(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return e.requiredCount=2,e.name="BearishHarami",e}return ae(t,e),ie(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}(Fe),nt=function(e){function t(){oe(this,t);var e=ue(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return e.requiredCount=2,e.name="BearishHaramiCross",e}return ae(t,e),ie(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,l=this.approximateEqual(o,i);return s&&l}}]),t}(Fe),ot=function(e){function t(){oe(this,t);var e=ue(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return e.name="EveningDojiStar",e.requiredCount=3,e}return ae(t,e),ie(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],l=e.close[2],c=(e.high[2],e.low[2],(t+r)/2),h=r>t,v=(new Ke).hasPattern({open:[o],close:[i],high:[a],low:[u]}),p=s>l,f=a>n&&u>n&&s<u&&i>s,g=l<c;return h&&v&&f&&p&&g}}]),t}(Fe),it=function(e){function t(){oe(this,t);var e=ue(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return e.name="EveningStar",e.requiredCount=3,e}return ae(t,e),ie(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],l=(e.high[2],e.low[2],(t+r)/2),c=r>t,h=n<a&&n<i,v=u>s,p=i>n&&a>n&&u<a&&o>u,f=s<l;return c&&h&&p&&v&&f}}]),t}(Fe),at=function(e){function t(){oe(this,t);var e=ue(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return e.name="BearishMarubozu",e.requiredCount=1,e}return ae(t,e),ie(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}(Fe),ut=function(e){function t(){oe(this,t);var e=ue(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return e.name="ThreeBlackCrows",e.requiredCount=3,e}return ae(t,e),ie(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],l=(e.high[2],e.low[2]),c=n>a&&a>l,h=t>r&&o>i&&u>s,v=t>o&&o>r&&o>u&&u>i;return c&&h&&v}}]),t}(Fe),st=[new tt,new rt,new nt,new ot,new it,new at,new ut],lt=function(e){function t(){oe(this,t);var e=ue(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return e.name="Bearish Candlesticks",e}return ae(t,e),ie(t,[{key:"hasPattern",value:function(e){return st.reduce(function(t,r){return t||r.hasPattern(e)},!1)}}]),t}(Fe),ct=function(e){function t(){oe(this,t);var e=ue(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return e.name="AbandonedBaby",e.requiredCount=3,e}return ae(t,e),ie(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],l=e.close[2],c=e.high[2],h=e.low[2],v=r<t,p=(new Ke).hasPattern({open:[o],close:[i],high:[a],low:[u]}),f=a<n&&h>a&&l>s,g=c<t;return v&&p&&f&&g}}]),t}(Fe),ht=function(e){function t(){oe(this,t);var e=ue(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return e.name="DarkCloudCover",e.requiredCount=2,e}return ae(t,e),ie(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,l=o>n&&i<a&&i>t;return u&&s&&l}}]),t}(Fe),vt=function(e){function t(){oe(this,t);var e=ue(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return e.requiredCount=1,e.name="DragonFlyDoji",e}return ae(t,e),ie(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}(Fe),pt=function(e){function t(){oe(this,t);var e=ue(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return e.requiredCount=1,e.name="GraveStoneDoji",e}return ae(t,e),ie(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}(Fe),ft=function(e){function t(){oe(this,t);var e=ue(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return e.name="BullishSpinningTop",e.requiredCount=1,e}return ae(t,e),ie(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}(Fe),gt=function(e){function t(){oe(this,t);var e=ue(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return e.name="BearishSpinningTop",e.requiredCount=1,e}return ae(t,e),ie(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}(Fe);e.getAvailableIndicators=re,e.sma=o,e.SMA=ve,e.ema=i,e.EMA=pe,e.wma=a,e.WMA=fe,e.wema=u,e.WEMA=ge,e.macd=s,e.MACD=de,e.rsi=h,e.RSI=xe,e.bollingerbands=p,e.BollingerBands=ye,e.adx=d,e.ADX=je,e.atr=_,e.ATR=Re,e.truerange=g,e.TrueRange=Ie,e.roc=w,e.ROC=Ve,e.kst=x,e.KST=Ce,e.stochastic=m,e.Stochastic=qe,e.williamsr=b,e.WilliamsR=Ee,e.adl=y,e.ADL=Me,e.obv=k,e.OBV=Se,e.trix=O,e.TRIX=Ae,e.forceindex=P,e.ForceIndex=ze,e.cci=I,e.CCI=Le,e.vwap=j,e.VWAP=De,e.averagegain=l,e.AverageGain=_e,e.averageloss=c,e.AverageLoss=we,e.sd=v,e.SD=be,e.renko=R,e.HeikinAshi=Te,e.heikinashi=V,e.bullish=B,e.bearish=J,e.abandonedbaby=Q,e.doji=S,e.bearishengulfingpattern=T,e.bullishengulfingpattern=q,e.darkcloudcover=U,e.downsidetasukigap=z,e.dragonflydoji=Y,e.gravestonedoji=Z,e.bullishharami=E,e.bearishharami=F,e.bullishharamicross=M,e.bearishharamicross=N,e.eveningdojistar=W,e.eveningstar=G,e.morningdojistar=A,e.morningstar=C,e.bullishmarubozu=L,e.bearishmarubozu=X,e.piercingline=D,e.bullishspinningtop=$,e.bearishspinningtop=ee,e.threeblackcrows=K,e.threewhitesoldiers=H,e.fibonacciretracement=te,e.setConfig=t,e.getConfig=r}(this.window=this.window||{});
//# sourceMappingURL=browser.js.map

@@ -21,2 +21,9 @@ export * from './lib/index.js';

AvailableIndicators.push('trix');
AvailableIndicators.push('cci');
AvailableIndicators.push('forceindex');
AvailableIndicators.push('vwap');
AvailableIndicators.push('renko');
AvailableIndicators.push('heikinashi');
AvailableIndicators.push('averagegain');

@@ -23,0 +30,0 @@ AvailableIndicators.push('averageloss');

@@ -18,2 +18,5 @@ export { sma, SMA } from './moving_averages/SMA';

export { trix, TRIX } from './momentum/TRIX';
export { forceindex, ForceIndex } from './volume/ForceIndex';
export { cci, CCI } from './oscillators/CCI';
export { vwap, VWAP } from './volume/VWAP';
export { averagegain, AverageGain } from './Utils/AverageGain';

@@ -20,0 +23,0 @@ export { averageloss, AverageLoss } from './Utils/AverageLoss';

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

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

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

# Installation
## Nodejs
## Node.js versions >= 6.4
```
npm install --save babel-polyfill
``` bash
npm install --save technicalindicators
```
### node usage above 6.4
```
``` javascript
const SMA = require('technicalindicators').SMA;
```
### node usage below 6.4
## Node.js versions < 6.4
``` bash
npm install --save babel-polyfill
npm install --save technicalindicators
```
require('babel-polyfill);
``` javascript
require('babel-polyfill');
const SMA = require('technicalindicators/dist/browser').SMA;
```
## Webpack

@@ -33,3 +37,3 @@

```
``` javascript
module.exports = {

@@ -47,3 +51,3 @@ resolve: {

```
``` bash
npm install --save technicalindicators

@@ -54,3 +58,3 @@ npm install --save babel-polyfill

```
``` html
<script src="node_modules/babel-polyfill/browser.js"></script>

@@ -62,66 +66,72 @@ <script src="bower_components/technicalindicators/browser.js"></script>

```
``` javascript
sma({period : 5, values : [1,2,3,4,5,6,7,8,9], reversedInput : true});
```
or
```
``` javascript
SMA.calculate({period : 5, values : [1,2,3,4,5,6,7,8,9]});
```
# Playground
[Playground with code completion](http://anandanand84.github.io/technicalindicators/ "Playground")
[Playground with code completion](http://anandanand84.github.io/technicalindicators/ "Playground")
# Available Indicators
1. [Simple Moving Average (SMA)](https://tonicdev.com/anandaravindan/sma "SMA").
2. [Exponential Moving Average (EMA)](https://tonicdev.com/anandaravindan/ema "EMA").
3. [Weighted Moving Average (WMA)](https://tonicdev.com/anandaravindan/wma "WMA").
4. [Moving Average Convergence Divergence (MACD)](https://tonicdev.com/anandaravindan/macd "MACD").
5. [Bollinger Bands (BB)](https://tonicdev.com/anandaravindan/bb "BB").
6. [Average True Range (ATR)](https://tonicdev.com/anandaravindan/atr "ATR").
7. [Relative Strength Index (RSI)](https://tonicdev.com/anandaravindan/rsi "RSI").
8. [Wilder’s Smoothing (Smoothed Moving Average, WEMA)](https://tonicdev.com/anandaravindan/wema "WEMA").
9. [Rate of Change (ROC)](https://tonicdev.com/anandaravindan/roc "ROC").
10. [Know Sure Thing (KST)](https://tonicdev.com/anandaravindan/kst "KST").
11. [Stochastic Oscillator (KD)](https://tonicdev.com/anandaravindan/stochastic "KD").
12. [WilliamsR (W%R)](https://tonicdev.com/anandaravindan/williamsr "W%R").
13. [Accumulation Distribution Line (ADL)](https://tonicdev.com/anandaravindan/adl "ADL").
14. [On Balance Volume (OBV)](https://tonicdev.com/anandaravindan/obv "OBV").
15. [Triple Exponentially Smoothed Average (TRIX)](https://tonicdev.com/anandaravindan/trix "TRIX").
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").
18. [Volume Weighted Average Price (VWAP)](https://github.com/anandanand84/technicalindicators/blob/master/test/volume/VWAP.js "VWAP").
19. [Force Index (FI)](https://github.com/anandanand84/technicalindicators/blob/master/test/volume/ForceIndex.js "VWAP").
1. [Exponential Moving Average (EMA)](https://tonicdev.com/anandaravindan/ema "EMA").
1. [Weighted Moving Average (WMA)](https://tonicdev.com/anandaravindan/wma "WMA").
1. [Moving Average Convergence Divergence (MACD)](https://tonicdev.com/anandaravindan/macd "MACD").
1. [Bollinger Bands (BB)](https://tonicdev.com/anandaravindan/bb "BB").
1. [Average True Range (ATR)](https://tonicdev.com/anandaravindan/atr "ATR").
1. [Relative Strength Index (RSI)](https://tonicdev.com/anandaravindan/rsi "RSI").
1. [Wilder’s Smoothing (Smoothed Moving Average, WEMA)](https://tonicdev.com/anandaravindan/wema "WEMA").
1. [Rate of Change (ROC)](https://tonicdev.com/anandaravindan/roc "ROC").
1. [Know Sure Thing (KST)](https://tonicdev.com/anandaravindan/kst "KST").
1. [Stochastic Oscillator (KD)](https://tonicdev.com/anandaravindan/stochastic "KD").
1. [WilliamsR (W%R)](https://tonicdev.com/anandaravindan/williamsr "W%R").
1. [Accumulation Distribution Line (ADL)](https://tonicdev.com/anandaravindan/adl "ADL").
1. [On Balance Volume (OBV)](https://tonicdev.com/anandaravindan/obv "OBV").
1. [Triple Exponentially Smoothed Average (TRIX)](https://tonicdev.com/anandaravindan/trix "TRIX").
1. [Average Directional Index (ADX)](https://github.com/anandanand84/technicalindicators/blob/master/test/directionalmovement/ADX.js "ADX").
1. [Commodity Channel Index (CCI)](https://github.com/anandanand84/technicalindicators/blob/master/test/oscillators/CCI.js "CCI").
1. [Volume Weighted Average Price (VWAP)](https://github.com/anandanand84/technicalindicators/blob/master/test/volume/VWAP.js "VWAP").
1. [Force Index (FI)](https://github.com/anandanand84/technicalindicators/blob/master/test/volume/ForceIndex.js "VWAP").
# Chart Types
1. [Renko (renko)](https://github.com/anandanand84/technicalindicators/blob/master/test/chart_types/Renko.js)
2. [Heikin-Ashi (HA)](https://github.com/anandanand84/technicalindicators/blob/master/test/chart_types/HeikinAshi.js)
1. [Heikin-Ashi (HA)](https://github.com/anandanand84/technicalindicators/blob/master/test/chart_types/HeikinAshi.js)
# CandleStick Pattern
1. [Abandoned Baby](https://runkit.com/aarthiaradhana/abandonedbaby).
2. [Bearish Engulfing Pattern](https://runkit.com/aarthiaradhana/bearishengulfingpattern).
3. [Bullish Engulfiing Pattern](https://runkit.com/aarthiaradhana/bullishengulfingpattern).
4. [Dark Cloud Cover](https://runkit.com/aarthiaradhana/darkcloudcover).
5. [Downside Tasuki Gap](https://runkit.com/aarthiaradhana/downsidetasukigap).
6. [Doji](https://runkit.com/aarthiaradhana/doji).
7. [DragonFly Doji](https://runkit.com/aarthiaradhana/dragonflydoji).
8. [GraveStone Doji](https://runkit.com/aarthiaradhana/gravestonedoji).
9. [BullishHarami](https://runkit.com/aarthiaradhana/bullishharami).
10. [Bearish Harami Cross](https://runkit.com/aarthiaradhana/bearishharamicross).
11. [Bullish Harami Cross](https://runkit.com/aarthiaradhana/bullishharamicross).
12. [Bullish Marubozu](https://runkit.com/aarthiaradhana/bullishmarubozu).
13. [Bearish Marubozu](https://runkit.com/aarthiaradhana/bearishmarubozu).
14. [Evening Doji Star](https://runkit.com/aarthiaradhana/eveningdojistar).
15. [Evening Star](https://runkit.com/aarthiaradhana/eveningstar).
16. [Bearish Harami](https://runkit.com/aarthiaradhana/bearishharami).
17. [Piercing Line](https://runkit.com/aarthiaradhana/piercingline).
18. [Bullish Spinning Top](https://runkit.com/aarthiaradhana/bullishspinningtop).
19. [Bearish Spinning Top](https://runkit.com/aarthiaradhana/bearishspinningtop).
20. [Morning Doji Star](https://runkit.com/aarthiaradhana/morningdojistar).
21. [Morning Star](https://runkit.com/aarthiaradhana/morningstar).
22. [Three Black Crows](https://runkit.com/aarthiaradhana/threeblackcrows).
23. [Three White Soldiers](https://runkit.com/aarthiaradhana/threewhitesoldiers).
1. [Bearish Engulfing Pattern](https://runkit.com/aarthiaradhana/bearishengulfingpattern).
1. [Bullish Engulfiing Pattern](https://runkit.com/aarthiaradhana/bullishengulfingpattern).
1. [Dark Cloud Cover](https://runkit.com/aarthiaradhana/darkcloudcover).
1. [Downside Tasuki Gap](https://runkit.com/aarthiaradhana/downsidetasukigap).
1. [Doji](https://runkit.com/aarthiaradhana/doji).
1. [DragonFly Doji](https://runkit.com/aarthiaradhana/dragonflydoji).
1. [GraveStone Doji](https://runkit.com/aarthiaradhana/gravestonedoji).
1. [BullishHarami](https://runkit.com/aarthiaradhana/bullishharami).
1. [Bearish Harami Cross](https://runkit.com/aarthiaradhana/bearishharamicross).
1. [Bullish Harami Cross](https://runkit.com/aarthiaradhana/bullishharamicross).
1. [Bullish Marubozu](https://runkit.com/aarthiaradhana/bullishmarubozu).
1. [Bearish Marubozu](https://runkit.com/aarthiaradhana/bearishmarubozu).
1. [Evening Doji Star](https://runkit.com/aarthiaradhana/eveningdojistar).
1. [Evening Star](https://runkit.com/aarthiaradhana/eveningstar).
1. [Bearish Harami](https://runkit.com/aarthiaradhana/bearishharami).
1. [Piercing Line](https://runkit.com/aarthiaradhana/piercingline).
1. [Bullish Spinning Top](https://runkit.com/aarthiaradhana/bullishspinningtop).
1. [Bearish Spinning Top](https://runkit.com/aarthiaradhana/bearishspinningtop).
1. [Morning Doji Star](https://runkit.com/aarthiaradhana/morningdojistar).
1. [Morning Star](https://runkit.com/aarthiaradhana/morningstar).
1. [Three Black Crows](https://runkit.com/aarthiaradhana/threeblackcrows).
1. [Three White Soldiers](https://runkit.com/aarthiaradhana/threewhitesoldiers).

@@ -133,3 +143,3 @@ or

```js
``` javascript
var twoDayBullishInput = {

@@ -145,3 +155,2 @@ open: [23.25,15.36],

bullish(twoDayBullishInput) //true
```

@@ -156,4 +165,5 @@

Every indicator has a static method ```calculate``` which can be used to calculate the indicator without creating an object.
```javascript
Every indicator has a static method `calculate` which can be used to calculate the indicator without creating an object.
``` javascript
const sma = require('technicalindicators').sma;

@@ -164,5 +174,6 @@ var prices = [1,2,3,4,5,6,7,8,9,10,12,13,15];

```
or
```javascript
``` javascript
const SMA = require('technicalindicators').SMA;

@@ -176,5 +187,5 @@ var prices = [1,2,3,4,5,6,7,8,9,10,12,13,15];

```nextValue``` method is used to get the next indicator value.
`nextValue` method is used to get the next indicator value.
```javascript
``` javascript
var sma = new SMA({period : period, values : []});

@@ -193,16 +204,16 @@ var results = [];

1.Initialize indicator with available price value
1. Initialize indicator with available price value
2.Get results for initialized values
1. Get results for initialized values
3.Use nextValue to get next indicator values for further tick.
```javascript
var sma = new SMA({period : period, values : prices});
sma.getResult(); // [5.5, 6.6, 7.7, 8.9]
sma.nextValue(16); // 10.1
```
1. Use nextValue to get next indicator values for further tick.
Note: Calling nextValue will not update getResult() value.
``` javascript
var sma = new SMA({period : period, values : prices});
sma.getResult(); // [5.5, 6.6, 7.7, 8.9]
sma.nextValue(16); // 10.1
```
Note: Calling nextValue will not update getResult() value.
### Precision

@@ -212,3 +223,3 @@

```
``` javascript
const technicalIndicators = require('technicalindicators');

@@ -219,11 +230,2 @@ technicalIndicators.setConfig('precision', 10);

# Running tests and getting coverage
```
npm test
```
```
npm run cover
```
# Contribute

@@ -233,36 +235,52 @@

## Adding new indicators.
## Environment dependencies
1. Fork the project, clone it, run
TechnicalIndicators depends on the [`canvas` package](https://npmjs.com/canvas), which requires some dependencies to be installed. You can find the instructions to do that [here](https://github.com/Automattic/node-canvas#installation). If you do not install these dependencies, expect to get this error message during the installation of TechnicalIndicators:
```
> canvas@1.6.6 install /Users/balupton/Projects/trading/technicalindicators/node_modules/canvas
> node-gyp rebuild
./util/has_lib.sh: line 31: pkg-config: command not found
gyp: Call to './util/has_lib.sh freetype' returned exit status 0 while in binding.gyp. while trying to load binding.gyp
```
## Setup
``` bash
git clone git@github.com:anandanand84/technicalindicators.git # or use your fork
cd technicalindicators
npm install
```
```
gulp watch-test
```
2. Add tests for the indicator. Make it pass. It would be better if a sample of the stockcharts excel is used for the test case.
3. Add the indicator to the index.js
4. Run ```npm run build``` so it adds the indicator to the browser.js
5. Add it to read me, with the link to the tonicdev url containing the sample.
6. Add indicator it to keywords in package.json and bower.json
7. Send a pull request.
## Running tests and getting coverage
``` bash
npm test
npm run cover
```
# Verify Documentation
## Adding new indicators.
```
1. Add tests for the indicator. Make it pass. It would be better if a sample of the stockcharts excel is used for the test case.
1. Add the indicator to the index.js
1. Run `npm run build` so it adds the indicator to the browser.js
1. Add it to read me, with the link to the tonicdev url containing the sample.
1. Add indicator it to keywords in package.json and bower.json
1. Send a pull request.
## Verify Documentation
``` bash
node testdocs.js
open "http://localhost:5444/testdocs.html"
```
```
http://localhost:5444/testdocs.html
```
# Donate
BTC : 12eGmnhPrGuqvLNVnPddTaXm74hX68auTV
BTC: `12eGmnhPrGuqvLNVnPddTaXm74hX68auTV`

@@ -18,2 +18,5 @@ export { sma, SMA } from './moving_averages/SMA'

export { trix, TRIX } from './momentum/TRIX';
export { forceindex, ForceIndex } from './volume/ForceIndex';
export { cci, CCI } from './oscillators/CCI';
export { vwap, VWAP } from './volume/VWAP';

@@ -20,0 +23,0 @@ export { averagegain, AverageGain } from './Utils/AverageGain';

@@ -5,2 +5,3 @@ /**

var sma = require('../dist/index.js').sma;
var cci = require('../dist/index.js').cci;
var assert = require('assert');

@@ -7,0 +8,0 @@ var data = require('./data')

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