Technical Indicators for Financial Analysis

1.6.0 · active · verified Thu Apr 16

Technical is a Python library that provides a comprehensive collection of technical indicators and utility functions for financial time series analysis. It is designed to be easy to use and is a companion project primarily developed for Freqtrade, assisting in quantitative trading strategy development. The library is actively maintained with frequent releases, currently at version 1.6.0.

Common errors

Warnings

Install

Imports

Quickstart

This quickstart demonstrates how to create a pandas DataFrame and then use the `sma` indicator from the `technical.indicators` module to calculate a Simple Moving Average. Indicators typically take a pandas Series (e.g., 'close' prices) and return a new Series.

import pandas as pd
from technical.indicators import sma

# Create a sample DataFrame with 'close' prices
df = pd.DataFrame({
    'close': [10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20]
})

# Calculate Simple Moving Average (SMA) with a period of 3
df['sma_3'] = sma(df['close'], period=3)

print(df)

view raw JSON →