Skip to main content

QuantInvestStrats (qis)

qis package implements analytics for visualisation of financial data, performance reporting, factsheets and analysis of quantitative strategies.

PyPI Python License CI Docs Downloads Monthly


Overview

The package is split into 5 main modules with the dependency path increasing sequentially as follows.

  1. qis.utils is module containing low level utilities for operations with pandas, numpy, and datetimes.

  2. qis.perfstats is module for computing performance statistics and performance attribution including returns, volatilities, etc.

  3. qis.plots is module for plotting and visualization apis.

  4. qis.models is module containing statistical models including filtering and regressions.

  5. qis.portfolio is high level module for analysis, simulation, backtesting, and reporting of quant strategies. Function backtest_model_portfolio() in qis.portfolio.backtester.py takes instrument prices and simulated weights from a generic strategy and compute the total return, performance attribution, and risk analysis

qis.market_data is an auxiliary module of market-data containers and FX analytics. FxRatesData holds FX spot and domestic short-rate panels and derives cross rates, covered-interest-parity forward premia, carry decomposition, and reference-currency / FX-hedged return translation of multi-asset panels, together with single- and multi-asset FX-hedging reports. FactorsData is a generic container for tradable-factor prices. Examples build the container from free Yahoo data or from Bloomberg via bbg-fetch; see the module README at qis/market_data/README.md for the data contract and conventions.

qis.examples contains runnable scripts showcasing the analytics, organised by sub-package:

  • qis.examples.perfstats — performance metrics on price series: quickstart usage, Sharpe vs Sortino across return frequencies, rolling performance, bond-ETF risk/return frontier, multi-figure performance reports, miss-best-worst-days impact, infrequent-returns interpolation, and an end-to-end de-levering / unsmoothing walkthrough on a bundled BDC vs private-credit dataset.

  • qis.examples.models — numba-vs-pandas EWM kernel benchmarks, multivariate EWM linear factor models, multivariate OLS, EWM correlation tables, OHLC realised-volatility estimators, intraday/overnight return decomposition, rolling correlations, and block bootstrap of price paths.

  • qis.examples.regimes — regime-conditional analytics: bull/bear/normal Sharpe attribution, conditional return boxplots by VIX regime, calendar-month seasonality, US election regime study.

  • qis.examples.portfolios — backtests using backtest_model_portfolio: balanced 60/40 with and without a BTC sleeve, constant-notional short, leveraged-ETF combinations, long/short pairs, and vol-target / trend-following parameter sweeps.

  • qis.examples.factsheets — full multi-page factsheets for simulated and actual strategies, cross-sectional asset-class comparisons, multi-strategy parameter sweeps, and optional pybloqs-rendered variants.

  • qis.examples.plots — plotting primitives showcase: dual-axis figures, scatter with regression diagnostics.

  • qis.examples.utils — date schedules and rolling calendars: option / futures roll generation via generate_fixed_maturity_rolls.

  • qis.examples.case_studies — cross-cutting domain studies: VIX beta to equities and bonds, VIX term-structure correlation with SPX, conditional returns on the front-month short-VIX strategy, credit-spread regression vs equity / rates.

A README inside qis/examples/ lists every script with a one-line description; examples that need a Bloomberg terminal are flagged inline.

Table of contents

  1. Analytics
  2. Installation
  3. Examples
    1. Visualization of price data
    2. Multi assets factsheet
    3. Strategy factsheet
    4. Strategy benchmark factsheet
    5. Multi strategy factsheet
    6. Runnable examples
  4. Contributions
  5. Changelog
  6. ToDos
  7. Disclaimer

Installation

Install using

pip install qis

Upgrade using

pip install --upgrade qis

Close using

git clone https://github.com/ArturSepp/QuantInvestStrats.git

Core dependencies: python = ">=3.10", numba = ">=0.63.0", numpy = ">=2.0", scipy = ">=1.12.0", statsmodels = ">=0.14.0", pandas = ">=2.2.0", matplotlib = ">=3.8.0", seaborn = ">=0.13.0", openpyxl = ">=3.1.0", PyYAML = ">=6.0"

qis/tests/test_documentation.py asserts that this list is the dependencies table of pyproject.toml, so it cannot drift from what pip install qis actually pulls.

Python 3.14 is supported (numba 0.63+ ships cp314 wheels).

Optional dependencies: yfinance = ">=0.2.40" and pandas-datareader = ">=0.10.0" (examples and tests that pull free price data — install with pip install qis[data]; never imported by library code), pybloqs ">=1.2.13" (for producing html and pdf factsheets — install with pip install qis[reports]), bbg-fetch ">=2.0.0" (third-party; for examples that pull data from a Bloomberg terminal)

See pyproject.toml for the full list of optional extras (reports, visualization, io, database, jupyter, dev, all).

Examples

1. Visualization of price data

The script is located in qis.examples.perfstats.quickstart (https://github.com/ArturSepp/QuantInvestStrats/blob/main/qis/examples/perfstats/quickstart.py). Run it to produce the figures below; perf1 to perf3 are excluded from the repository by .gitignore on size, so only the last is embedded here.

import matplotlib.pyplot as plt
import seaborn as sns
import yfinance as yf
import qis
from qis import PerfStat

# define tickers and fetch price data
tickers = ['SPY', 'QQQ', 'EEM', 'TLT', 'IEF', 'SHY', 'LQD', 'HYG', 'GLD']
prices = yf.download(tickers, start="2003-12-31", end=None, ignore_tz=True, auto_adjust=True)['Close'][tickers].dropna()

# plotting price data with minimum usage
with sns.axes_style("darkgrid"):
    fig, ax = plt.subplots(1, 1, figsize=(10, 7))
    qis.plot_prices(prices=prices, x_date_freq='YE', ax=ax)
# 2-axis plot with drawdowns using sns styles
with sns.axes_style("darkgrid"):
    fig, axs = plt.subplots(2, 1, figsize=(10, 7), tight_layout=True)
    qis.plot_prices_with_dd(prices=prices, x_date_freq='YE', axs=axs)
# plot risk-adjusted performance table with excess Sharpe ratio
ust_3m_rate = yf.download('^IRX', start="2003-12-31", end=None, ignore_tz=True, auto_adjust=True)['Close'].dropna() / 100.0
# set parameters for computing performance stats including returns vols and regressions
perf_params = qis.PerfParams(freq='ME', freq_reg='QE', rates_data=ust_3m_rate)
# perf_columns is list to display different perfomance metrics from enumeration PerfStat
fig = qis.plot_ra_perf_table(prices=prices,
                             perf_columns=[PerfStat.TOTAL_RETURN, PerfStat.PA_RETURN, PerfStat.PA_EXCESS_RETURN,
                                           PerfStat.VOL, PerfStat.SHARPE_RF0,
                                           PerfStat.SHARPE_EXCESS, PerfStat.SORTINO_RATIO, PerfStat.CALMAR_RATIO,
                                           PerfStat.MAX_DD, PerfStat.MAX_DD_VOL,
                                           PerfStat.SKEWNESS, PerfStat.KURTOSIS],
                             title=f"Risk-adjusted performance: {qis.get_time_period_label(prices, date_separator='-')}",
                             perf_params=perf_params)
# add benchmark regression using excess returns for linear beta
# regression frequency is specified using perf_params.freq_reg
# regression alpha is multiplied using alpha_an_factor
fig, _ = qis.plot_ra_perf_table_benchmark(prices=prices,
                                          benchmark='SPY',
                                          perf_columns=[PerfStat.TOTAL_RETURN, PerfStat.PA_RETURN, PerfStat.PA_EXCESS_RETURN,
                                                        PerfStat.VOL, PerfStat.SHARPE_RF0,
                                                        PerfStat.SHARPE_EXCESS, PerfStat.SORTINO_RATIO, PerfStat.CALMAR_RATIO,
                                                        PerfStat.MAX_DD, PerfStat.MAX_DD_VOL,
                                                        PerfStat.SKEWNESS, PerfStat.KURTOSIS,
                                                        PerfStat.ALPHA_AN, PerfStat.BETA, PerfStat.R2],
                                          title=f"Risk-adjusted performance: {qis.get_time_period_label(prices, date_separator='-')} benchmarked with SPY",
                                          perf_params=perf_params)

image info

2. Multi assets factsheet

This report is adopted for reporting the risk-adjusted performance of several assets with the goal of cross-sectional comparision

Run example in qis.examples.factsheets.multi_assets.py https://github.com/ArturSepp/QuantInvestStrats/blob/main/qis/examples/factsheets/multi_assets.py

image info

3. Strategy factsheet

This report is adopted for report performance, risk, and trading statistics for either backtested or actual strategy with strategy data passed as PortfolioData object

Run example in qis.examples.factsheets.strategy.py https://github.com/ArturSepp/QuantInvestStrats/blob/main/qis/examples/factsheets/strategy.py

image info image info image info

4. Strategy benchmark factsheet

This report is adopted for report performance and marginal comparison of strategy vs a benchmark strategy (data for both are passed using individual PortfolioData object)

Run example in qis.examples.factsheets.strategy_benchmark.py https://github.com/ArturSepp/QuantInvestStrats/blob/main/qis/examples/factsheets/strategy_benchmark.py

image info

Brinson-Fachler performance attribution (https://en.wikipedia.org/wiki/Performance_attribution) image info

5. Multi strategy factsheet

This report is adopted to examine the sensitivity of backtested strategy to a parameter or set of parameters:

Run example in qis.examples.factsheets.multi_strategy.py https://github.com/ArturSepp/QuantInvestStrats/blob/main/qis/examples/factsheets/multi_strategy.py

image info

6. Runnable examples

All 58 examples are plain scripts under qis/examples/, each runnable top to bottom. qis/tests/test_examples.py checks every one of them for symbols and keyword arguments that exist, and runs the nine that need no data vendor.

The four factsheet archetypes shown above are multi_assets.py, strategy.py, strategy_benchmark.py and multi_strategy.py.

Ecosystem

This package is part of an open-source Python stack for quantitative finance — full catalogue at github.com/ArturSepp:

Package Purpose
qis (this package) Performance analytics, factsheets, and visualisation
optimalportfolios Portfolio construction and backtesting
factorlasso Sparse factor models and factor covariance estimation
bbg-fetch Bloomberg data fetching
trendfollowing Trend-following systems: closed-form theory and replication
privateassets Private-asset return unsmoothing and capital market assumptions
goal-based-allocation Dynamic MV allocation under regime-switching jump-diffusions
stochvolmodels Stochastic volatility pricing analytics
vanilla-option-pricers Vectorised vanilla option pricers and implied volatility fitters

Dependency links within the stack: optimalportfolios builds on qis and factorlasso; trendfollowing and privateassets build on qis.

Contributions

If you are interested in extending and improving QIS analytics, please consider contributing to the library.

I have found it is a good practice to isolate general purpose and low level analytics and visualizations, which can be outsourced and shared, while keeping the focus on developing high level commercial applications.

There are a number of requirements:

  • The code is Pep 8 compliant

  • Reliance on common Python data types including numpy arrays, pandas, and dataclasses.

  • Transparent naming of functions and data types with enough comments. Type annotations of functions and arguments is a must.

  • Each submodule has a unit test for core functions and a localised entry point to core functions.

  • Avoid "super" pythonic constructions. Readability is the priority.

Changelog

Release history is maintained in CHANGELOG.md.

ToDos

  1. Enhanced documentation and readme examples.

  2. Docstrings for key functions.

  3. Reporting analytics and factsheets generation enhancing to matplotlib.

License

MIT — see LICENSE.txt.

Disclaimer

QIS package is distributed FREE & WITHOUT ANY WARRANTY under the MIT License.

See the LICENSE.txt in the release for details.

Please report any bugs or suggestions by opening an issue.

Citation

If you use QIS in your research, please cite it as:

@software{sepp2026qis,
  title={qis: Implementation of visualisation and reporting analytics for Quantitative Investment Strategies},
  author={Sepp, Artur},
  year={2026},
  version={5.6.0},
  url={https://github.com/ArturSepp/QuantInvestStrats}
}

Download files

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

Source Distribution

qis-5.6.0.tar.gz (632.6 kB view details)

Uploaded Source

Built Distribution

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

qis-5.6.0-py3-none-any.whl (766.3 kB view details)

Uploaded Python 3

File details

Details for the file qis-5.6.0.tar.gz.

File metadata

  • Download URL: qis-5.6.0.tar.gz
  • Upload date:
  • Size: 632.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.7

File hashes

Hashes for qis-5.6.0.tar.gz
Algorithm Hash digest
SHA256 97833497478a566a86f0d289569178426325f62a5707011e0a75eee59c0e59f6
MD5 69c4f775764104b73d795a2e5e280c98
BLAKE2b-256 46ac9517af6080e918a73e9dbf6fe4cbabe22d85e995dc046731139c72623cb8

See more details on using hashes here.

File details

Details for the file qis-5.6.0-py3-none-any.whl.

File metadata

  • Download URL: qis-5.6.0-py3-none-any.whl
  • Upload date:
  • Size: 766.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.7

File hashes

Hashes for qis-5.6.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a48b4d07d6c4f33a3738e23029e09e67ae711622d0468655c0892a011a72145a
MD5 96cde3a379967abbb837e7f7ef69e745
BLAKE2b-256 8822146caa66049745e67ed175cdbcd78d3af444d5088df965358acb97062ca7

See more details on using hashes here.

Release history Release notifications | RSS feed

5.12.0

2 files

5.11.3

2 files

5.11.2

2 files

5.11.1

2 files

5.11.0

2 files

5.10.0

2 files

5.9.4

2 files

5.9.3

2 files

5.9.2

2 files

5.9.1

2 files

5.8.0

2 files

5.7.0

2 files

5.6.2

2 files

5.6.1

2 files

This release

5.6.0 This release

2 files

5.5.0

2 files

5.4.0

2 files

5.3.0

2 files

5.2.1

2 files

5.2.0

2 files

5.1.0

2 files

5.0.10

1 file

5.0.9

1 file

5.0.8

1 file

5.0.7

1 file

5.0.6

1 file

5.0.5

1 file

5.0.4

1 file

5.0.3

1 file

5.0.2

1 file

5.0.1

1 file

5.0.0

1 file

4.3.4

1 file

4.3.3

1 file

4.3.2

1 file

4.3.1

1 file

4.3.0

1 file

4.2.7

2 files

4.2.6

2 files

4.2.5

2 files

4.2.4

2 files

4.2.3

1 file

4.2.2

2 files

4.2.1

2 files

4.2.0

2 files

4.1.5

2 files

4.1.4

2 files

4.1.3

1 file

4.1.2

1 file

4.1.1

1 file

4.0.4

2 files

4.0.3

2 files

4.0.2

2 files

4.0.1

2 files

4.0.0

1 file

3.5.6

1 file

3.5.5

1 file

3.5.4

1 file

3.5.3

1 file

3.5.2

1 file

3.5.1

1 file

3.4.7

1 file

3.4.6

1 file

3.4.5

1 file

3.4.4

1 file

3.4.3

1 file

3.4.2

1 file

3.4.1

1 file

3.3.21

1 file

3.3.20

1 file

3.3.19

1 file

3.3.18

1 file

3.3.17

1 file

3.3.16

1 file

3.3.15

1 file

3.3.14

1 file

3.3.13

1 file

3.3.12

1 file

3.3.11

1 file

3.3.10

1 file

3.3.9

1 file

3.3.8

1 file

3.3.7

1 file

3.3.6

1 file

3.3.5

1 file

3.3.4

1 file

3.3.3

1 file

3.3.2

1 file

3.3.1

1 file

3.2.30

1 file

3.2.29

1 file

3.2.28

1 file

3.2.27

1 file

3.2.26

1 file

3.2.25

1 file

3.2.24

1 file

3.2.23

1 file

3.2.22

1 file

3.2.21

1 file

3.2.20

1 file

3.2.19

1 file

3.2.18

1 file

3.2.17

1 file

3.2.15

1 file

3.2.14

1 file

3.2.12

1 file

3.2.11

1 file

3.2.10

1 file

3.2.9

1 file

3.2.8

1 file

3.2.7

1 file

3.2.5

1 file

3.2.4

1 file

3.2.3

1 file

3.2.2

1 file

3.2.1

1 file

3.1.6

1 file

3.1.5

1 file

3.1.4

1 file

3.1.3

1 file

3.1.2

1 file

3.1.1

1 file

3.0.10

1 file

3.0.9

1 file

3.0.8

1 file

3.0.7

1 file

3.0.6

1 file

3.0.5

1 file

3.0.4

1 file

3.0.3

1 file

3.0.2

1 file

3.0.1

1 file

2.1.40

1 file

2.1.38

1 file

2.1.37

1 file

2.1.36

1 file

2.1.35

1 file

2.1.34

1 file

2.1.33

1 file

2.1.32

1 file

2.1.31

1 file

2.1.30

1 file

2.1.29

1 file

2.1.28

1 file

2.1.27

1 file

2.1.26

1 file

2.1.25

1 file

2.1.24

1 file

2.1.23

1 file

2.1.22

1 file

2.1.21

1 file

2.1.20

1 file

2.1.19

1 file

2.1.18

1 file

2.1.17

1 file

2.1.16

1 file

2.1.15

1 file

2.1.14

1 file

2.1.13

1 file

2.1.11

1 file

2.1.10

1 file

2.1.9

1 file

2.1.8

1 file

2.1.7

1 file

2.1.6

1 file

2.1.5

1 file

2.1.4

1 file

2.1.3

1 file

2.1.2

1 file

2.1.1

1 file

2.0.94

1 file

2.0.93

1 file

2.0.92

1 file

2.0.91

1 file

2.0.90

1 file

2.0.89

1 file

2.0.88

1 file

2.0.87

1 file

2.0.86

1 file

2.0.85

1 file

2.0.84

1 file

2.0.83

1 file

2.0.82

1 file

2.0.81

1 file

2.0.80

1 file

2.0.79

1 file

2.0.78

1 file

2.0.77

1 file

2.0.75

1 file

2.0.74

1 file

2.0.73

1 file

1.0.8

2 files

Supported by

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