Skip to content

Commit 21c0292

Browse files
committed
feat: add mid-cap and small-cap stock collections; enhance traderfox research configurations
- Introduced new YAML files for mid-cap and small-cap stock collections with relevant symbols and configurations. - Updated traderfox research YAML to include separate collections for different regions (DE, UK, NL, FR, CH, ES, US) with respective symbols. - Modified example.yaml to reflect changes in stock collections and added crypto collection. - Refactored ruff configuration to a dedicated ruff.toml file for better organization. - Enhanced yfinance data source handling to support multi-index columns for price fields.
1 parent 2942e6a commit 21c0292

33 files changed

+1168
-1678
lines changed

CHANGELOG.md

Lines changed: 0 additions & 19 deletions
This file was deleted.

Makefile

Lines changed: 41 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
SHELL := /bin/bash
22

3-
.PHONY: build build-nc sh run run-bonds run-crypto run-commodities run-indices run-forex list-strategies lock lock-update discover-crypto manifest-status dashboard
3+
.PHONY: build build-nc sh run run-stocks-dividend run-stocks-large-cap-value run-stocks-large-cap-growth run-stocks-mid-cap run-stocks-small-cap run-stocks-international run-stocks-emerging run-bonds-global run-bonds-high-yield run-bonds-corporate run-bonds-municipal run-bonds-tips run-bonds-us-treasuries run-crypto run-commodities list-strategies lock lock-update discover-crypto manifest-status dashboard
44

55
build:
66
docker-compose build
@@ -14,20 +14,50 @@ sh:
1414
run:
1515
docker-compose run --rm app bash -lc "poetry install && poetry run python -m src.main run --config config/example.yaml"
1616

17-
run-bonds:
18-
docker-compose run --rm app bash -lc "poetry install && RUN_ID=bonds-$(shell date +%Y%m%d%H%M) poetry run python -m src.main run --config config/collections/bonds_majors.yaml"
17+
run-stocks-dividend:
18+
docker-compose run --rm app bash -lc "poetry install && RUN_ID=stocks-dividend-$(shell date +%Y%m%d%H%M) poetry run python -m src.main run --config config/collections/stocks_dividend.yaml"
1919

20-
run-crypto:
21-
docker-compose run --rm app bash -lc "poetry install && RUN_ID=crypto-$(shell date +%Y%m%d%H%M) poetry run python -m src.main run --config config/collections/crypto_majors.yaml"
20+
run-stocks-large-cap-value:
21+
docker-compose run --rm app bash -lc "poetry install && RUN_ID=stocks-large-cap-value-$(shell date +%Y%m%d%H%M) poetry run python -m src.main run --config config/collections/stocks_large_cap_value.yaml"
2222

23-
run-commodities:
24-
docker-compose run --rm app bash -lc "poetry install && RUN_ID=commodities-$(shell date +%Y%m%d%H%M) poetry run python -m src.main run --config config/collections/commodities_majors.yaml"
23+
run-stocks-large-cap-growth:
24+
docker-compose run --rm app bash -lc "poetry install && RUN_ID=stocks-large-cap-growth-$(shell date +%Y%m%d%H%M) poetry run python -m src.main run --config config/collections/stocks_large_cap_growth.yaml"
25+
26+
run-stocks-mid-cap:
27+
docker-compose run --rm app bash -lc "poetry install && RUN_ID=stocks-mid-cap-$(shell date +%Y%m%d%H%M) poetry run python -m src.main run --config config/collections/stocks_mid_cap.yaml"
28+
29+
run-stocks-small-cap:
30+
docker-compose run --rm app bash -lc "poetry install && RUN_ID=stocks-small-cap-$(shell date +%Y%m%d%H%M) poetry run python -m src.main run --config config/collections/stocks_small_cap.yaml"
31+
32+
run-stocks-international:
33+
docker-compose run --rm app bash -lc "poetry install && RUN_ID=stocks-international-$(shell date +%Y%m%d%H%M) poetry run python -m src.main run --config config/collections/stocks_international.yaml"
34+
35+
run-stocks-emerging:
36+
docker-compose run --rm app bash -lc "poetry install && RUN_ID=stocks-emerging-$(shell date +%Y%m%d%H%M) poetry run python -m src.main run --config config/collections/stocks_emerging.yaml"
37+
38+
run-bonds-global:
39+
docker-compose run --rm app bash -lc "poetry install && RUN_ID=bonds-global-$(shell date +%Y%m%d%H%M) poetry run python -m src.main run --config config/collections/bonds_global.yaml"
2540

26-
run-indices:
27-
docker-compose run --rm app bash -lc "poetry install && RUN_ID=indices-$(shell date +%Y%m%d%H%M) poetry run python -m src.main run --config config/collections/indices_majors.yaml"
41+
run-bonds-high-yield:
42+
docker-compose run --rm app bash -lc "poetry install && RUN_ID=bonds-high-yield-$(shell date +%Y%m%d%H%M) poetry run python -m src.main run --config config/collections/bonds_high_yield.yaml"
2843

29-
run-forex:
30-
docker-compose run --rm app bash -lc "poetry install && RUN_ID=forex-$(shell date +%Y%m%d%H%M) poetry run python -m src.main run --config config/collections/forex_majors.yaml"
44+
run-bonds-corporate:
45+
docker-compose run --rm app bash -lc "poetry install && RUN_ID=bonds-corporate-$(shell date +%Y%m%d%H%M) poetry run python -m src.main run --config config/collections/bonds_corporate.yaml"
46+
47+
run-bonds-municipal:
48+
docker-compose run --rm app bash -lc "poetry install && RUN_ID=bonds-municipal-$(shell date +%Y%m%d%H%M) poetry run python -m src.main run --config config/collections/bonds_municipal.yaml"
49+
50+
run-bonds-tips:
51+
docker-compose run --rm app bash -lc "poetry install && RUN_ID=bonds-tips-$(shell date +%Y%m%d%H%M) poetry run python -m src.main run --config config/collections/bonds_tips.yaml"
52+
53+
run-bonds-us-treasuries:
54+
docker-compose run --rm app bash -lc "poetry install && RUN_ID=bonds-us-treasuries-$(shell date +%Y%m%d%H%M) poetry run python -m src.main run --config config/collections/bonds_us_treasuries.yaml"
55+
56+
run-crypto:
57+
docker-compose run --rm app bash -lc "poetry install && RUN_ID=crypto-$(shell date +%Y%m%d%H%M) poetry run python -m src.main run --config config/collections/crypto.yaml"
58+
59+
run-commodities:
60+
docker-compose run --rm app bash -lc "poetry install && RUN_ID=commodities-$(shell date +%Y%m%d%H%M) poetry run python -m src.main run --config config/collections/commodities.yaml"
3161

3262
list-strategies:
3363
docker-compose run --rm app bash -lc "poetry install && poetry run python -m src.main list-strategies --strategies-path /ext/strategies"

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ This repository provides a Docker-based, cache-aware backtesting system to syste
3636
- src/utils/telemetry.py: Structured logging utilities and timed context
3737
- src/reporting/: Markdown, CSV, TradingView exporters
3838
- config/example.yaml: Example configuration
39-
- config/collections/: Per-collection configs (crypto, bonds, commodities, indices)
39+
- config/collections/: Per-collection configs (stocks, bonds, crypto, commodities)
4040

4141
## Quick Start
4242

@@ -49,19 +49,19 @@ This repository provides a Docker-based, cache-aware backtesting system to syste
4949
4) Run via docker-compose (Poetry):
5050

5151
```bash
52-
docker-compose run --rm app bash -lc "poetry run python -m src.main run --config config/collections/crypto_majors.yaml"
53-
# or bonds/commodities/indices individually
54-
docker-compose run --rm app bash -lc "poetry run python -m src.main run --config config/collections/bonds_majors.yaml"
52+
docker-compose run --rm app bash -lc "poetry run python -m src.main run --config config/collections/crypto.yaml"
53+
# or stocks/bonds/commodities individually
54+
docker-compose run --rm app bash -lc "poetry run python -m src.main run --config config/collections/bonds_global.yaml"
5555
# generate reports with top-5 per symbol and offline HTML
56-
docker-compose run --rm app bash -lc "poetry run python -m src.main run --config config/collections/crypto_majors.yaml --top-n 5 --inline-css"
56+
docker-compose run --rm app bash -lc "poetry run python -m src.main run --config config/collections/crypto.yaml --top-n 5 --inline-css"
5757
```
5858

5959
## Make Targets
6060

6161
- `make build` / `make build-nc`: build image (no-cache).
6262
- `make sh`: open a shell in the container.
6363
- `make list-strategies`: verify external strategies are discovered.
64-
- `make run-bonds` / `make run-crypto` / `make run-commodities` / `make run-indices` / `make run-forex`: run a collection.
64+
- `make run-stocks-dividend` / `make run-stocks-large-cap-value` / `make run-stocks-large-cap-growth` / `make run-stocks-mid-cap` / `make run-stocks-small-cap` / `make run-stocks-international` / `make run-stocks-emerging` / `make run-bonds-global` / `make run-bonds-high-yield` / `make run-bonds-corporate` / `make run-bonds-municipal` / `make run-bonds-tips` / `make run-bonds-us-treasuries` / `make run-crypto` / `make run-commodities`: run a collection.
6565
- `make discover-crypto EXCHANGE=binance QUOTE=USDT TOP=100 OUT=config/collections/crypto_top100.yaml NAME=crypto_top100`: generate a crypto universe config.
6666
- `make lock` / `make lock-update`: create or update `poetry.lock` inside the container for reproducible builds.
6767
- `make manifest-status`: inspect the most recent run’s dashboard refresh actions (`--latest`).
Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -6,25 +6,15 @@ max_fetch_concurrency: 2
66
cache_dir: .cache/data
77

88
collections:
9-
- name: bonds_majors
10-
source: tiingo
9+
- name: bonds_corporate
10+
source: yfinance
1111
fees: 0.0005
1212
slippage: 0.0005
1313
symbols:
14-
- TLT
15-
- IEF
16-
- IEI
17-
- SHY
18-
- BIL
19-
- BND
20-
- AGG
21-
- LQD
22-
- HYG
23-
- JNK
24-
- IGSB
25-
- TIP
26-
- MUB
27-
- EMB
14+
- LQDE.L
15+
- LQDG.L
16+
- IEAC.L
17+
- CORP.L
2818

2919
timeframes: ["1d"]
3020

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
metric: sortino
2+
engine: pybroker
3+
asset_workers: 4
4+
param_workers: 1
5+
max_fetch_concurrency: 2
6+
cache_dir: .cache/data
7+
8+
collections:
9+
- name: bonds_global
10+
source: yfinance
11+
fees: 0.0005
12+
slippage: 0.0005
13+
symbols:
14+
- AGGH.L
15+
- VAGP.L
16+
- IGLA.L
17+
18+
timeframes: ["1d"]
19+
20+
strategies: []
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
metric: sortino
2+
engine: pybroker
3+
asset_workers: 4
4+
param_workers: 1
5+
max_fetch_concurrency: 2
6+
cache_dir: .cache/data
7+
8+
collections:
9+
- name: bonds_high_yield
10+
source: yfinance
11+
fees: 0.0005
12+
slippage: 0.0005
13+
symbols:
14+
- IHYG.L
15+
- SHYU.L
16+
17+
timeframes: ["1d"]
18+
19+
strategies: []
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
metric: sortino
2+
engine: pybroker
3+
asset_workers: 4
4+
param_workers: 1
5+
max_fetch_concurrency: 2
6+
cache_dir: .cache/data
7+
8+
collections:
9+
- name: bonds_municipal
10+
source: yfinance
11+
fees: 0.0005
12+
slippage: 0.0005
13+
symbols:
14+
- MUBD.L
15+
- MUBU.L
16+
17+
timeframes: ["1d"]
18+
19+
strategies: []

config/collections/bonds_tips.yaml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
metric: sortino
2+
engine: pybroker
3+
asset_workers: 4
4+
param_workers: 1
5+
max_fetch_concurrency: 2
6+
cache_dir: .cache/data
7+
8+
collections:
9+
- name: bonds_tips
10+
source: yfinance
11+
fees: 0.0005
12+
slippage: 0.0005
13+
symbols:
14+
- ITPS.L
15+
- TI5G.L
16+
17+
timeframes: ["1d"]
18+
19+
strategies: []
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
metric: sortino
2+
engine: pybroker
3+
asset_workers: 4
4+
param_workers: 1
5+
max_fetch_concurrency: 2
6+
cache_dir: .cache/data
7+
8+
collections:
9+
- name: bonds_us_treasuries
10+
source: yfinance
11+
fees: 0.0005
12+
slippage: 0.0005
13+
symbols:
14+
- IBTS.L
15+
- IBTM.L
16+
- IBTL.L
17+
18+
timeframes: ["1d"]
19+
20+
strategies: []
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
metric: sortino
2+
engine: pybroker
3+
asset_workers: 4
4+
param_workers: 1
5+
max_fetch_concurrency: 2
6+
cache_dir: .cache/data
7+
8+
collections:
9+
- name: commodities
10+
source: yfinance
11+
fees: 0.0005
12+
slippage: 0.0005
13+
symbols:
14+
- SGLN.L
15+
- PHAU.L
16+
- SSLN.L
17+
- PHAG.L
18+
- IGLN.L
19+
- CRUD.L
20+
- BRNT.L
21+
- NGAS.L
22+
- CMOD.L
23+
- ICOM.L
24+
25+
timeframes: ["1d"]
26+
27+
strategies: []

0 commit comments

Comments
 (0)