12 lines
385 B
Python
Executable File
12 lines
385 B
Python
Executable File
from .base import Context, Strategy, register
|
|
|
|
|
|
@register("buy_and_hold")
|
|
class BuyAndHold(Strategy):
|
|
"""Benchmark: split capital equally across all pairs and hold."""
|
|
|
|
def decide(self, ctx: Context) -> dict[str, float]:
|
|
if any(ctx.weights.get(p, 0) > 0 for p in self.pairs):
|
|
return {}
|
|
return {p: 1 / len(self.pairs) for p in self.pairs}
|