eaf4800b6d
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
41 lines
2.1 KiB
Python
41 lines
2.1 KiB
Python
"""Definizioni canoniche dei portafogli (tutti i tipi visti finora)."""
|
|
from __future__ import annotations
|
|
|
|
import sys
|
|
from pathlib import Path
|
|
|
|
PROJECT_ROOT = Path(__file__).resolve().parents[2]
|
|
sys.path.insert(0, str(PROJECT_ROOT))
|
|
|
|
from src.portfolio.base import Portfolio, SleeveSpec # noqa: E402
|
|
|
|
FADE = [SleeveSpec(kind="single", name=c, sid=f"{c}_{a}", asset=a, cluster=f"{a}-rev")
|
|
for a in ("BTC", "ETH") for c in ("MR01", "MR02", "MR07")]
|
|
HONEST = [
|
|
SleeveSpec(kind="single", name="DIP01", sid="DIP01_BTC", asset="BTC", cluster="BTC-rev"),
|
|
SleeveSpec(kind="single", name="TR01", sid="TR01_basket", cluster="trend"),
|
|
SleeveSpec(kind="single", name="ROT02", sid="ROT02_rot", cluster="rotation"),
|
|
]
|
|
PAIRS = [
|
|
SleeveSpec(kind="pairs", name="PR01", sid="PR_ETHBTC", a="ETH", b="BTC", cluster="ETH-rev"),
|
|
SleeveSpec(kind="pairs", name="PR01", sid="PR_LTCETH", a="LTC", b="ETH", cluster="ETH-rev"),
|
|
SleeveSpec(kind="pairs", name="PR01", sid="PR_ADAETH", a="ADA", b="ETH", cluster="ETH-rev"),
|
|
SleeveSpec(kind="pairs", name="PR01", sid="PR_BTCLTC", a="BTC", b="LTC", cluster="BTC-rev"),
|
|
SleeveSpec(kind="pairs", name="PR01", sid="PR_ETHSOL", a="ETH", b="SOL", cluster="ETH-rev"),
|
|
]
|
|
TSM = [SleeveSpec(kind="single", name="TSM01", sid="TSM01", cluster="trend")]
|
|
SHAPE = [SleeveSpec(kind="ml", name="SH01", sid=f"SH_{a}", asset=a, cluster="shape")
|
|
for a in ("BTC", "ETH")]
|
|
|
|
PORTFOLIOS = {
|
|
"PORT01": Portfolio("PORT01", "Honest", HONEST, weighting="equal"),
|
|
"PORT02": Portfolio("PORT02", "Fade master", FADE, weighting="equal"),
|
|
"PORT03": Portfolio("PORT03", "Master", FADE + HONEST, weighting="equal"),
|
|
"PORT04": Portfolio("PORT04", "Master + pairs", FADE + HONEST + PAIRS,
|
|
weighting="cap", caps={"PAIRS": 0.33}),
|
|
"PORT05": Portfolio("PORT05", "Master esteso", FADE + HONEST + PAIRS + TSM,
|
|
weighting="cap", caps={"PAIRS": 0.33}),
|
|
"PORT06": Portfolio("PORT06", "Master + shape", FADE + HONEST + PAIRS + TSM + SHAPE,
|
|
weighting="cap", caps={"PAIRS": 0.33}, leverage=2.0),
|
|
}
|