https://github.com/munrocket/ta-math
🔮 Technical analysis math. Indicators, overlays and correlation.
Science Score: 26.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
○DOI references
-
○Academic publication links
-
○Committers with academic emails
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (6.8%) to scientific vocabulary
Keywords
Keywords from Contributors
Repository
🔮 Technical analysis math. Indicators, overlays and correlation.
Basic Info
Statistics
- Stars: 192
- Watchers: 12
- Forks: 42
- Open Issues: 15
- Releases: 0
Topics
Metadata Files
README.md
Technical analysis math

Library for calculating technical indicators and overlays. You can choose format of price data from provider and library will return result. It distributed with Typescript and Javascript (ES6, ES5).

Check example with plotly library, ccxt data provider and BTC prices from Binance exchange.
Technical Overlays
| Function | Technical Overlay | Tested | Developed by | Year | |:----------|:--------------------------------------|:--------:|:------------------:|:----:| | bb | Bollinger Band | ✔️️ | John Bollinger | 1980s| | dema | Double Exponential Moving Average | ️ ✔️️ | Patrick Mulloy | 1994 | | ema | Exponential Moving Average | ✔️️ | | | | ebb | Exponential Bollinger Band | ✔️️ | Based on Welford's| | | hma | Hull Moving Average | ok | Alan Hull | 2005 | | keltner | Keltner Channels | ✔️️ | Chester Keltner | 1960 | | psar | Parabolic SAR | ❌ | Welles Wilder | 1978 | | sma | Simple Moving Average | ✔️️ | | | | tema | Triple Exponential Moving Average | ️ ✔️️ | Patrick Mulloy | 1994 | | vbp | Volume by Price | ✔️️ | | | | vwap | Volume Weighted Average Price | ✔️️ | James Elkins | 1984 | | wma | Weighted Moving Average | ️ok | John J. Murphy | 1999 | | zigzag | ZigZag Indicator | ✔️️ | Arthur Merrill | 1977 |
Technical Indicators
| Function | Technical Indicator | Tested | Developed by | Year | |:----------|:--------------------------------------|:-------:|:---------------------------------:|:----:| | adl | Accumulation / Distribution line | ✔️ | Marc Chaikin | 1970s| | atr | Average True Range | ✔️ | Welles Wilder | 1978 | | adx | Average Directional Index | ✔️ | Welles Wilder | 1978 | | ao | Awesome Oscillator | - | Bill Williams | | | ac | Accelerator Oscillator | - | Bill Williams | | | bbp | Bollinger Bands Percent Bandwidth %B | ok | | | | cci | Commodity Channel Index | ✔️ | Donald Lambert | 1980 | | cho | Chaikin Oscillator | ok | Marc Chaikin | | | expdev | Exponential Weighted Deviation | ✔️ | | | | fi | Force Index | ✔️ | | | | kst | Know Sure Thing | ✔️ | | | | macd | Moving Average Convergence/Divergence | ✔️ | Gerald Appel | 1979 | | madev | Mean Absolute Deviation | ✔️ | | | | mfi | Money Flow Index (volume-weighted RSI)| ✔️ | Gene Quong and Avrum Soudack | 1989 | | obv | On Balance Volume | ✔️ | Joseph Granville | 1963 | | roc | Rate-of-Change | ✔️ | | | | rsi | Relative Strength Index | ✔️ | Welles Wilder | 1978 | | stdev | Standard Deviation | ✔️️ | | | | stoch | Stochastic Oscillator (Slow/Fast/Full)| ✔️ | George Lane | 1950s| | stochRsi | Combines Stochastics with the RSI | ✔️ | Welles Wilder | 1994 | | vi | Vortex Indicator | ✔️ | Etienne Botes and Douglas Siepman | 2010 | | williams | Williams %R | ✔️ | | |
Error methods
| Function | Error methods | Tested | |:----------|:--------------------------------------|:-------:| | mae | Mean Absolute Error | ✔️ | | mape | Mean Absulute Percentage Error | ✔️ | | nrmse | Normalized Root-Mean-Square Error | ✔️ | | rmse | Root-Mean-Square Error | ✔️ |
Price transformations
| Function | Price transformation | Tested | |:-------------|:-----------------------------------|:-------:| | medianPrice | Median Price | - | | typicalPrice | Typical Price | ✔️ | | trueRange | True Range | ✔️ |
Statistical methods
| Function | Statistical methods | Tested | |:----------|:--------------------------------------|:-------:| | cov | Covariation | ✔️ | | cor | Correlation | ✔️ | | mean | Mean (Average) | ✔️ | | sd | Standard deviation | ✔️ |
Correlation matrix

Usage
javascript
const ohlcv = [[t,o,h,l,c,v], [t2,o2,h2,l2,c2,v2], ... ,[tN,oN,hN,lN,cN,vN]];
const ta = new TA(ohlcv, TA.exchangeFormat);
const emaShort = ta.ema(10);
const emaLong = ta.ema(21);
const bband = ta.bb(15, 2);
const bbUpper = bband.upper;
const bbLower = bband.lower;
const smaOpenPrice = TA.sma(ta.$open);
Installation
Install npm package npm i ta-math or add ta-math.js script file on web page.
2do list
- [X] basic indicators and overlays
- [X] unit tests
- [X] es5 with babel
- [X] coverage
- [X] good looking example
- [X] migrate to typescript
- [ ] fix PSAR
Contributing
Feel free to contribute. Here reference how to implement new indicators. There are test samples in the .xls files, also you can generate testing data with 'generator.py' file. To convert columns into rows in .xls you can use this tool.
Owner
- Login: munrocket
- Kind: user
- Location: Tbilisi, Georgia
- Twitter: munsocket
- Repositories: 9
- Profile: https://github.com/munrocket
Computer graphics, mathematics. He/him.
GitHub Events
Total
- Watch event: 7
- Delete event: 9
- Issue comment event: 4
- Push event: 41
- Pull request event: 19
- Fork event: 2
- Create event: 10
Last Year
- Watch event: 7
- Delete event: 9
- Issue comment event: 4
- Push event: 41
- Pull request event: 19
- Fork event: 2
- Create event: 10
Committers
Last synced: 9 months ago
Top Committers
| Name | Commits | |
|---|---|---|
| munrocket | m****t@p****m | 90 |
| Renovate Bot | b****t@r****m | 40 |
| renovate[bot] | 2****] | 9 |
| munrocket | q****p@y****u | 7 |
| IljaDaderko | i****o@g****m | 3 |
| hopperhuang | h****t@g****m | 1 |
| dependabot[bot] | 4****] | 1 |
Committer Domains (Top 20 + Academic)
Issues and Pull Requests
Last synced: 6 months ago
All Time
- Total issues: 11
- Total pull requests: 107
- Average time to close issues: 4 months
- Average time to close pull requests: 30 days
- Total issue authors: 8
- Total pull request authors: 6
- Average comments per issue: 3.09
- Average comments per pull request: 0.5
- Merged pull requests: 75
- Bot issues: 0
- Bot pull requests: 104
Past Year
- Issues: 0
- Pull requests: 4
- Average time to close issues: N/A
- Average time to close pull requests: N/A
- Issue authors: 0
- Pull request authors: 1
- Average comments per issue: 0
- Average comments per pull request: 1.0
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 4
Top Authors
Issue Authors
- hopperhuang (3)
- 0xAsimetriq (2)
- munrocket (1)
- LeoAlvarez (1)
- mulkan (1)
- MinimogDev (1)
- GuysmoB (1)
- itwasnoteasy (1)
Pull Request Authors
- renovate[bot] (91)
- dependabot[bot] (12)
- lgtm-com[bot] (1)
- hopperhuang (1)
- munrocket (1)
- 0xAsimetriq (1)
Top Labels
Issue Labels
Pull Request Labels
Dependencies
- @babel/core 7.18.6 development
- @babel/preset-env 7.18.6 development
- assemblyscript 0.20.13 development
- esm 3.2.25 development
- nyc 15.1.0 development
- rollup 2.75.6 development
- rollup-plugin-babel 4.4.0 development
- rollup-plugin-typescript2 0.32.1 development
- typescript 4.7.4 development
- zora 5.0.4 development
- 361 dependencies