cadlag-quant 0.1.0a1__tar.gz
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.
- cadlag_quant-0.1.0a1/LICENSE +21 -0
- cadlag_quant-0.1.0a1/PKG-INFO +62 -0
- cadlag_quant-0.1.0a1/README.md +40 -0
- cadlag_quant-0.1.0a1/pyproject.toml +33 -0
- cadlag_quant-0.1.0a1/setup.cfg +4 -0
- cadlag_quant-0.1.0a1/src/cadlag_quant/__init__.py +3 -0
- cadlag_quant-0.1.0a1/src/cadlag_quant/__main__.py +38 -0
- cadlag_quant-0.1.0a1/src/cadlag_quant.egg-info/PKG-INFO +62 -0
- cadlag_quant-0.1.0a1/src/cadlag_quant.egg-info/SOURCES.txt +11 -0
- cadlag_quant-0.1.0a1/src/cadlag_quant.egg-info/dependency_links.txt +1 -0
- cadlag_quant-0.1.0a1/src/cadlag_quant.egg-info/entry_points.txt +2 -0
- cadlag_quant-0.1.0a1/src/cadlag_quant.egg-info/requires.txt +6 -0
- cadlag_quant-0.1.0a1/src/cadlag_quant.egg-info/top_level.txt +1 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Cadlag contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: cadlag-quant
|
|
3
|
+
Version: 0.1.0a1
|
|
4
|
+
Summary: Command-line bundle for the Cadlag Mini educational backtesting toolkit
|
|
5
|
+
Author: Cadlag contributors
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
Project-URL: Homepage, https://cadlag.pro
|
|
8
|
+
Classifier: Development Status :: 3 - Alpha
|
|
9
|
+
Classifier: Intended Audience :: Education
|
|
10
|
+
Classifier: Programming Language :: Python :: 3
|
|
11
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
12
|
+
Classifier: Operating System :: OS Independent
|
|
13
|
+
Requires-Python: >=3.10
|
|
14
|
+
Description-Content-Type: text/markdown
|
|
15
|
+
License-File: LICENSE
|
|
16
|
+
Requires-Dist: cadlag-sdk==0.1.0a1
|
|
17
|
+
Requires-Dist: cadlag-ce==0.1.0a1
|
|
18
|
+
Requires-Dist: cadlag-starter==0.1.0a1
|
|
19
|
+
Provides-Extra: analytics
|
|
20
|
+
Requires-Dist: cadlag-pro==0.1.0a1; extra == "analytics"
|
|
21
|
+
Dynamic: license-file
|
|
22
|
+
|
|
23
|
+
# cadlag-quant — Cadlag Mini
|
|
24
|
+
|
|
25
|
+
**Version 0.1.0a1 is an educational miniature written independently from scratch.**
|
|
26
|
+
It provides the small functionality described below. It does not provide the full
|
|
27
|
+
Cadlag platform and is not API-compatible with previous Cadlag distributions.
|
|
28
|
+
It is an alpha release for learning and experimentation, not live trading.
|
|
29
|
+
|
|
30
|
+
Command-line bundle for the Cadlag Mini educational backtesting toolkit.
|
|
31
|
+
|
|
32
|
+
## Usage
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
pip install "cadlag-quant==0.1.0a1"
|
|
36
|
+
cadlag-mini
|
|
37
|
+
cadlag-mini --csv prices.csv --window 5 --cash 1000 --fee-bps 10
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
Optional basic analytics:
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
pip install "cadlag-quant[analytics]==0.1.0a1"
|
|
44
|
+
cadlag-mini --analytics
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
Input CSV must have exactly `date,close` columns, ISO dates in increasing order,
|
|
48
|
+
and finite positive prices. With no CSV, the command uses synthetic sample data.
|
|
49
|
+
Output is a JSON equity curve, trade count and total return. Values are illustrative
|
|
50
|
+
and depend on simplified execution assumptions; no live trading is performed.
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
## Package family
|
|
54
|
+
|
|
55
|
+
- `cadlag-sdk`: price records and CSV validation.
|
|
56
|
+
- `cadlag-ce`: a prior-close moving-average strategy and equity curve.
|
|
57
|
+
- `cadlag-starter`: synthetic sample prices and a runnable example.
|
|
58
|
+
- `cadlag-pro`: basic drawdown and volatility calculations.
|
|
59
|
+
- `cadlag-quant`: command-line bundle, with optional analytics extra.
|
|
60
|
+
|
|
61
|
+
All Mini components use version `0.1.0a1` and are MIT licensed. Only Python's
|
|
62
|
+
standard library is used beyond dependencies on other Mini components.
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
# cadlag-quant — Cadlag Mini
|
|
2
|
+
|
|
3
|
+
**Version 0.1.0a1 is an educational miniature written independently from scratch.**
|
|
4
|
+
It provides the small functionality described below. It does not provide the full
|
|
5
|
+
Cadlag platform and is not API-compatible with previous Cadlag distributions.
|
|
6
|
+
It is an alpha release for learning and experimentation, not live trading.
|
|
7
|
+
|
|
8
|
+
Command-line bundle for the Cadlag Mini educational backtesting toolkit.
|
|
9
|
+
|
|
10
|
+
## Usage
|
|
11
|
+
|
|
12
|
+
```bash
|
|
13
|
+
pip install "cadlag-quant==0.1.0a1"
|
|
14
|
+
cadlag-mini
|
|
15
|
+
cadlag-mini --csv prices.csv --window 5 --cash 1000 --fee-bps 10
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
Optional basic analytics:
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
pip install "cadlag-quant[analytics]==0.1.0a1"
|
|
22
|
+
cadlag-mini --analytics
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
Input CSV must have exactly `date,close` columns, ISO dates in increasing order,
|
|
26
|
+
and finite positive prices. With no CSV, the command uses synthetic sample data.
|
|
27
|
+
Output is a JSON equity curve, trade count and total return. Values are illustrative
|
|
28
|
+
and depend on simplified execution assumptions; no live trading is performed.
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
## Package family
|
|
32
|
+
|
|
33
|
+
- `cadlag-sdk`: price records and CSV validation.
|
|
34
|
+
- `cadlag-ce`: a prior-close moving-average strategy and equity curve.
|
|
35
|
+
- `cadlag-starter`: synthetic sample prices and a runnable example.
|
|
36
|
+
- `cadlag-pro`: basic drawdown and volatility calculations.
|
|
37
|
+
- `cadlag-quant`: command-line bundle, with optional analytics extra.
|
|
38
|
+
|
|
39
|
+
All Mini components use version `0.1.0a1` and are MIT licensed. Only Python's
|
|
40
|
+
standard library is used beyond dependencies on other Mini components.
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=77"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "cadlag-quant"
|
|
7
|
+
version = "0.1.0a1"
|
|
8
|
+
description = "Command-line bundle for the Cadlag Mini educational backtesting toolkit"
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
requires-python = ">=3.10"
|
|
11
|
+
license = "MIT"
|
|
12
|
+
license-files = ["LICENSE"]
|
|
13
|
+
authors = [{name = "Cadlag contributors"}]
|
|
14
|
+
classifiers = [
|
|
15
|
+
"Development Status :: 3 - Alpha",
|
|
16
|
+
"Intended Audience :: Education",
|
|
17
|
+
"Programming Language :: Python :: 3",
|
|
18
|
+
"Programming Language :: Python :: 3 :: Only",
|
|
19
|
+
"Operating System :: OS Independent",
|
|
20
|
+
]
|
|
21
|
+
dependencies = ["cadlag-sdk==0.1.0a1", "cadlag-ce==0.1.0a1", "cadlag-starter==0.1.0a1"]
|
|
22
|
+
|
|
23
|
+
[project.urls]
|
|
24
|
+
Homepage = "https://cadlag.pro"
|
|
25
|
+
|
|
26
|
+
[tool.setuptools.packages.find]
|
|
27
|
+
where = ["src"]
|
|
28
|
+
|
|
29
|
+
[project.optional-dependencies]
|
|
30
|
+
analytics = ["cadlag-pro==0.1.0a1"]
|
|
31
|
+
|
|
32
|
+
[project.scripts]
|
|
33
|
+
cadlag-mini = "cadlag_quant.__main__:main"
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
import argparse
|
|
4
|
+
import json
|
|
5
|
+
|
|
6
|
+
from cadlag_ce import backtest
|
|
7
|
+
from cadlag_sdk import load_prices
|
|
8
|
+
from cadlag_starter import sample_prices
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
def main() -> None:
|
|
12
|
+
parser = argparse.ArgumentParser(description="Cadlag Mini: educational CSV backtesting")
|
|
13
|
+
parser.add_argument("--version", action="version", version="Cadlag Mini 0.1.0a1")
|
|
14
|
+
parser.add_argument("--csv", help="CSV file with date,close columns; default: bundled synthetic data")
|
|
15
|
+
parser.add_argument("--window", type=int, default=3)
|
|
16
|
+
parser.add_argument("--cash", type=float, default=1000.0)
|
|
17
|
+
parser.add_argument("--fee-bps", type=float, default=0.0)
|
|
18
|
+
parser.add_argument("--analytics", action="store_true", help="Include drawdown and volatility (requires cadlag-pro mini)")
|
|
19
|
+
args = parser.parse_args()
|
|
20
|
+
try:
|
|
21
|
+
prices = load_prices(args.csv) if args.csv else sample_prices()
|
|
22
|
+
result = backtest(prices, window=args.window, initial_cash=args.cash, fee_bps=args.fee_bps)
|
|
23
|
+
report = {"edition": "Cadlag Mini educational prerelease", **result.as_dict()}
|
|
24
|
+
if args.analytics:
|
|
25
|
+
try:
|
|
26
|
+
from cadlag_pro import annualized_volatility, max_drawdown
|
|
27
|
+
except ImportError:
|
|
28
|
+
parser.error("analytics requires: pip install 'cadlag-quant[analytics]==0.1.0a1'")
|
|
29
|
+
report["max_drawdown"] = max_drawdown(result.equity)
|
|
30
|
+
report["annualized_volatility"] = annualized_volatility(result.equity)
|
|
31
|
+
print(json.dumps(report, indent=2, allow_nan=False))
|
|
32
|
+
except (OSError, ValueError, OverflowError) as exc:
|
|
33
|
+
parser.error(str(exc))
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
if __name__ == "__main__":
|
|
37
|
+
main()
|
|
38
|
+
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: cadlag-quant
|
|
3
|
+
Version: 0.1.0a1
|
|
4
|
+
Summary: Command-line bundle for the Cadlag Mini educational backtesting toolkit
|
|
5
|
+
Author: Cadlag contributors
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
Project-URL: Homepage, https://cadlag.pro
|
|
8
|
+
Classifier: Development Status :: 3 - Alpha
|
|
9
|
+
Classifier: Intended Audience :: Education
|
|
10
|
+
Classifier: Programming Language :: Python :: 3
|
|
11
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
12
|
+
Classifier: Operating System :: OS Independent
|
|
13
|
+
Requires-Python: >=3.10
|
|
14
|
+
Description-Content-Type: text/markdown
|
|
15
|
+
License-File: LICENSE
|
|
16
|
+
Requires-Dist: cadlag-sdk==0.1.0a1
|
|
17
|
+
Requires-Dist: cadlag-ce==0.1.0a1
|
|
18
|
+
Requires-Dist: cadlag-starter==0.1.0a1
|
|
19
|
+
Provides-Extra: analytics
|
|
20
|
+
Requires-Dist: cadlag-pro==0.1.0a1; extra == "analytics"
|
|
21
|
+
Dynamic: license-file
|
|
22
|
+
|
|
23
|
+
# cadlag-quant — Cadlag Mini
|
|
24
|
+
|
|
25
|
+
**Version 0.1.0a1 is an educational miniature written independently from scratch.**
|
|
26
|
+
It provides the small functionality described below. It does not provide the full
|
|
27
|
+
Cadlag platform and is not API-compatible with previous Cadlag distributions.
|
|
28
|
+
It is an alpha release for learning and experimentation, not live trading.
|
|
29
|
+
|
|
30
|
+
Command-line bundle for the Cadlag Mini educational backtesting toolkit.
|
|
31
|
+
|
|
32
|
+
## Usage
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
pip install "cadlag-quant==0.1.0a1"
|
|
36
|
+
cadlag-mini
|
|
37
|
+
cadlag-mini --csv prices.csv --window 5 --cash 1000 --fee-bps 10
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
Optional basic analytics:
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
pip install "cadlag-quant[analytics]==0.1.0a1"
|
|
44
|
+
cadlag-mini --analytics
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
Input CSV must have exactly `date,close` columns, ISO dates in increasing order,
|
|
48
|
+
and finite positive prices. With no CSV, the command uses synthetic sample data.
|
|
49
|
+
Output is a JSON equity curve, trade count and total return. Values are illustrative
|
|
50
|
+
and depend on simplified execution assumptions; no live trading is performed.
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
## Package family
|
|
54
|
+
|
|
55
|
+
- `cadlag-sdk`: price records and CSV validation.
|
|
56
|
+
- `cadlag-ce`: a prior-close moving-average strategy and equity curve.
|
|
57
|
+
- `cadlag-starter`: synthetic sample prices and a runnable example.
|
|
58
|
+
- `cadlag-pro`: basic drawdown and volatility calculations.
|
|
59
|
+
- `cadlag-quant`: command-line bundle, with optional analytics extra.
|
|
60
|
+
|
|
61
|
+
All Mini components use version `0.1.0a1` and are MIT licensed. Only Python's
|
|
62
|
+
standard library is used beyond dependencies on other Mini components.
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
LICENSE
|
|
2
|
+
README.md
|
|
3
|
+
pyproject.toml
|
|
4
|
+
src/cadlag_quant/__init__.py
|
|
5
|
+
src/cadlag_quant/__main__.py
|
|
6
|
+
src/cadlag_quant.egg-info/PKG-INFO
|
|
7
|
+
src/cadlag_quant.egg-info/SOURCES.txt
|
|
8
|
+
src/cadlag_quant.egg-info/dependency_links.txt
|
|
9
|
+
src/cadlag_quant.egg-info/entry_points.txt
|
|
10
|
+
src/cadlag_quant.egg-info/requires.txt
|
|
11
|
+
src/cadlag_quant.egg-info/top_level.txt
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
cadlag_quant
|