exposure_summary

Defined in fynance.metrics

exposure_summary(W, period=252)[source]

One-shot summary of a book’s turnover and exposure.

Combines annual_turnover, gross_exposure and net_exposure into the small set of numbers that describe how a book trades (churn) and sits (leverage, long/short bias) — the position -level analogue of fynance.metrics.summary.summary for an equity curve.

Parameters:
Warray_like

Weights held at each step, shape (T,) or (T, N). A 1-D input is reshaped to (T, 1).

periodint, optional

Annualization factor (bars per year, 252 for daily). Default 252.

Returns:
dict

{'annual_turnover', 'mean_gross', 'max_gross', 'mean_net', 'min_net', 'max_net', 'pct_long', 'pct_short', 'pct_flat'}; the pct_* entries are the percentage of bars with net exposure > 0, < 0 and == 0 respectively (they sum to 100).

See also

annual_turnover

the churn entry alone.

gross_exposure

the per-bar gross exposure series.

net_exposure

the per-bar net exposure series.

Examples

>>> import numpy as np
>>> W = np.array([[1.0, 0.0], [0.5, -0.5], [-1.0, -1.0], [0.0, 0.0]])
>>> out = exposure_summary(W, period=252)
>>> out['annual_turnover'], out['mean_gross'], out['mean_net']
(378.0, 1.0, -0.25)
>>> out['pct_long'], out['pct_short'], out['pct_flat']
(25.0, 25.0, 50.0)