Indicator TS is a TypeScript module providing pure technical analysis mathematics, statistical calculations, and generic backtesting utilities for browser and server environments.
This is a TypeScript implementation of the Indicator Go Golang module.
The software, algorithms, technical indicators, mathematical formulas, demonstrative strategy examples, and backtesting utilities provided in this project are strictly for educational, research, and informational purposes. Nothing contained in this codebase, documentation, or associated examples constitutes financial, investment, legal, tax, or trading advice, nor a solicitation, recommendation, endorsement, or offer to buy or sell any security, commodity, futures contract, option, cryptocurrency, or other financial instrument.
The authors, maintainers, and contributors of this library are NOT registered investment advisors (RIAs), commodity trading advisors (CTAs), broker-dealers, or certified financial analysts under the jurisdiction of the U.S. Securities and Exchange Commission (SEC), Commodity Futures Trading Commission (CFTC), Financial Industry Regulatory Authority (FINRA), or any other regulatory authority worldwide. No fiduciary, advisory, or professional relationship is created through your access, use, or implementation of this software.
Trading in financial markets—including stocks, options, futures, foreign exchange (Forex), and cryptocurrencies—involves substantial risk of loss and is not suitable for every investor. Market values fluctuate rapidly, and the use of leverage, margin, or derivative instruments can multiply losses, potentially resulting in the total loss of capital or liabilities exceeding the initial investment. You should independently assess your risk tolerance and financial situation before engaging in any trading activity.
HYPOTHETICAL OR SIMULATED PERFORMANCE RESULTS HAVE CERTAIN INHERENT LIMITATIONS. UNLIKE AN ACTUAL PERFORMANCE RECORD, SIMULATED RESULTS DO NOT REPRESENT ACTUAL TRADING. ALSO, SINCE THE TRADES HAVE NOT ACTUALLY BEEN EXECUTED, THE RESULTS MAY HAVE UNDER- OR OVER-COMPENSATED FOR THE IMPACT, IF ANY, OF CERTAIN MARKET FACTORS, SUCH AS LACK OF LIQUIDITY, SPREADS, COMMISSIONS, OR MARKET SLIPPAGE. SIMULATED TRADING PROGRAMS IN GENERAL ARE ALSO SUBJECT TO THE FACT THAT THEY ARE DESIGNED WITH THE BENEFIT OF HINDSIGHT. NO REPRESENTATION IS BEING MADE THAT ANY ACCOUNT WILL OR IS LIKELY TO ACHIEVE PROFITS OR LOSSES SIMILAR TO THOSE SHOWN. PAST PERFORMANCE IS NO GUARANTEE OF FUTURE RESULTS.
THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE, ACCURACY, AND NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS, CONTRIBUTORS, OR COPYRIGHT HOLDERS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, FINANCIAL LOSSES, TRADING LOSSES, LOSS OF PROFITS, DATA LOSS OR CORRUPTION, SYSTEM DOWNTIME, OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY ARISING IN ANY WAY OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
The following technical analysis indicators are supported by this package:
- Absolute Price Oscillator (APO)
- Aroon Indicator
- Balance of Power (BOP)
- Chande Forecast Oscillator (CFO)
- Commodity Channel Index (CCI)
- Double Exponential Moving Average (DEMA)
- Exponential Moving Average (EMA)
- Mass Index (MI)
- Moving Average Convergence Divergence (MACD)
- Moving Max (MMAX)
- Moving Min (MMIN)
- Moving Sum (MSUM)
- Parabolic SAR (PSAR)
- Qstick
- Random Index (KDJ)
- Rolling Moving Average (RMA)
- Simple Moving Average (SMA)
- Since Change
- Triple Exponential Moving Average (TEMA)
- Triangular Moving Average (TRIMA)
- Triple Exponential Average (TRIX)
- Typical Price
- Volume Weighted Moving Average (VWMA)
- Vortex Indicator
- Awesome Oscillator (AO)
- Chaikin Oscillator (CO)
- Ichimoku Cloud
- Percentage Price Oscillator (PPO)
- Percentage Volume Oscillator (PVO)
- Price Rate of Change (ROC)
- Relative Strength Index (RSI)
- Stochastic Oscillator (STOCH)
- Williams R (WILLR)
- Acceleration Bands (AB)
- Average True Range (ATR)
- Bollinger Bands (BB)
- Bollinger Band Width (BBW)
- Chandelier Exit (CE)
- Donchian Channel (DC)
- Keltner Channel (KC)
- Moving Standard Deviation (MSTD)
- Projection Oscillator (PO)
- True Range (TR)
- Ulcer Index (UI)
- Accumulation/Distribution (AD)
- Chaikin Money Flow (CMF)
- Ease of Movement (EMV)
- Force Index (FI)
- Money Flow Index (MFI)
- Negative Volume Index (NVI)
- On-Balance Volume (OBV)
- Volume Price Trend (VPT)
- Volume Weighted Average Price (VWAP)
The core engine provides lightweight, generic abstractions for price bar series and trading signals:
Pre-baked illustrative strategies are organized in the examples/ directory as pedagogical demonstrations showing how developers can consume indicator mathematics:
- Baseline Strategy: Buy and Hold Strategy
- Momentum Strategy Examples: Awesome Oscillator, Ichimoku Cloud, RSI 2, Stochastic Oscillator, Williams R
- Trend Strategy Examples: APO, Aroon, BOP, CFO, KDJ, MACD, Parabolic SAR, Typical Price, VWMA, Vortex
- Volatility Strategy Examples: Acceleration Bands, Bollinger Bands, Projection Oscillator
- Volume Strategy Examples: Chaikin Money Flow, Ease of Movement, Force Index, Money Flow Index, Negative Volume Index, VWAP
A lightweight, generic backtest utility is provided for evaluating custom strategy functions against historical data:
Chart provides utilities to plot indicator values and simulated strategies:
The project can be built from source:
npm run buildInstall the package:
npm install indicatortsImport and calculate technical indicators:
import { ao } from 'indicatorts';
const highs = [10, 20, 30, 40];
const lows = [1, 2, 3, 4];
// Calculate Awesome Oscillator (AO)
const result = ao(highs, lows);The source code is provided under the MIT License.
Copyright © 2022-2026 The Indicator Authors
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- Bollinger Bands® is a registered trademark of John Bollinger.
- All other product names, logos, and brands mentioned herein are trademarks or registered trademarks of their respective owners. Mention of third-party products, services, or trademarks is for nominative identification and educational purposes only and does not imply affiliation or endorsement.