diff --git a/README.md b/README.md index a22aab0b..ddcd09ee 100644 --- a/README.md +++ b/README.md @@ -1,46 +1,40 @@ -[![Travis CI](https://img.shields.io/travis/anandanand84/technicalindicators.svg?style=flat-square)](https://travis-ci.org/anandanand84/technicalindicators) +[![Travis CI](https://img.shields.io/travis/rylorin/technicalindicators.svg?style=flat-square)](https://travis-ci.org/rylorin/technicalindicators) # TechnicalIndicators A javascript technical indicators written in typescript. - # Installation -## Node.js versions >= 10 +## Node.js versions >= 20 -``` bash +```bash npm install --save technicalindicators ``` -``` javascript -const SMA = require('technicalindicators').SMA; +```javascript +const SMA = require("technicalindicators").SMA; ``` -## Node.js versions < 10 - -For nodejs version below 10 use 1.x versions of this library. - ## Webpack Make sure you have the following in your config file. -``` javascript +```javascript module.exports = { - resolve: { - mainFields: ["module", "main"] - } -} - + resolve: { + mainFields: ["module", "main"], + }, +}; ``` ## Browser -For browsers install using npm, +For browsers install using npm, For ES6 browsers use -``` bash +```bash npm install --save technicalindicators ``` @@ -48,14 +42,14 @@ npm install --save technicalindicators ``` -For ES5 support it is necessary to include the babel-polyfill and respective file browser.js otherwise you will get an error. For example see [index.html](https://github.com/anandanand84/technicalindicators/blob/master/index.html "index.html") +For ES5 support it is necessary to include the babel-polyfill and respective file browser.js otherwise you will get an error. For example see [index.html](https://github.com/rylorin/technicalindicators/blob/master/index.html "index.html") -``` bash +```bash npm install --save technicalindicators npm install --save babel-polyfill ``` -``` html +```html ``` @@ -66,67 +60,65 @@ Pattern detection is removed from version 3.0, if you need pattern detection use All indicators will be available in window object. So you can just use -``` javascript -sma({period : 5, values : [1,2,3,4,5,6,7,8,9], reversedInput : true}); +```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]}); +```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://rylorin.github.io/technicalindicators/ "Playground") # Available Indicators 1. [Accumulation Distribution Line (ADL)](https://tonicdev.com/anandaravindan/adl "ADL"). -1. [Average Directional Index (ADX)](https://github.com/anandanand84/technicalindicators/blob/master/test/directionalmovement/ADX.js "ADX"). +1. [Average Directional Index (ADX)](https://github.com/rylorin/technicalindicators/blob/master/test/directionalmovement/ADX.js "ADX"). 1. [Average True Range (ATR)](https://tonicdev.com/anandaravindan/atr "ATR"). -1. [Awesome Oscillator (AO)](https://github.com/anandanand84/technicalindicators/blob/master/test/oscillators/AwesomeOscillator.js "AO"). +1. [Awesome Oscillator (AO)](https://github.com/rylorin/technicalindicators/blob/master/test/oscillators/AwesomeOscillator.js "AO"). 1. [Bollinger Bands (BB)](https://tonicdev.com/anandaravindan/bb "BB"). -1. [Commodity Channel Index (CCI)](https://github.com/anandanand84/technicalindicators/blob/master/test/oscillators/CCI.js "CCI"). -1. [Force Index (FI)](https://github.com/anandanand84/technicalindicators/blob/master/test/volume/ForceIndex.js "FI"). +1. [Commodity Channel Index (CCI)](https://github.com/rylorin/technicalindicators/blob/master/test/oscillators/CCI.js "CCI"). +1. [Force Index (FI)](https://github.com/rylorin/technicalindicators/blob/master/test/volume/ForceIndex.js "FI"). 1. [Know Sure Thing (KST)](https://tonicdev.com/anandaravindan/kst "KST"). -1. [Moneyflow Index (MFI)](https://github.com/anandanand84/technicalindicators/blob/master/test/volume/MFI.js "MFI"). +1. [Moneyflow Index (MFI)](https://github.com/rylorin/technicalindicators/blob/master/test/volume/MFI.js "MFI"). 1. [Moving Average Convergence Divergence (MACD)](https://tonicdev.com/anandaravindan/macd "MACD"). 1. [On Balance Volume (OBV)](https://tonicdev.com/anandaravindan/obv "OBV"). -1. [Parabolic Stop and Reverse (PSAR)](https://github.com/anandanand84/technicalindicators/blob/master/test/momentum/PSAR.js "PSAR"). +1. [Parabolic Stop and Reverse (PSAR)](https://github.com/rylorin/technicalindicators/blob/master/test/momentum/PSAR.js "PSAR"). 1. [Rate of Change (ROC)](https://tonicdev.com/anandaravindan/roc "ROC"). 1. [Relative Strength Index (RSI)](https://tonicdev.com/anandaravindan/rsi "RSI"). 1. [Simple Moving Average (SMA)](https://tonicdev.com/anandaravindan/sma "SMA"). 1. [Stochastic Oscillator (KD)](https://tonicdev.com/anandaravindan/stochastic "KD"). 1. [Stochastic RSI (StochRSI)](https://tonicdev.com/anandaravindan/stochasticrsi "StochRSI"). 1. [Triple Exponentially Smoothed Average (TRIX)](https://tonicdev.com/anandaravindan/trix "TRIX"). -1. [Typical Price](https://github.com/anandanand84/technicalindicators/blob/master/test/chart_types/TypicalPrice.js "Typical Price"). -1. [Volume Weighted Average Price (VWAP)](https://github.com/anandanand84/technicalindicators/blob/master/test/volume/VWAP.js "VWAP"). -1. [Volume Profile (VP)](https://github.com/anandanand84/technicalindicators/blob/master/test/volume/VolumeProfile.js "VP"). +1. [Typical Price](https://github.com/rylorin/technicalindicators/blob/master/test/chart_types/TypicalPrice.js "Typical Price"). +1. [Volume Weighted Average Price (VWAP)](https://github.com/rylorin/technicalindicators/blob/master/test/volume/VWAP.js "VWAP"). +1. [Volume Profile (VP)](https://github.com/rylorin/technicalindicators/blob/master/test/volume/VolumeProfile.js "VP"). 1. [Exponential Moving Average (EMA)](https://tonicdev.com/anandaravindan/ema "EMA"). 1. [Weighted Moving Average (WMA)](https://tonicdev.com/anandaravindan/wma "WMA"). 1. [Wilder’s Smoothing (Smoothed Moving Average, WEMA)](https://tonicdev.com/anandaravindan/wema "WEMA"). 1. [WilliamsR (W%R)](https://tonicdev.com/anandaravindan/williamsr "W%R"). -1. [Ichimoku Cloud](https://github.com/anandanand84/technicalindicators/blob/master/test/ichimoku/IchimokuCloud.js "Ichimoku Cloud"). +1. [Ichimoku Cloud](https://github.com/rylorin/technicalindicators/blob/master/test/ichimoku/IchimokuCloud.js "Ichimoku Cloud"). # Other Utils -1. [Average Gain](https://github.com/anandanand84/technicalindicators/blob/master/test/Utils/AverageGain.js "") -1. [Average Loss](https://github.com/anandanand84/technicalindicators/blob/master/test/Utils/AverageLoss.js "") -1. [Cross Up](https://github.com/anandanand84/technicalindicators/blob/master/test/Utils/CrossUp.js "") -1. [Cross Down](https://github.com/anandanand84/technicalindicators/blob/master/test/Utils/CrossDown.js "") -1. [Cross Over](https://github.com/anandanand84/technicalindicators/blob/master/test/Utils/CrossOver.js "") -1. [Highest](https://github.com/anandanand84/technicalindicators/blob/master/test/Utils/Highest.js "") -1. [Lowest](https://github.com/anandanand84/technicalindicators/blob/master/test/Utils/Lowest.js "") -1. [Standard Deviation](https://github.com/anandanand84/technicalindicators/blob/master/test/Utils/SD.js "") -1. [Sum](https://github.com/anandanand84/technicalindicators/blob/master/test/Utils/Sum.js "") - +1. [Average Gain](https://github.com/rylorin/technicalindicators/blob/master/test/Utils/AverageGain.js) +1. [Average Loss](https://github.com/rylorin/technicalindicators/blob/master/test/Utils/AverageLoss.js) +1. [Cross Up](https://github.com/rylorin/technicalindicators/blob/master/test/Utils/CrossUp.js) +1. [Cross Down](https://github.com/rylorin/technicalindicators/blob/master/test/Utils/CrossDown.js) +1. [Cross Over](https://github.com/rylorin/technicalindicators/blob/master/test/Utils/CrossOver.js) +1. [Highest](https://github.com/rylorin/technicalindicators/blob/master/test/Utils/Highest.js) +1. [Lowest](https://github.com/rylorin/technicalindicators/blob/master/test/Utils/Lowest.js) +1. [Standard Deviation](https://github.com/rylorin/technicalindicators/blob/master/test/Utils/SD.js) +1. [Sum](https://github.com/rylorin/technicalindicators/blob/master/test/Utils/Sum.js) # Chart Types -1. [Renko (renko)](https://github.com/anandanand84/technicalindicators/blob/master/test/chart_types/Renko.js) -1. [Heikin-Ashi (HA)](https://github.com/anandanand84/technicalindicators/blob/master/test/chart_types/HeikinAshi.js) - +1. [Renko (renko)](https://github.com/rylorin/technicalindicators/blob/master/test/chart_types/Renko.js) +1. [Heikin-Ashi (HA)](https://github.com/rylorin/technicalindicators/blob/master/test/chart_types/HeikinAshi.js) # CandleStick Pattern @@ -170,21 +162,19 @@ or Search for all bullish or bearish using - -``` javascript +```javascript var twoDayBullishInput = { - open: [23.25,15.36], - high: [25.10,30.87], - close: [21.44,27.89], - low: [20.82,14.93], -} + open: [23.25, 15.36], + high: [25.1, 30.87], + close: [21.44, 27.89], + low: [20.82, 14.93], +}; -var bullish = require('technicalindicators').bullish; +var bullish = require("technicalindicators").bullish; -bullish(twoDayBullishInput) //true +bullish(twoDayBullishInput); //true ``` - # API There are three ways you can use to get the indicator results. @@ -193,33 +183,32 @@ There are three ways you can use to get the indicator results. 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; -var prices = [1,2,3,4,5,6,7,8,9,10,12,13,15]; +```javascript +const sma = require("technicalindicators").sma; +var prices = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 13, 15]; var period = 10; -sma({period : period, values : prices}) +sma({ period: period, values: prices }); ``` or -``` javascript -const SMA = require('technicalindicators').SMA; -var prices = [1,2,3,4,5,6,7,8,9,10,12,13,15]; +```javascript +const SMA = require("technicalindicators").SMA; +var prices = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 13, 15]; var period = 10; -SMA.calculate({period : period, values : prices}) +SMA.calculate({ period: period, values: prices }); ``` ## nextValue `nextValue` method is used to get the next indicator value. -``` javascript -var sma = new SMA({period : period, values : []}); +```javascript +var sma = new SMA({ period: period, values: [] }); var results = []; -prices.forEach(price => { - var result = sma.nextValue(price); - if(result) - results.push(result) +prices.forEach((price) => { + var result = sma.nextValue(price); + if (result) results.push(result); }); ``` @@ -233,8 +222,8 @@ This a merge of calculate and nextValue. The usual use case would be 1. Use nextValue to get next indicator values for further tick. - ``` javascript - var sma = new SMA({period : period, values : prices}); + ```javascript + var sma = new SMA({ period: period, values: prices }); sma.getResult(); // [5.5, 6.6, 7.7, 8.9] sma.nextValue(16); // 10.1 ``` @@ -245,11 +234,10 @@ This a merge of calculate and nextValue. The usual use case would be This uses regular javascript numbers, so there can be rounding errors which are negligible for a technical indicators, you can set precision by using the below config. By default there is no precision set. - ``` javascript - const technicalIndicators = require('technicalindicators'); - technicalIndicators.setConfig('precision', 10); - ``` - +```javascript +const technicalIndicators = require("technicalindicators"); +technicalIndicators.setConfig("precision", 10); +``` # Contribute @@ -259,7 +247,7 @@ Create issues about anything you want to report, change of API's, or request for Typescript: Use typescript 2.0.0 other you might get max call stack reached error. -``` npm install -g typescript@2.0.0 ``` +`npm install -g typescript@2.0.0` 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: @@ -273,15 +261,15 @@ gyp: Call to './util/has_lib.sh freetype' returned exit status 0 while in bindin ## Setup -``` bash -git clone git@github.com:anandanand84/technicalindicators.git # or use your fork +```bash +git clone git@github.com:rylorin/technicalindicators.git # or use your fork cd technicalindicators npm run start ``` ## Running tests and getting coverage -``` bash +```bash npm test npm run cover ``` @@ -296,18 +284,13 @@ npm run cover 1. Add indicator it to keywords in `package.json` and `bower.json` 1. Send a Pull Request. - ## Verify Documentation -``` bash +```bash node testdocs.js open "http://localhost:5444/testdocs.html" ``` - # Donate -1. XRB: `xrb_1shh8i77upiq4bjzi3ajik9ofq14bbcucshoapi3m7f8d74dc5k31o56yj5r` -1. ETH: `0x0B56580Eb25f3F7e366dDA697161d314C17Bcb6a` -1. LTC: `LLTUhKBRKs9sbW9F8MFQm7VVdZ1dJnXzGc` -1. BTC: `1FGeJHoj7tjeLrm4JNtyPWTdBKPJjcqP6Y` -1. BCH: `1AUFc8CEfHVjnoixbqTbX62WV8DZkpC1DU` + +1. ETH: `0xb35272Da8a98cd894eE661CAc356bE2F50f91f47` diff --git a/build.sh b/build.sh index be444f91..def635a7 100755 --- a/build.sh +++ b/build.sh @@ -5,5 +5,5 @@ docker run -it \ -v $(pwd)/dist:/src/dist \ -v $(pwd)/lib:/src/lib \ -v $(pwd)/declarations:/src/declarations \ -nenjotsu/technicalindicators \ +rylorin/technicalindicators \ npm -- run build-lib \ No newline at end of file diff --git a/dist/custom.d.ts b/dist/custom.d.ts index cbdc8932..c7500f02 100644 --- a/dist/custom.d.ts +++ b/dist/custom.d.ts @@ -1,25 +1,3 @@ -declare class AvgLossInput extends IndicatorInput { - values: number[]; - period: number; -} -declare class AverageLoss extends Indicator { - generator: IterableIterator; - constructor(input: AvgLossInput); - static calculate: typeof averageloss; - nextValue(price: number): number | undefined; -} -declare function averageloss(input: AvgLossInput): number[]; -declare class AvgGainInput extends IndicatorInput { - period: number; - values: number[]; -} -declare class AverageGain extends Indicator { - generator: IterableIterator; - constructor(input: AvgGainInput); - static calculate: typeof averagegain; - nextValue(price: number): number | undefined; -} -declare function averagegain(input: AvgGainInput): number[]; declare class VWAPInput extends IndicatorInput { high: number[]; low: number[]; @@ -34,43 +12,19 @@ declare class VWAP extends Indicator { nextValue(price: CandleData): number; } declare function vwap(input: VWAPInput): number[]; -declare class KeltnerChannelsInput extends IndicatorInput { - maPeriod: number; - atrPeriod: number; - useSMA: boolean; - multiplier: number; - high: number[]; - low: number[]; +declare class ForceIndexInput extends IndicatorInput { close: number[]; + volume: number[]; + period: number; } -declare class KeltnerChannelsOutput extends IndicatorInput { - middle: number; - upper: number; - lower: number; -} -declare class KeltnerChannels extends Indicator { - result: KeltnerChannelsOutput[]; - generator: IterableIterator; - constructor(input: KeltnerChannelsInput); - static calculate: typeof keltnerchannels; - nextValue(price: KeltnerChannelsInput): KeltnerChannelsOutput | undefined; -} -declare function keltnerchannels(input: KeltnerChannelsInput): KeltnerChannelsOutput[]; -/** - * Created by AAravindan on 5/4/16. - */ -declare class RenkoInput extends IndicatorInput { - period?: number; - brickSize?: number; - useATR?: boolean; - low?: number[]; - open?: number[]; - volume?: number[]; - high?: number[]; - close?: number[]; - timestamp?: number[]; +declare class ForceIndex extends Indicator { + result: number[]; + generator: IterableIterator; + constructor(input: ForceIndexInput); + static calculate: typeof forceindex; + nextValue(price: CandleData): number | undefined; } -declare function renko(input: RenkoInput): CandleList; +declare function forceindex(input: ForceIndexInput): number[]; /** * Created by AAravindan on 5/4/16. */ @@ -90,6 +44,46 @@ declare class HeikinAshi extends Indicator { nextValue(price: CandleData): CandleData | undefined; } declare function heikinashi(input: HeikinAshiInput): CandleList; +declare class VolumeProfileInput extends IndicatorInput { + high: number[]; + open: number[]; + low: number[]; + close: number[]; + volume: number[]; + noOfBars: number; +} +declare class VolumeProfileOutput { + rangeStart: number; + rangeEnd: number; + bullishVolume: number; + bearishVolume: number; +} +declare function priceFallsBetweenBarRange(low: any, high: any, low1: any, high1: any): boolean; +declare class VolumeProfile extends Indicator { + generator: IterableIterator; + constructor(input: VolumeProfileInput); + static calculate: typeof volumeprofile; + nextValue(price: CandleData): number | undefined; +} +declare function volumeprofile(input: VolumeProfileInput): number[]; +declare class ChandelierExitInput extends IndicatorInput { + period: number; + multiplier: number; + high: number[]; + low: number[]; + close: number[]; +} +declare class ChandelierExitOutput extends IndicatorInput { + exitLong: number; + exitShort: number; +} +declare class ChandelierExit extends Indicator { + generator: IterableIterator; + constructor(input: ChandelierExitInput); + static calculate: typeof chandelierexit; + nextValue(price: ChandelierExitInput): ChandelierExitOutput | undefined; +} +declare function chandelierexit(input: ChandelierExitInput): number[]; /** * Calcaultes the fibonacci retracements for given start and end points * @@ -103,6 +97,17 @@ declare function heikinashi(input: HeikinAshiInput): CandleList; * @returns {number[]} */ declare function fibonacciretracement(start: number, end: number): number[]; +declare class AvgLossInput extends IndicatorInput { + values: number[]; + period: number; +} +declare class AverageLoss extends Indicator { + generator: IterableIterator; + constructor(input: AvgLossInput); + static calculate: typeof averageloss; + nextValue(price: number): number | undefined; +} +declare function averageloss(input: AvgLossInput): number[]; declare class IchimokuCloudInput extends IndicatorInput { high: number[]; low: number[]; @@ -125,59 +130,54 @@ declare class IchimokuCloud extends Indicator { nextValue(price: CandleData): IchimokuCloudOutput; } declare function ichimokucloud(input: IchimokuCloudInput): IchimokuCloudOutput[]; -declare class ChandelierExitInput extends IndicatorInput { - period: number; +declare class KeltnerChannelsInput extends IndicatorInput { + maPeriod: number; + atrPeriod: number; + useSMA: boolean; multiplier: number; high: number[]; low: number[]; close: number[]; } -declare class ChandelierExitOutput extends IndicatorInput { - exitLong: number; - exitShort: number; -} -declare class ChandelierExit extends Indicator { - generator: IterableIterator; - constructor(input: ChandelierExitInput); - static calculate: typeof chandelierexit; - nextValue(price: ChandelierExitInput): ChandelierExitOutput | undefined; -} -declare function chandelierexit(input: ChandelierExitInput): number[]; -declare class VolumeProfileInput extends IndicatorInput { - high: number[]; - open: number[]; - low: number[]; - close: number[]; - volume: number[]; - noOfBars: number; +declare class KeltnerChannelsOutput extends IndicatorInput { + middle: number; + upper: number; + lower: number; } -declare class VolumeProfileOutput { - rangeStart: number; - rangeEnd: number; - bullishVolume: number; - bearishVolume: number; +declare class KeltnerChannels extends Indicator { + result: KeltnerChannelsOutput[]; + generator: IterableIterator; + constructor(input: KeltnerChannelsInput); + static calculate: typeof keltnerchannels; + nextValue(price: KeltnerChannelsInput): KeltnerChannelsOutput | undefined; } -declare function priceFallsBetweenBarRange(low: any, high: any, low1: any, high1: any): boolean; -declare class VolumeProfile extends Indicator { - generator: IterableIterator; - constructor(input: VolumeProfileInput); - static calculate: typeof volumeprofile; - nextValue(price: CandleData): number | undefined; +declare function keltnerchannels(input: KeltnerChannelsInput): KeltnerChannelsOutput[]; +/** + * Created by AAravindan on 5/4/16. + */ +declare class RenkoInput extends IndicatorInput { + period?: number; + brickSize?: number; + useATR?: boolean; + low?: number[]; + open?: number[]; + volume?: number[]; + high?: number[]; + close?: number[]; + timestamp?: number[]; } -declare function volumeprofile(input: VolumeProfileInput): number[]; -declare class ForceIndexInput extends IndicatorInput { - close: number[]; - volume: number[]; +declare function renko(input: RenkoInput): CandleList; +declare class AvgGainInput extends IndicatorInput { period: number; + values: number[]; } -declare class ForceIndex extends Indicator { - result: number[]; +declare class AverageGain extends Indicator { generator: IterableIterator; - constructor(input: ForceIndexInput); - static calculate: typeof forceindex; - nextValue(price: CandleData): number | undefined; + constructor(input: AvgGainInput); + static calculate: typeof averagegain; + nextValue(price: number): number | undefined; } -declare function forceindex(input: ForceIndexInput): number[]; +declare function averagegain(input: AvgGainInput): number[]; class StockData { open: number[]; high: number[]; @@ -242,6 +242,16 @@ declare class Indicator { static reverseInputs(input: any): void; getResult(): any; } +declare class EMA extends Indicator { + period: number; + price: number[]; + result: number[]; + generator: IterableIterator; + constructor(input: MAInput); + static calculate: typeof ema; + nextValue(price: number): number; +} +declare function ema(input: MAInput): number[]; declare class MAInput extends IndicatorInput { period: number; values: number[]; @@ -271,17 +281,6 @@ declare class ATR extends Indicator { nextValue(price: CandleData): number | undefined; } declare function atr(input: ATRInput): number[]; -declare class EMA extends Indicator { - period: number; - price: number[]; - result: number[]; - generator: IterableIterator; - constructor(input: MAInput); - static calculate: typeof ema; - nextValue(price: number): number; -} -declare function ema(input: MAInput): number[]; -declare function format(v: number): number; declare class LinkedList { private _head; private _tail; @@ -302,6 +301,7 @@ declare class LinkedList { resetCursor(): this; next(): any; } +declare function format(v: number): number; declare class WEMA extends Indicator { period: number; price: number[]; diff --git a/package.json b/package.json index 16fd0e71..1952c9ab 100644 --- a/package.json +++ b/package.json @@ -129,7 +129,7 @@ "mocha": "^10.3.0", "monaco-editor": "^0.47.0", "rimraf": "^5.0.5", - "rollup": "^2.0.0", + "rollup": "^2.79.1", "rollup-plugin-commonjs": "^10.1.0", "rollup-plugin-ignore": "^1.0.3", "rollup-plugin-node-builtins": "^2.1.2", diff --git a/rollup.js b/rollup.js index cd51c7da..b82b0769 100644 --- a/rollup.js +++ b/rollup.js @@ -44,14 +44,15 @@ async function doBuild() { }), ], external: ["@babel/polyfill"], + strictDeprecations: true, }); await bundle.write({ banner: "/* APP */", // dest: "dist/browser.js", - output: { file: "dist/browser.js" }, + output: { file: "dist/browser.js", name: "window" }, format: "iife", - moduleName: "window", + // moduleName: "window", globals: { "@babel/polyfill": "window", }, @@ -115,14 +116,15 @@ async function doBuild() { }), ], external: ["@babel/polyfill"], + strictDeprecations: true, }); await customBundle.write({ banner: "/* APP */", // dest: "dist/custom.js", - output: { file: "dist/custom.js" }, + output: { file: "dist/custom.js", name: "window" }, format: "iife", - moduleName: "window", + // moduleName: "window", globals: { "@babel/polyfill": "window", }, @@ -149,14 +151,15 @@ async function doBuild() { }), ], external: ["@babel/polyfill"], + strictDeprecations: true, }); await bundleES6.write({ banner: "/* APP */", // dest: "dist/browser.es6.js", - output: { file: "dist/browser.es6.js" }, + output: { file: "dist/browser.es6.js", name: "window" }, format: "iife", - moduleName: "window", + // moduleName: "window", globals: { "@babel/polyfill": "window", }, @@ -165,6 +168,7 @@ async function doBuild() { let bundleNode = await rollup({ input: "index.js", external: ["@babel/polyfill"], + strictDeprecations: true, }); await bundleNode.write({ diff --git a/test.sh b/test.sh index 9f98b50e..078fba93 100755 --- a/test.sh +++ b/test.sh @@ -4,4 +4,4 @@ docker run -it \ -v $(pwd)/dist:/src/dist \ -v $(pwd)/lib:/src/lib \ -v $(pwd)/declarations:/src/declarations \ -anandanand84/technicalindicators \ No newline at end of file +rylorin/technicalindicators \ No newline at end of file diff --git a/tf_model/group1-shard1of1 b/tf_model/group1-shard1of1 deleted file mode 100644 index 770c10ad..00000000 Binary files a/tf_model/group1-shard1of1 and /dev/null differ diff --git a/tf_model/model.json b/tf_model/model.json deleted file mode 100644 index f05b3c34..00000000 --- a/tf_model/model.json +++ /dev/null @@ -1 +0,0 @@ -{"modelTopology": {"training_config": {"metrics": [], "loss": "categorical_crossentropy", "optimizer_config": {"class_name": "SGD", "config": {"nesterov": true, "lr": 0.009999999776482582, "momentum": 0.8999999761581421, "decay": 9.999999974752427e-07}}, "sample_weight_mode": null, "loss_weights": null}, "keras_version": "2.2.2", "model_config": {"class_name": "Sequential", "config": [{"class_name": "Dense", "config": {"kernel_initializer": {"class_name": "VarianceScaling", "config": {"distribution": "uniform", "scale": 1.0, "seed": null, "mode": "fan_avg"}}, "name": "dense_1", "kernel_constraint": null, "bias_regularizer": null, "bias_constraint": null, "dtype": "float32", "activation": "relu", "trainable": true, "kernel_regularizer": null, "bias_initializer": {"class_name": "Zeros", "config": {}}, "units": 256, "batch_input_shape": [null, 400], "use_bias": true, "activity_regularizer": null}}, {"class_name": "Dropout", "config": {"rate": 0.25, "noise_shape": null, "trainable": true, "seed": null, "name": "dropout_1"}}, {"class_name": "Dense", "config": {"kernel_initializer": {"class_name": "VarianceScaling", "config": {"distribution": "uniform", "scale": 1.0, "seed": null, "mode": "fan_avg"}}, "name": "dense_2", "kernel_constraint": null, "bias_regularizer": null, "bias_constraint": null, "activation": "relu", "trainable": true, "kernel_regularizer": null, "bias_initializer": {"class_name": "Zeros", "config": {}}, "units": 256, "use_bias": true, "activity_regularizer": null}}, {"class_name": "Dropout", "config": {"rate": 0.25, "noise_shape": null, "trainable": true, "seed": null, "name": "dropout_2"}}, {"class_name": "Dense", "config": {"kernel_initializer": {"class_name": "VarianceScaling", "config": {"distribution": "uniform", "scale": 1.0, "seed": null, "mode": "fan_avg"}}, "name": "dense_3", "kernel_constraint": null, "bias_regularizer": null, "bias_constraint": null, "activation": "relu", "trainable": true, "kernel_regularizer": null, "bias_initializer": {"class_name": "Zeros", "config": {}}, "units": 256, "use_bias": true, "activity_regularizer": null}}, {"class_name": "Dropout", "config": {"rate": 0.25, "noise_shape": null, "trainable": true, "seed": null, "name": "dropout_3"}}, {"class_name": "Dense", "config": {"kernel_initializer": {"class_name": "VarianceScaling", "config": {"distribution": "uniform", "scale": 1.0, "seed": null, "mode": "fan_avg"}}, "name": "dense_4", "kernel_constraint": null, "bias_regularizer": null, "bias_constraint": null, "activation": "relu", "trainable": true, "kernel_regularizer": null, "bias_initializer": {"class_name": "Zeros", "config": {}}, "units": 256, "use_bias": true, "activity_regularizer": null}}, {"class_name": "Dropout", "config": {"rate": 0.25, "noise_shape": null, "trainable": true, "seed": null, "name": "dropout_4"}}, {"class_name": "Dense", "config": {"kernel_initializer": {"class_name": "VarianceScaling", "config": {"distribution": "uniform", "scale": 1.0, "seed": null, "mode": "fan_avg"}}, "name": "dense_5", "kernel_constraint": null, "bias_regularizer": null, "bias_constraint": null, "activation": "relu", "trainable": true, "kernel_regularizer": null, "bias_initializer": {"class_name": "Zeros", "config": {}}, "units": 256, "use_bias": true, "activity_regularizer": null}}, {"class_name": "Dropout", "config": {"rate": 0.5, "noise_shape": null, "trainable": true, "seed": null, "name": "dropout_5"}}, {"class_name": "Dense", "config": {"kernel_initializer": {"class_name": "VarianceScaling", "config": {"distribution": "uniform", "scale": 1.0, "seed": null, "mode": "fan_avg"}}, "name": "dense_6", "kernel_constraint": null, "bias_regularizer": null, "bias_constraint": null, "activation": "softmax", "trainable": true, "kernel_regularizer": null, "bias_initializer": {"class_name": "Zeros", "config": {}}, "units": 6, "use_bias": true, "activity_regularizer": null}}]}, "backend": "tensorflow"}, "weightsManifest": [{"paths": ["group1-shard1of1"], "weights": [{"dtype": "float32", "shape": [400, 256], "name": "dense_1/kernel"}, {"dtype": "float32", "shape": [256], "name": "dense_1/bias"}, {"dtype": "float32", "shape": [256, 256], "name": "dense_2/kernel"}, {"dtype": "float32", "shape": [256], "name": "dense_2/bias"}, {"dtype": "float32", "shape": [256, 256], "name": "dense_3/kernel"}, {"dtype": "float32", "shape": [256], "name": "dense_3/bias"}, {"dtype": "float32", "shape": [256, 256], "name": "dense_4/kernel"}, {"dtype": "float32", "shape": [256], "name": "dense_4/bias"}, {"dtype": "float32", "shape": [256, 256], "name": "dense_5/kernel"}, {"dtype": "float32", "shape": [256], "name": "dense_5/bias"}, {"dtype": "float32", "shape": [256, 6], "name": "dense_6/kernel"}, {"dtype": "float32", "shape": [6], "name": "dense_6/bias"}]}]} \ No newline at end of file diff --git a/yarn.lock b/yarn.lock index 725403ca..886dfff0 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5123,7 +5123,7 @@ rollup-watch@^4.3.1: require-relative "0.8.7" rollup-pluginutils "^2.0.1" -rollup@^2.0.0: +rollup@^2.79.1: version "2.79.1" resolved "https://registry.yarnpkg.com/rollup/-/rollup-2.79.1.tgz#bedee8faef7c9f93a2647ac0108748f497f081c7" integrity sha512-uKxbd0IhMZOhjAiD5oAFp7BqvkA4Dv47qpOCtaNvng4HBwdbWtdOh8f5nZNuk2rp51PMGk3bzfWu5oayNEuYnw==