plot_exposure¶
Defined in fynance.plot
- plot_exposure(W, ax=None, **kw)[source]
Plot the book’s gross and net exposure over time.
Wis the weight/position book, shape(T,)(promoted to(T, 1)) or(T, N). Gross exposure (gross_exposure, \(\sum_i |w_i|\)) reads as total book leverage; net exposure (net_exposure, \(\sum_i w_i\)) reads as the long/short bias — plotting both together shows at a glance whether a high-leverage book is directionally hedged or one-sided. Returns the matplotlibAxes.- Parameters:
- Warray_like
Weights held at each step, shape
(T,)or(T, N).- axmatplotlib.axes.Axes, optional
Axes to draw on; a new figure is created when omitted.
- **kw
index(array_like, optional) overrides the x-axis (defaults torange(T)); any other keyword is forwarded to bothax.plotcalls (e.g.lw,alpha).
- Returns:
- matplotlib.axes.Axes