Top 50 technical indicators in Python

A technical indicator is a transformation of market data—not independent evidence that a trade will be profitable. Reliability comes from making the transformation inspectable: define the input candles, show the formula and parameters, preserve warm-up values, and let another person reproduce the output.

The notebook embedded on this page computes 50 indicators with pandas and NumPy. It runs on deterministic demonstration data without broker credentials, asserts the final column count, and exposes the implementation instead of hiding it behind a chart or signal label.

Educational research only. An indicator can describe price or volume behaviour; it cannot remove market risk or guarantee a useful forecast.

The 50-indicator map

FamilyIndicatorsWhat the family describes
TrendSMA, EMA, WMA, HMA, DEMA, TEMA, VWMA, MACD, MACD signal, PPO, TRIXSmoothed direction and relationships between price averages
MomentumROC, Momentum, RSI, Stochastic %K and %D, Williams %R, CCI, Ultimate Oscillator, Awesome Oscillator, KST, TSI, Connors RSI, CMOSpeed, persistence and relative position of price changes
Volatility and channelsBollinger upper, lower and bandwidth, ATR, NATR, True Range, Keltner upper and lower, Donchian upper and lower, standard deviation, historical volatilityDispersion, trading range and changing market activity
Directional stateADX, +DI, −DI, Aroon up and down, Vortex + and −, Parabolic SAR, Ichimoku conversion and baseTrend strength, directional movement and recent extremes
Volume and money flowOBV, MFI, CMF, Accumulation/DistributionWhether reported volume confirms or contradicts price movement

Several outputs belong to one underlying method. Bollinger upper, lower and bandwidth are three observable series, for example. Counting output columns is useful for testing a data pipeline, but it does not make correlated indicators independent evidence.

What makes the notebook reproducible

The runnable example fixes its random seed and creates the same 320 business-day OHLCV frame on every clean run. It then checks:

indicators = compute_top_50(demo)
assert indicators.shape[1] == 50

That assertion catches accidental additions, removals and naming collisions. A stronger production test should also freeze a small reference dataset and compare selected values to a separately maintained implementation within documented tolerances.

Use completed candles only

An indicator calculated from a candle's close is not available before that close exists. A daily RSI value based on Monday's final close cannot honestly produce a Monday-close fill unless the test models the actual calculation and order timing.

A conservative bar-based workflow is:

  1. Receive and validate the completed candle.
  2. Append it once using a unique timestamp.
  3. Recompute only the required indicator tail.
  4. Evaluate the signal using information available at that moment.
  5. Model the next tradable event, costs and possible slippage.

Keep warm-up values visible

Long-window indicators need history before they become meaningful. Backfilling their early NaN values copies later information into earlier rows and creates look-ahead leakage. Drop incomplete rows only after all required features and targets have been aligned.

Different libraries can also disagree without either being broken. Common causes include Wilder versus exponential smoothing, sample versus population deviation, session boundaries, timestamp conventions and whether prices were adjusted for corporate actions.

Connect broker candles through one boundary

Keep each broker adapter small. Convert its response immediately into this canonical shape:

timestamp, open, high, low, close, volume

Store the broker, symbol, interval, timezone, fetch time and adjustment policy beside the data. Once normalized, the same indicator engine can serve Zerodha, Dhan, FYERS, Groww or another documented source without spreading broker-specific field names through the research code.

The next notebook in the course demonstrates that adapter boundary: broker candles to all 50 indicators.

Do not turn 50 indicators into 50 votes

SMA, EMA, MACD and PPO often respond to closely related price information. Requiring all of them to agree can look like confirmation while merely counting the same evidence several times.

A more defensible experiment starts with one hypothesis, one primary feature family and explicit risk controls. Freeze the parameters, test on unseen data, include costs, and report failed variants as well as the chosen result.

From calculation to alert

An alert should include the symbol, completed-candle timestamp, rule version and observed values. Persist a deduplication key so retries do not send the same event repeatedly. Keep the alert boundary separate from live order placement until rejection, timeout, partial-fill and duplicate-order recovery have been tested.

Continue with the alerts and ServLoci dispatch notebook, which defaults to console output and keeps live execution behind a dry-run risk gate.

Reproducible notebook

Run all 50 technical indicators

Inspect the executed cells and saved outputs below, then open the identical source in Colab to reproduce the calculations or connect your own OHLCV data.

The embedded copy is a read-only, pre-rendered build. Run the source in Colab to reproduce or change it. Never place broker secrets in a published notebook.