Skip to main content

Production-quality financial chart generator — candlestick, line, area, OHLC, Heikin-Ashi with technical indicators.

Project description

TradeChart — Library Edition v1.0.0

Python → Financial Charts Generate production-quality candlestick, line, area, and OHLC charts from code.

Quick Start

import tradechart as tc

tc.terminal("full")
tc.chart("AAPL", "1mo", "candle", indicators=["sma", "bollinger"])

API Reference

Command Required Default Description
tc.terminal(mode) No "on_done" Set logging verbosity
tc.theme(name) No "dark" Set chart colour theme
tc.watermark(enabled) No True Toggle the TRADELY logo watermark
tc.config(**kwargs) No Batch-set global options (see below)
tc.chart(...) Fetch data and render a chart image
tc.compare(...) Overlay multiple tickers on one chart
tc.data(...) Fetch raw OHLCV data as a DataFrame
tc.export(...) Export market data to CSV / JSON / XLSX
tc.clear_cache() No Flush the in-memory data cache

tc.chart() — Render a Chart

path = tc.chart(
    "AAPL",
    duration="3mo",
    chart_type="candle",
    indicators=["sma", "rsi", "macd"],
    show_volume=True,
    fmt="png",
    output_location="./charts",
    output_name="apple_q1.png",
)
print(f"Saved → {path}")
Parameter Required Default Description
ticker Yes Instrument symbol — "AAPL", "BTC-USD", "EURUSD=X"
duration No "1mo" Time span (see Durations below)
chart_type No "candle" "candle" "line" "ohlc" "area" "heikin_ashi"
output_location No cwd Directory for the output file
output_name No auto Filename — defaults to {TICKER}_{duration}_{type}.{fmt}
fmt No "png" "png" "jpg" "svg" "pdf" "webp"
indicators No None List of indicator names (see Indicators below)
show_volume No True Show volume sub-panel

tc.compare() — Multi-Ticker Overlay

path = tc.compare(
    ["AAPL", "MSFT", "GOOG"],
    duration="6mo",
    normalise=True,
    fmt="png",
)
Parameter Required Default Description
tickers Yes 2–8 ticker symbols to compare
duration No "1mo" Shared time span
normalise No True Show percentage change from period start
output_location No cwd Output directory
output_name No auto Output filename
fmt No "png" Output format

tc.data() — Raw Data

df = tc.data("TSLA", "3mo")
print(df.head())

Returns a pandas.DataFrame with columns Open, High, Low, Close, Volume and a DatetimeIndex.

tc.export() — Export Data

path = tc.export("AAPL", "1y", fmt="csv", output_location="./exports")
Parameter Required Default Description
ticker Yes Instrument symbol
duration No "1mo" Time span
fmt No "csv" "csv" "json" "xlsx"
output_location No cwd Output directory
output_name No auto Output filename

Durations

Value Period
"1d" 1 day (5-min bars)
"5d" 5 days (15-min bars)
"1mo" 1 month (daily)
"3mo" 3 months (daily)
"6mo" 6 months (daily)
"1y" 1 year (weekly)
"2y" 2 years (weekly)
"5y" 5 years (weekly)
"10y" 10 years (monthly)
"max" All available (monthly)

Indicators

Name Panel Description
"sma" Price overlay Simple Moving Average (20)
"ema" Price overlay Exponential Moving Average (20)
"bollinger" Price overlay Bollinger Bands (20, 2σ)
"vwap" Price overlay Volume-Weighted Average Price
"rsi" Sub-panel Relative Strength Index (14)
"macd" Sub-panel MACD (12/26/9)
"volume" Sub-panel Volume bars

Themes

Name Background Style
"dark" #1e1e2f Dark mode — green/red candles
"light" #ffffff Light mode — green/red candles
"classic" #f5f5dc Parchment — dark green/dark red candles, visible spines
tc.theme("light")
tc.chart("MSFT", "6mo", "candle")

Terminal Modes

Control how much console output TradeChart produces.

Mode What prints Best for
"full" Every step, every log line, full detail Debugging
"on_done" Summary after completion Normal use
"none" Nothing at all — complete silence Production / scripting

tc.config() — Batch Settings

tc.config(
    theme="light",
    dpi=200,
    overwrite=True,
    fig_size=(16, 9),
    cache_ttl=600,
)
Key Type Default Description
terminal str "on_done" Logging mode
theme str "dark" Colour theme
watermark bool True TRADELY logo on/off
overwrite bool False Allow overwriting existing files
dpi int 150 Output resolution (50–600)
fig_size tuple (14, 7) Figure dimensions in inches
cache_ttl int 300 Data cache time-to-live in seconds

Data Providers

TradeChart tries providers in order and falls back automatically:

Priority Provider Requires
1 yfinance pip install yfinance (included)
2 TradingView pip install tvDatafeed (optional)
3 Stooq Nothing (free CSV endpoint)

If yfinance returns data, TradingView and Stooq are never called. If yfinance fails, the next provider is tried, and so on.

Installation

pip install TradeChart

With optional extras:

pip install TradeChart[all]          # TradingView + mplfinance + xlsx export
pip install TradeChart[tradingview]  # TradingView fallback provider
pip install TradeChart[mplfinance]   # Enhanced candlestick rendering
pip install TradeChart[xlsx]         # Excel export support

Notes

  • Caching: Fetched data is cached in-memory for cache_ttl seconds (default 300). Call tc.clear_cache() to force a re-fetch.

  • File collisions: By default, TradeChart appends _1, _2, etc. if the output file already exists. Set tc.config(overwrite=True) to overwrite instead.

  • Watermark: The TRADELY logo is stamped in the bottom-left corner by default. Disable with tc.watermark(False) or tc.config(watermark=False).

  • Thread safety: The global settings singleton and engine initialisation are thread-safe. You can call tc.chart() from multiple threads.

  • Heikin-Ashi: The "heikin_ashi" chart type converts standard OHLC data to Heikin-Ashi candles before rendering — the original data is not modified.

  • mplfinance: If mplfinance is installed, candlestick charts use it for higher-quality rendering. Otherwise, a pure-matplotlib fallback is used automatically.

Further Details

Check out TradeChart by TRADELY

PyPI Library available at: PyPI TradeChart

Use the README there to set up the library.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tradechart-1.0.0.tar.gz (26.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

tradechart-1.0.0-py3-none-any.whl (33.8 kB view details)

Uploaded Python 3

File details

Details for the file tradechart-1.0.0.tar.gz.

File metadata

  • Download URL: tradechart-1.0.0.tar.gz
  • Upload date:
  • Size: 26.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for tradechart-1.0.0.tar.gz
Algorithm Hash digest
SHA256 6dc8a40994ebde8ed70bc0823b102e0efb88fe4c6ad9399db4de2b5b83dfe2b5
MD5 18ba9befbd1051a5eed25b70c3525f24
BLAKE2b-256 ed4fc81bb919ea7df0a9eb569937019eead9df7c3f857674a6d7fa7b6c649856

See more details on using hashes here.

Provenance

The following attestation bundles were made for tradechart-1.0.0.tar.gz:

Publisher: publish.yml on techareaone/TradeChart

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file tradechart-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: tradechart-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 33.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for tradechart-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 397a209659eda9167a67f0574de76bead02919e59960a7ccb9fce0d20ff296ad
MD5 612dabf1b7b558417684119803333836
BLAKE2b-256 94d125ea3f46491caf34cc68a6ae72cfdb6c74d1900392c8771e22ecfbf1c596

See more details on using hashes here.

Provenance

The following attestation bundles were made for tradechart-1.0.0-py3-none-any.whl:

Publisher: publish.yml on techareaone/TradeChart

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page