openseries 1.5.1__py3-none-any.whl → 1.5.3__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- openseries/__init__.py +1 -1
- openseries/_risk.py +1 -0
- openseries/datefixer.py +2 -1
- openseries/frame.py +16 -13
- openseries/load_plotly.py +1 -0
- openseries/series.py +1 -0
- openseries/simulation.py +26 -17
- openseries/types.py +8 -5
- {openseries-1.5.1.dist-info → openseries-1.5.3.dist-info}/METADATA +27 -27
- openseries-1.5.3.dist-info/RECORD +15 -0
- openseries-1.5.1.dist-info/RECORD +0 -15
- {openseries-1.5.1.dist-info → openseries-1.5.3.dist-info}/LICENSE.md +0 -0
- {openseries-1.5.1.dist-info → openseries-1.5.3.dist-info}/WHEEL +0 -0
openseries/__init__.py
CHANGED
@@ -1 +1 @@
|
|
1
|
-
"""
|
1
|
+
"""openseries.openseries.__init__.py."""
|
openseries/_risk.py
CHANGED
openseries/datefixer.py
CHANGED
@@ -1,11 +1,12 @@
|
|
1
1
|
"""Date related utilities."""
|
2
|
+
|
2
3
|
from __future__ import annotations
|
3
4
|
|
4
5
|
import datetime as dt
|
5
6
|
from typing import Optional, Union, cast
|
6
7
|
|
7
8
|
from dateutil.relativedelta import relativedelta
|
8
|
-
from holidays import (
|
9
|
+
from holidays import (
|
9
10
|
country_holidays,
|
10
11
|
list_supported_countries,
|
11
12
|
)
|
openseries/frame.py
CHANGED
@@ -1934,8 +1934,9 @@ def efficient_frontier( # noqa: C901
|
|
1934
1934
|
limit_small = 0.0001
|
1935
1935
|
line_df = line_df.mask(line_df.abs() < limit_small, 0.0)
|
1936
1936
|
line_df["text"] = line_df.apply(
|
1937
|
-
lambda c: "<br>"
|
1938
|
-
|
1937
|
+
lambda c: "<br><br>Weights:<br>"
|
1938
|
+
+ "<br>".join(
|
1939
|
+
[f"{c[nm]:.1%} {nm}" for nm in eframe.columns_lvl_zero],
|
1939
1940
|
),
|
1940
1941
|
axis="columns",
|
1941
1942
|
)
|
@@ -2038,9 +2039,9 @@ def prepare_plot_data(
|
|
2038
2039
|
The data prepared with mean returns, volatility and weights
|
2039
2040
|
|
2040
2041
|
"""
|
2041
|
-
txt = "<br>".join(
|
2042
|
+
txt = "<br><br>Weights:<br>" + "<br>".join(
|
2042
2043
|
[
|
2043
|
-
f"{wgt:.1%}
|
2044
|
+
f"{wgt:.1%} {nm}"
|
2044
2045
|
for wgt, nm in zip(
|
2045
2046
|
cast(list[float], assets.weights),
|
2046
2047
|
assets.columns_lvl_zero,
|
@@ -2048,12 +2049,10 @@ def prepare_plot_data(
|
|
2048
2049
|
],
|
2049
2050
|
)
|
2050
2051
|
|
2051
|
-
|
2052
|
-
[
|
2053
|
-
|
2054
|
-
|
2055
|
-
],
|
2056
|
-
)
|
2052
|
+
opt_text_list = [
|
2053
|
+
f"{wgt:.1%} {nm}" for wgt, nm in zip(optimized[3:], assets.columns_lvl_zero)
|
2054
|
+
]
|
2055
|
+
opt_text = "<br><br>Weights:<br>" + "<br>".join(opt_text_list)
|
2057
2056
|
vol: Series[float] = assets.vol
|
2058
2057
|
plotframe = DataFrame(
|
2059
2058
|
data=[
|
@@ -2166,7 +2165,10 @@ def sharpeplot( # noqa: C901
|
|
2166
2165
|
x=line_frame.loc[:, "stdev"],
|
2167
2166
|
y=line_frame.loc[:, "ret"],
|
2168
2167
|
text=line_frame.loc[:, "text"],
|
2169
|
-
|
2168
|
+
xhoverformat=".2%",
|
2169
|
+
yhoverformat=".2%",
|
2170
|
+
hovertemplate="Return %{y}<br>Vol %{x}%{text}",
|
2171
|
+
hoverlabel_align="right",
|
2170
2172
|
line={"width": 2.5, "dash": "solid"},
|
2171
2173
|
mode="lines",
|
2172
2174
|
name="Efficient frontier",
|
@@ -2182,11 +2184,12 @@ def sharpeplot( # noqa: C901
|
|
2182
2184
|
risk.extend([point_frame.loc["stdev", col]])
|
2183
2185
|
figure.add_scatter(
|
2184
2186
|
x=[point_frame.loc["stdev", col]],
|
2185
|
-
xhoverformat=".2%",
|
2186
2187
|
y=[point_frame.loc["ret", col]],
|
2188
|
+
xhoverformat=".2%",
|
2187
2189
|
yhoverformat=".2%",
|
2188
2190
|
hovertext=[point_frame.loc["text", col]],
|
2189
|
-
|
2191
|
+
hovertemplate=("Return %{y}<br>Vol %{x}%{hovertext}"),
|
2192
|
+
hoverlabel_align="right",
|
2190
2193
|
marker={"size": 20, "color": clr},
|
2191
2194
|
mode=point_frame_mode,
|
2192
2195
|
name=col,
|
openseries/load_plotly.py
CHANGED
openseries/series.py
CHANGED
openseries/simulation.py
CHANGED
@@ -77,8 +77,6 @@ class ReturnSimulation(BaseModel):
|
|
77
77
|
This is the average jump size
|
78
78
|
seed: int, optional
|
79
79
|
Seed for random process initiation
|
80
|
-
randomizer: numpy.random.Generator, optional
|
81
|
-
Random process generator
|
82
80
|
|
83
81
|
"""
|
84
82
|
|
@@ -92,7 +90,6 @@ class ReturnSimulation(BaseModel):
|
|
92
90
|
jumps_sigma: NonNegativeFloat = 0.0
|
93
91
|
jumps_mu: float = 0.0
|
94
92
|
seed: Optional[int] = None
|
95
|
-
randomizer: Optional[Generator] = None
|
96
93
|
|
97
94
|
model_config = ConfigDict(
|
98
95
|
arbitrary_types_allowed=True,
|
@@ -160,6 +157,7 @@ class ReturnSimulation(BaseModel):
|
|
160
157
|
trading_days: PositiveInt,
|
161
158
|
seed: int,
|
162
159
|
trading_days_in_year: DaysInYearType = 252,
|
160
|
+
randomizer: Optional[Generator] = None,
|
163
161
|
) -> ReturnSimulation:
|
164
162
|
"""
|
165
163
|
Create a Normal distribution simulation.
|
@@ -179,6 +177,8 @@ class ReturnSimulation(BaseModel):
|
|
179
177
|
trading_days_in_year: DaysInYearType,
|
180
178
|
default: 252
|
181
179
|
Number of trading days used to annualize
|
180
|
+
randomizer: numpy.random.Generator, optional
|
181
|
+
Random process generator
|
182
182
|
|
183
183
|
Returns
|
184
184
|
-------
|
@@ -186,9 +186,10 @@ class ReturnSimulation(BaseModel):
|
|
186
186
|
Normal distribution simulation
|
187
187
|
|
188
188
|
"""
|
189
|
-
|
189
|
+
if not randomizer:
|
190
|
+
randomizer = random_generator(seed=seed)
|
190
191
|
|
191
|
-
returns =
|
192
|
+
returns = randomizer.normal(
|
192
193
|
loc=mean_annual_return / trading_days_in_year,
|
193
194
|
scale=mean_annual_vol / sqrt(trading_days_in_year),
|
194
195
|
size=(number_of_sims, trading_days),
|
@@ -202,7 +203,6 @@ class ReturnSimulation(BaseModel):
|
|
202
203
|
mean_annual_vol=mean_annual_vol,
|
203
204
|
dframe=DataFrame(data=returns, dtype="float64"),
|
204
205
|
seed=seed,
|
205
|
-
randomizer=cls.randomizer,
|
206
206
|
)
|
207
207
|
|
208
208
|
@classmethod
|
@@ -214,6 +214,7 @@ class ReturnSimulation(BaseModel):
|
|
214
214
|
trading_days: PositiveInt,
|
215
215
|
seed: int,
|
216
216
|
trading_days_in_year: DaysInYearType = 252,
|
217
|
+
randomizer: Optional[Generator] = None,
|
217
218
|
) -> ReturnSimulation:
|
218
219
|
"""
|
219
220
|
Create a Lognormal distribution simulation.
|
@@ -233,6 +234,8 @@ class ReturnSimulation(BaseModel):
|
|
233
234
|
trading_days_in_year: DaysInYearType,
|
234
235
|
default: 252
|
235
236
|
Number of trading days used to annualize
|
237
|
+
randomizer: numpy.random.Generator, optional
|
238
|
+
Random process generator
|
236
239
|
|
237
240
|
Returns
|
238
241
|
-------
|
@@ -240,10 +243,11 @@ class ReturnSimulation(BaseModel):
|
|
240
243
|
Lognormal distribution simulation
|
241
244
|
|
242
245
|
"""
|
243
|
-
|
246
|
+
if not randomizer:
|
247
|
+
randomizer = random_generator(seed=seed)
|
244
248
|
|
245
249
|
returns = (
|
246
|
-
|
250
|
+
randomizer.lognormal(
|
247
251
|
mean=mean_annual_return / trading_days_in_year,
|
248
252
|
sigma=mean_annual_vol / sqrt(trading_days_in_year),
|
249
253
|
size=(number_of_sims, trading_days),
|
@@ -259,7 +263,6 @@ class ReturnSimulation(BaseModel):
|
|
259
263
|
mean_annual_vol=mean_annual_vol,
|
260
264
|
dframe=DataFrame(data=returns, dtype="float64"),
|
261
265
|
seed=seed,
|
262
|
-
randomizer=cls.randomizer,
|
263
266
|
)
|
264
267
|
|
265
268
|
@classmethod
|
@@ -271,6 +274,7 @@ class ReturnSimulation(BaseModel):
|
|
271
274
|
trading_days: PositiveInt,
|
272
275
|
seed: int,
|
273
276
|
trading_days_in_year: DaysInYearType = 252,
|
277
|
+
randomizer: Optional[Generator] = None,
|
274
278
|
) -> ReturnSimulation:
|
275
279
|
"""
|
276
280
|
Create a Geometric Brownian Motion simulation.
|
@@ -289,6 +293,8 @@ class ReturnSimulation(BaseModel):
|
|
289
293
|
Seed for random process initiation
|
290
294
|
trading_days_in_year: DaysInYearType, default: 252
|
291
295
|
Number of trading days used to annualize
|
296
|
+
randomizer: numpy.random.Generator, optional
|
297
|
+
Random process generator
|
292
298
|
|
293
299
|
Returns
|
294
300
|
-------
|
@@ -296,14 +302,15 @@ class ReturnSimulation(BaseModel):
|
|
296
302
|
Geometric Brownian Motion simulation
|
297
303
|
|
298
304
|
"""
|
299
|
-
|
305
|
+
if not randomizer:
|
306
|
+
randomizer = random_generator(seed=seed)
|
300
307
|
|
301
308
|
drift = (mean_annual_return - 0.5 * mean_annual_vol**2.0) * (
|
302
309
|
1.0 / trading_days_in_year
|
303
310
|
)
|
304
311
|
|
305
312
|
normal_mean = 0.0
|
306
|
-
wiener =
|
313
|
+
wiener = randomizer.normal(
|
307
314
|
loc=normal_mean,
|
308
315
|
scale=sqrt(1.0 / trading_days_in_year) * mean_annual_vol,
|
309
316
|
size=(number_of_sims, trading_days),
|
@@ -319,7 +326,6 @@ class ReturnSimulation(BaseModel):
|
|
319
326
|
mean_annual_vol=mean_annual_vol,
|
320
327
|
dframe=DataFrame(data=returns, dtype="float64"),
|
321
328
|
seed=seed,
|
322
|
-
randomizer=cls.randomizer,
|
323
329
|
)
|
324
330
|
|
325
331
|
@classmethod
|
@@ -334,6 +340,7 @@ class ReturnSimulation(BaseModel):
|
|
334
340
|
jumps_sigma: NonNegativeFloat = 0.0,
|
335
341
|
jumps_mu: float = 0.0,
|
336
342
|
trading_days_in_year: DaysInYearType = 252,
|
343
|
+
randomizer: Optional[Generator] = None,
|
337
344
|
) -> ReturnSimulation:
|
338
345
|
"""
|
339
346
|
Create a Merton Jump-Diffusion model simulation.
|
@@ -358,6 +365,8 @@ class ReturnSimulation(BaseModel):
|
|
358
365
|
This is the average jump size
|
359
366
|
trading_days_in_year: DaysInYearType, default: 252
|
360
367
|
Number of trading days used to annualize
|
368
|
+
randomizer: numpy.random.Generator, optional
|
369
|
+
Random process generator
|
361
370
|
|
362
371
|
Returns
|
363
372
|
-------
|
@@ -365,21 +374,22 @@ class ReturnSimulation(BaseModel):
|
|
365
374
|
Merton Jump-Diffusion model simulation
|
366
375
|
|
367
376
|
"""
|
368
|
-
|
377
|
+
if not randomizer:
|
378
|
+
randomizer = random_generator(seed=seed)
|
369
379
|
|
370
380
|
normal_mean = 0.0
|
371
|
-
wiener =
|
381
|
+
wiener = randomizer.normal(
|
372
382
|
loc=normal_mean,
|
373
383
|
scale=sqrt(1.0 / trading_days_in_year) * mean_annual_vol,
|
374
384
|
size=(number_of_sims, trading_days),
|
375
385
|
)
|
376
386
|
|
377
387
|
poisson_jumps = multiply(
|
378
|
-
|
388
|
+
randomizer.poisson(
|
379
389
|
lam=jumps_lamda * (1.0 / trading_days_in_year),
|
380
390
|
size=(number_of_sims, trading_days),
|
381
391
|
),
|
382
|
-
|
392
|
+
randomizer.normal(
|
383
393
|
loc=jumps_mu,
|
384
394
|
scale=jumps_sigma,
|
385
395
|
size=(number_of_sims, trading_days),
|
@@ -407,7 +417,6 @@ class ReturnSimulation(BaseModel):
|
|
407
417
|
jumps_mu=jumps_mu,
|
408
418
|
dframe=DataFrame(data=returns, dtype="float64"),
|
409
419
|
seed=seed,
|
410
|
-
randomizer=cls.randomizer,
|
411
420
|
)
|
412
421
|
|
413
422
|
def to_dataframe(
|
openseries/types.py
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
"""Declaring types used throughout the project."""
|
2
|
+
|
2
3
|
from __future__ import annotations
|
3
4
|
|
4
5
|
import datetime as dt
|
@@ -8,6 +9,7 @@ from typing import Annotated, ClassVar, Literal, Union
|
|
8
9
|
from numpy import datetime64
|
9
10
|
from pandas import Timestamp
|
10
11
|
from pydantic import BaseModel, Field, StringConstraints, conlist, conset
|
12
|
+
from typing_extensions import Self
|
11
13
|
|
12
14
|
CountryStringType = Annotated[
|
13
15
|
str,
|
@@ -119,6 +121,7 @@ LiteralLinePlotMode = Literal[
|
|
119
121
|
"lines+text",
|
120
122
|
"markers+text",
|
121
123
|
"lines+markers+text",
|
124
|
+
None,
|
122
125
|
]
|
123
126
|
LiteralHowMerge = Literal["outer", "inner"]
|
124
127
|
LiteralQuantileInterp = Literal["linear", "lower", "higher", "midpoint", "nearest"]
|
@@ -137,7 +140,7 @@ LiteralBarPlotMode = Literal["stack", "group", "overlay", "relative"]
|
|
137
140
|
LiteralPlotlyOutput = Literal["file", "div"]
|
138
141
|
LiteralPlotlyJSlib = Literal[True, False, "cdn"]
|
139
142
|
LiteralOlsFitMethod = Literal["pinv", "qr"]
|
140
|
-
LiteralPortfolioWeightings = Literal["eq_weights", "
|
143
|
+
LiteralPortfolioWeightings = Literal["eq_weights", "inv_vol"]
|
141
144
|
LiteralOlsFitCovType = Literal[
|
142
145
|
"nonrobust",
|
143
146
|
"fixed scale",
|
@@ -238,14 +241,14 @@ class OpenTimeSeriesPropertiesList(list[str]):
|
|
238
241
|
}
|
239
242
|
|
240
243
|
def __init__(
|
241
|
-
self:
|
244
|
+
self: Self,
|
242
245
|
*args: LiteralSeriesProps,
|
243
246
|
) -> None:
|
244
247
|
"""Property arguments for the OpenTimeSeries class."""
|
245
248
|
super().__init__(args)
|
246
249
|
self._validate()
|
247
250
|
|
248
|
-
def _validate(self:
|
251
|
+
def _validate(self: Self) -> None:
|
249
252
|
seen = set()
|
250
253
|
for item in self:
|
251
254
|
if item not in self.allowed_strings:
|
@@ -291,12 +294,12 @@ class OpenFramePropertiesList(list[str]):
|
|
291
294
|
"span_of_days_all",
|
292
295
|
}
|
293
296
|
|
294
|
-
def __init__(self:
|
297
|
+
def __init__(self: Self, *args: LiteralFrameProps) -> None:
|
295
298
|
"""Property arguments for the OpenFrame class."""
|
296
299
|
super().__init__(args)
|
297
300
|
self._validate()
|
298
301
|
|
299
|
-
def _validate(self:
|
302
|
+
def _validate(self: Self) -> None:
|
300
303
|
seen = set()
|
301
304
|
for item in self:
|
302
305
|
if item not in self.allowed_strings:
|
@@ -1,8 +1,8 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: openseries
|
3
|
-
Version: 1.5.
|
4
|
-
Summary:
|
5
|
-
Home-page: https://github.com/CaptorAB/
|
3
|
+
Version: 1.5.3
|
4
|
+
Summary: Tools for analyzing financial timeseries.
|
5
|
+
Home-page: https://github.com/CaptorAB/openseries
|
6
6
|
License: BSD-3-Clause
|
7
7
|
Keywords: python,finance,fintech,data-science,timeseries,timeseries-data,timeseries-analysis,investment,investment-analysis,investing
|
8
8
|
Author: Martin Karrin
|
@@ -25,13 +25,13 @@ Requires-Dist: numpy (>=1.23.2,<=2.0.0)
|
|
25
25
|
Requires-Dist: openpyxl (>=3.1.2,<4.0.0)
|
26
26
|
Requires-Dist: pandas (>=2.1.2,<3.0.0)
|
27
27
|
Requires-Dist: plotly (>=5.18.0,<6.0.0)
|
28
|
-
Requires-Dist: pyarrow (>=14.0.2,<
|
28
|
+
Requires-Dist: pyarrow (>=14.0.2,<17.0.0)
|
29
29
|
Requires-Dist: pydantic (>=2.5.2,<3.0.0)
|
30
30
|
Requires-Dist: python-dateutil (>=2.8.2,<3.0.0)
|
31
31
|
Requires-Dist: requests (>=2.20.0,<3.0.0)
|
32
32
|
Requires-Dist: scipy (>=1.11.4,<2.0.0)
|
33
33
|
Requires-Dist: statsmodels (>=0.14.0,<1.0.0)
|
34
|
-
Project-URL: Repository, https://github.com/CaptorAB/
|
34
|
+
Project-URL: Repository, https://github.com/CaptorAB/openseries
|
35
35
|
Description-Content-Type: text/markdown
|
36
36
|
|
37
37
|
<img src="https://sales.captor.se/captor_logo_sv_1600_icketransparent.png" alt="Captor
|
@@ -40,23 +40,23 @@ width="81" height="100" align="left" float="right"/><br/>
|
|
40
40
|
|
41
41
|
<br><br>
|
42
42
|
|
43
|
-
#
|
43
|
+
# openseries
|
44
44
|
|
45
45
|
[](https://pypi.org/project/openseries/)
|
46
46
|
[](https://anaconda.org/conda-forge/openseries)
|
47
47
|
[](https://anaconda.org/conda-forge/openseries)
|
48
48
|
[](https://www.python.org/)
|
49
|
-
[](https://github.com/CaptorAB/openseries/actions/workflows/test.yml)
|
50
|
+
[](https://github.com/CaptorAB/openseries/actions/workflows/test.yml)
|
51
|
+
[](https://github.com/CaptorAB/openseries/actions/workflows/check.yml)
|
52
52
|
[](https://python-poetry.org/)
|
53
53
|
[](https://beta.ruff.rs/docs/)
|
54
54
|
[](https://opensource.org/licenses/BSD-3-Clause)
|
55
55
|
|
56
|
-
|
56
|
+
`openseries` is a project with tools to analyse financial timeseries of a single
|
57
57
|
asset or a group of assets. It is solely made for daily or less frequent data.
|
58
58
|
|
59
|
-
<span style="font-size:2em;">[CHANGELOG](https://github.com/CaptorAB/
|
59
|
+
<span style="font-size:2em;">[CHANGELOG](https://github.com/CaptorAB/openseries/blob/master/CHANGELOG.md)</span>
|
60
60
|
|
61
61
|
|
62
62
|
## Basic Usage
|
@@ -138,8 +138,8 @@ on any attributes or methods inherited from this model.
|
|
138
138
|
### Windows Powershell
|
139
139
|
|
140
140
|
```powershell
|
141
|
-
git clone https://github.com/CaptorAB/
|
142
|
-
cd
|
141
|
+
git clone https://github.com/CaptorAB/openseries.git
|
142
|
+
cd openseries
|
143
143
|
./make.ps1 make
|
144
144
|
|
145
145
|
```
|
@@ -147,8 +147,8 @@ cd OpenSeries
|
|
147
147
|
### Mac Terminal/Linux
|
148
148
|
|
149
149
|
```bash
|
150
|
-
git clone https://github.com/CaptorAB/
|
151
|
-
cd
|
150
|
+
git clone https://github.com/CaptorAB/openseries.git
|
151
|
+
cd openseries
|
152
152
|
make
|
153
153
|
source source_me
|
154
154
|
make install
|
@@ -161,7 +161,7 @@ Ruff and Mypy checking is embedded in the pre-commit hook. Both
|
|
161
161
|
are also used in the project's GitHub workflows and are run when the `lint`
|
162
162
|
alternative is chosen in the below commands.
|
163
163
|
Any silenced error codes can be found in the
|
164
|
-
[pyproject.toml](https://github.com/CaptorAB/
|
164
|
+
[pyproject.toml](https://github.com/CaptorAB/openseries/blob/master/pyproject.toml)
|
165
165
|
file or in in-line comments.
|
166
166
|
|
167
167
|
### Windows Powershell
|
@@ -201,9 +201,9 @@ make lint
|
|
201
201
|
|
202
202
|
| File | Description |
|
203
203
|
|:-----------------------------------------------------------------------------------------------------------------|:------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
204
|
-
| [series.py](https://github.com/CaptorAB/
|
205
|
-
| [frame.py](https://github.com/CaptorAB/
|
206
|
-
| [simulation.py](https://github.com/CaptorAB/
|
204
|
+
| [series.py](https://github.com/CaptorAB/openseries/blob/master/openseries/series.py) | Defines the class _OpenTimeSeries_ for managing and analyzing a single timeseries. The module also defines a function `timeseries_chain` that can be used to chain two timeseries objects together. |
|
205
|
+
| [frame.py](https://github.com/CaptorAB/openseries/blob/master/openseries/frame.py) | Defines the class _OpenFrame_ for managing a group of timeseries, and e.g. calculate a portfolio timeseries from a rebalancing strategy between timeseries. The module also defines functions to simulate, optimize, and plot portfolios. |
|
206
|
+
| [simulation.py](https://github.com/CaptorAB/openseries/blob/master/openseries/simulation.py) | Defines the class _ReturnSimulation_ to create simulated financial timeseries. Used in the project's test suite |
|
207
207
|
|
208
208
|
### Class methods used to construct objects.
|
209
209
|
|
@@ -214,7 +214,7 @@ make lint
|
|
214
214
|
| `from_fixed_rate` | `OpenTimeSeries` | Class method to create an OpenTimeSeries object from a fixed rate, number of days and an end date. |
|
215
215
|
| `from_deepcopy` | `OpenTimeSeries`, `OpenFrame` | Creates a copy of an OpenTimeSeries object. |
|
216
216
|
|
217
|
-
### Non-numerical or "helper" properties that apply only to the [OpenTimeSeries](https://github.com/CaptorAB/
|
217
|
+
### Non-numerical or "helper" properties that apply only to the [OpenTimeSeries](https://github.com/CaptorAB/openseries/blob/master/openseries/series.py) class.
|
218
218
|
|
219
219
|
| Property | type | Applies to | Description |
|
220
220
|
|:----------------|:----------------|:-----------------|:---------------------------------------------------------------------------------------------------------------------------------------------|
|
@@ -231,7 +231,7 @@ make lint
|
|
231
231
|
| `countries` | `list` or `str` | `OpenTimeSeries` | (List of) country code(s) according to ISO 3166-1 alpha-2 used to generate business days. |
|
232
232
|
| `valuetype` | `ValueType` | `OpenTimeSeries` | Field identifies the type of values in the series. ValueType is an Enum. |
|
233
233
|
|
234
|
-
### Non-numerical or "helper" properties that apply only to the [OpenFrame](https://github.com/CaptorAB/
|
234
|
+
### Non-numerical or "helper" properties that apply only to the [OpenFrame](https://github.com/CaptorAB/openseries/blob/master/openseries/frame.py) class.
|
235
235
|
|
236
236
|
| Property | type | Applies to | Description |
|
237
237
|
|:-------------------|:-----------------------|:------------|:-------------------------------------------------------------------------|
|
@@ -245,7 +245,7 @@ make lint
|
|
245
245
|
| `lengths_of_items` | `pandas.Series` | `OpenFrame` | Number of items in each of the series in the OpenFrame. |
|
246
246
|
| `span_of_days_all` | `pandas.Series` | `OpenFrame` | Number of days from the first to the last in each of the series. |
|
247
247
|
|
248
|
-
### Non-numerical or "helper" properties that apply to both the [OpenTimeSeries](https://github.com/CaptorAB/
|
248
|
+
### Non-numerical or "helper" properties that apply to both the [OpenTimeSeries](https://github.com/CaptorAB/openseries/blob/master/openseries/series.py) and the [OpenFrame](https://github.com/CaptorAB/openseries/blob/master/openseries/frame.py) class.
|
249
249
|
|
250
250
|
| Property | type | Applies to | Description |
|
251
251
|
|:--------------------|:---------------------------------|:------------------------------|:----------------------------------------------------------------------------------|
|
@@ -258,7 +258,7 @@ make lint
|
|
258
258
|
| `periods_in_a_year` | `float` | `OpenTimeSeries`, `OpenFrame` | The number of observations in an average year for all days in the data. |
|
259
259
|
| `yearfrac` | `float` | `OpenTimeSeries`, `OpenFrame` | Length of timeseries expressed as np.float64 fraction of a year with 365.25 days. |
|
260
260
|
|
261
|
-
### Methods that apply only to the [OpenTimeSeries](https://github.com/CaptorAB/
|
261
|
+
### Methods that apply only to the [OpenTimeSeries](https://github.com/CaptorAB/openseries/blob/master/openseries/series.py) class.
|
262
262
|
|
263
263
|
| Method | Applies to | Description |
|
264
264
|
|:-------------------------|:-----------------|:-----------------------------------------------------------------------------------------------------------------------------------------------|
|
@@ -270,7 +270,7 @@ make lint
|
|
270
270
|
| `from_1d_rate_to_cumret` | `OpenTimeSeries` | Converts a series of 1-day rates into a cumulative valueseries. |
|
271
271
|
|
|
272
272
|
|
273
|
-
### Methods that apply only to the [OpenFrame](https://github.com/CaptorAB/
|
273
|
+
### Methods that apply only to the [OpenFrame](https://github.com/CaptorAB/openseries/blob/master/openseries/frame.py) class.
|
274
274
|
|
275
275
|
| Method | Applies to | Description |
|
276
276
|
|:------------------------|:------------|:-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
@@ -289,9 +289,10 @@ make lint
|
|
289
289
|
| `rolling_info_ratio` | `OpenFrame` | Returns a pandas.DataFrame with the rolling [information ratio](https://www.investopedia.com/terms/i/informationratio.asp) between two series. |
|
290
290
|
| `rolling_beta` | `OpenFrame` | Returns a pandas.DataFrame with the rolling [Beta](https://www.investopedia.com/terms/b/beta.asp) of an asset relative a market. |
|
291
291
|
| `rolling_corr` | `OpenFrame` | Calculates and adds a series of rolling [correlations](https://www.investopedia.com/terms/c/correlation.asp) between two other series. |
|
292
|
+
| `correl_matrix` | `OpenFrame` | Returns a `pandas.DataFrame` with a correlation matrix. |
|
292
293
|
| `ewma_risk` | `OpenFrame` | Returns a `pandas.DataFrame` with volatility and correlation based on [Exponentially Weighted Moving Average](https://www.investopedia.com/articles/07/ewma.asp). |
|
293
294
|
|
294
|
-
### Methods that apply to both the [OpenTimeSeries](https://github.com/CaptorAB/
|
295
|
+
### Methods that apply to both the [OpenTimeSeries](https://github.com/CaptorAB/openseries/blob/master/openseries/series.py) and the [OpenFrame](https://github.com/CaptorAB/openseries/blob/master/openseries/frame.py) class.
|
295
296
|
|
296
297
|
| Method | Applies to | Description |
|
297
298
|
|:-----------------------------------|:------------------------------|:---------------------------------------------------------------------------------------------------------------------------------------------------------|
|
@@ -316,7 +317,7 @@ make lint
|
|
316
317
|
| `rolling_cvar_down` | `OpenTimeSeries`, `OpenFrame` | Returns a pandas.DataFrame with rolling CVaR figures. |
|
317
318
|
| `calc_range` | `OpenTimeSeries`, `OpenFrame` | Returns the start and end dates of a range from specific period definitions. Used by the below numerical methods and not meant to be used independently. |
|
318
319
|
|
319
|
-
### Numerical properties available for individual [OpenTimeSeries](https://github.com/CaptorAB/
|
320
|
+
### Numerical properties available for individual [OpenTimeSeries](https://github.com/CaptorAB/openseries/blob/master/openseries/series.py) or on all series in an [OpenFrame](https://github.com/CaptorAB/openseries/blob/master/openseries/frame.py).
|
320
321
|
|
321
322
|
| Property | type | Applies to | Description |
|
322
323
|
|:------------------------|:-------------------------|:------------------------------|:------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
@@ -339,7 +340,6 @@ make lint
|
|
339
340
|
| `skew` | `float`, `pandas.Series` | `OpenTimeSeries`, `OpenFrame` | [Skew](https://www.investopedia.com/terms/s/skewness.asp) of the return distribution. |
|
340
341
|
| `kurtosis` | `float`, `pandas.Series` | `OpenTimeSeries`, `OpenFrame` | [Kurtosis](https://www.investopedia.com/terms/k/kurtosis.asp) of the return distribution. |
|
341
342
|
| `z_score` | `float`, `pandas.Series` | `OpenTimeSeries`, `OpenFrame` | [Z-score](https://www.investopedia.com/terms/z/zscore.asp) as (last return - mean return) / standard deviation of returns. |
|
342
|
-
| `correl_matrix` | `pandas.DataFrame` | `OpenFrame` | A correlation matrix. |
|
343
343
|
|
344
344
|
### Methods below are identical to the Numerical Properties above.
|
345
345
|
|
@@ -0,0 +1,15 @@
|
|
1
|
+
openseries/__init__.py,sha256=W429Ojwa-wPgHV5PDAOQOBOAzPOR4wrVHRwdZQjRKcQ,41
|
2
|
+
openseries/_common_model.py,sha256=whzIHppEGjXqv2C5ZBg7c-QTCC6dHWBjNKX40WV_c6g,72469
|
3
|
+
openseries/_risk.py,sha256=4ckiA-0-uuoUOsuc_uElUA_2rLS_U3xJyiva2BX4W1s,3300
|
4
|
+
openseries/datefixer.py,sha256=ZOSPp4kLkMEsZv50GQaSo2vAEDVaXEr9iX3wTO7ZdB4,12378
|
5
|
+
openseries/frame.py,sha256=SH1sPUFoJS71o2uVJBLoDl3rSC8AP7wQZw3baMD9T4U,74019
|
6
|
+
openseries/load_plotly.py,sha256=V99KNaG3OAYsQYKRmpp2-WHgLAQNxKcgrDXpXZ7K8io,1808
|
7
|
+
openseries/plotly_captor_logo.json,sha256=F5nhMzEyxKywtjvQqMTKgKRCJQYMDIiBgDSxdte8Clo,178
|
8
|
+
openseries/plotly_layouts.json,sha256=ahx8-dL4_RPzvHtBOX0SiL0AH7xQJzNRSDhGrSmU-Og,1429
|
9
|
+
openseries/series.py,sha256=pIpiD3v8z7SyIppBatbsPuqOWCf3qI_us2145JnPUkQ,28313
|
10
|
+
openseries/simulation.py,sha256=VYxc-e5VSyC55DdfACpQen-necYbhso-6RMyOhYX-5k,13905
|
11
|
+
openseries/types.py,sha256=qOKWorkGsv22Q0b2RvMW8IS2pkO3PJlbhQfAviRYNts,7597
|
12
|
+
openseries-1.5.3.dist-info/LICENSE.md,sha256=cPUabMxJ6-ziqzqS6aLGkR-ilIOKe_s3Qtyp0ioTmo0,1521
|
13
|
+
openseries-1.5.3.dist-info/METADATA,sha256=3OfZAp-QudbPL2HwXiVCMz-zVAMkSVLV2n4APtzZSLg,43579
|
14
|
+
openseries-1.5.3.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
|
15
|
+
openseries-1.5.3.dist-info/RECORD,,
|
@@ -1,15 +0,0 @@
|
|
1
|
-
openseries/__init__.py,sha256=hA7I5IFk88EnX6eyBbI1KLT_FGcmPIKF49xa5g3T8Yg,41
|
2
|
-
openseries/_common_model.py,sha256=whzIHppEGjXqv2C5ZBg7c-QTCC6dHWBjNKX40WV_c6g,72469
|
3
|
-
openseries/_risk.py,sha256=JnwAklqs2G3YIp9KTNKbumqs4VgfFIk-eFs0dZ-_jCY,3299
|
4
|
-
openseries/datefixer.py,sha256=_HNiPR6S3agwOAk8gl3wIdegR6uDbh-00J1Zgo4GMl8,12423
|
5
|
-
openseries/frame.py,sha256=en_GL0_l9OHsZk6AmYin5Pip7geLyTeLZNAZqIR4xcI,73772
|
6
|
-
openseries/load_plotly.py,sha256=kIjvJ2H1sIXWsjd-mZclLvj7ebh-4Hdb1dwB2gR9b-Y,1807
|
7
|
-
openseries/plotly_captor_logo.json,sha256=F5nhMzEyxKywtjvQqMTKgKRCJQYMDIiBgDSxdte8Clo,178
|
8
|
-
openseries/plotly_layouts.json,sha256=ahx8-dL4_RPzvHtBOX0SiL0AH7xQJzNRSDhGrSmU-Og,1429
|
9
|
-
openseries/series.py,sha256=jHbJkzFUeGokUJZ1Md4Hx1keSwpNMjPq1r_FDCputIE,28312
|
10
|
-
openseries/simulation.py,sha256=_1cYO4VnlRI6khk6Th8ziN5Toz1iry0jFKICHQub3V0,13550
|
11
|
-
openseries/types.py,sha256=Qw-ny6IZtdMeuHJF6FvIE0B2stnN3sdqq9fySIKUWK4,7660
|
12
|
-
openseries-1.5.1.dist-info/LICENSE.md,sha256=cPUabMxJ6-ziqzqS6aLGkR-ilIOKe_s3Qtyp0ioTmo0,1521
|
13
|
-
openseries-1.5.1.dist-info/METADATA,sha256=N1NAZ6l6V2pfc-EZAzF1kVTaLNAg7OrfVr1juoaUPMA,43665
|
14
|
-
openseries-1.5.1.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
|
15
|
-
openseries-1.5.1.dist-info/RECORD,,
|
File without changes
|
File without changes
|