Skip to main content

pltfinance

A simple financial plotting library built on top of Plotly.

Installation

pip install pltfinance

Basic Usage

import pandas as pd
import pltfinance as pf

quotes = pd.read_csv("examples/data/AAPL-20241202-20251128.csv")
pf.plot(quotes)

png

Plot Indicators with OHLCV

import pandas as pd
import pltfinance as pf

def compute_macd(close: pd.Series, fast: int = 12, slow: int = 26, signal: int = 9) -> pd.DataFrame:
    ema_fast = close.ewm(span=fast, adjust=False).mean()
    ema_slow = close.ewm(span=slow, adjust=False).mean()
    macd_line = ema_fast - ema_slow
    signal_line = macd_line.ewm(span=signal, adjust=False).mean()
    histogram = macd_line - signal_line

    return pd.DataFrame(
        {"DIF": macd_line, "DEA": signal_line, "MACD": histogram}, index=close.index
    )

quotes = pd.read_csv("examples/data/AAPL-20241202-20251128.csv")
ohlcv = pf.normalize_quotes(quotes)

price_ma5 = ohlcv["close"].rolling(5).mean()
price_ma20 = ohlcv["close"].rolling(20).mean()
price_ma60 = ohlcv["close"].rolling(60).mean()
volume_ma20 = ohlcv["volume"].rolling(20).mean()

macd = compute_macd(ohlcv["close"])

indicators = [
    pf.SeriesPlot(series=price_ma5, label="Price_MA5"),
    pf.SeriesPlot(series=price_ma20, label="Price_MA20"),
    pf.SeriesPlot(series=price_ma60, label="Price_MA60"),
    pf.SeriesPlot(series=volume_ma20, label="Volume_MA20", panel=1),
    pf.SeriesPlot(series=macd["DIF"], label="DIF", panel=2, color="#0099c6"),
    pf.SeriesPlot(series=macd["DEA"], label="DEA", panel=2, color=pf.Color.MAGENTA),
    pf.SeriesPlot(
        series=macd["MACD"],
        label="MACD",
        panel=2,
        type=pf.CharType.BAR,
        color=[pf.Color.GREEN if v >= 0 else pf.Color.RED for v in macd["MACD"]],
        secondary_y=True,
    ),
]

pf.plot(quotes, title="AAPL", indicators=indicators)

png

Copyright and Licenses

Code and documentation copyright 2026 dumbsmart.org.

Code released under the MIT license.

Metadata

Release files for pltfinance 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pltfinance 0.1.0
File Size Uploaded Provenance Actions
pltfinance-0.1.0.tar.gz 5.2 kB Without provenance Details for pltfinance-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pltfinance 0.1.0
File Interpreter ABI Platform Actions
pltfinance-0.1.0-py3-none-any.whl Python 3 none any Details for pltfinance-0.1.0-py3-none-any.whl

Total release size: 11.4 kB

Release files / pltfinance-0.1.0.tar.gz

Download URL pltfinance-0.1.0.tar.gz
Size 5.2 kB
Tags Source
SHA-256 checksum
How to use checksums
1ce973011e675eb05c2d475afc268b0dc367cc6646f0bbecd652c43a6798ab7b
BLAKE2b-256 checksum
How to use checksums
54da043b56a95622368744b1374ef4be663509d3e678807964634eefc3a47a75
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.9.13 {"installer":{"name":"uv","version":"0.9.13"},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / pltfinance-0.1.0-py3-none-any.whl

Download URL pltfinance-0.1.0-py3-none-any.whl
Size 6.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
27239bf1cae5423272137d366eaa0741b2f6175419199074905c818d220379d4
BLAKE2b-256 checksum
How to use checksums
914d763c2bdfd37363e5ed68c6610ea2b4a4fb04254b7405303a1736a7df7bb5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.9.13 {"installer":{"name":"uv","version":"0.9.13"},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Security for pltfinance 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page